Twoside materials in .egg

For some reason, I couldn’t find a way to set the material’s “twoside” property through the EggMaterial interface, while there is a Material.setTwoside.
How to set a material to be twoside in an .egg file?

If an egg polygon has the “bface” flag set on it, then the material applied to the polygon will have the Twosided flag set on it.


Ah, thanks. I thought bface was just for two-sided polygons.

Another question: if I enable lighting on a node, the vertex colors disappear. Is there a way to still have vertex colors while lighting is enabled?

are you sure is it so? it happens to me the opposite: if I apply lighting I see vertex colors and without it what I just get is a whole blank object

I’m sure. I mean vertex colors, not material colors. You are obviously talking about material diffuse color.

ah darn you’re right - so what vertex colors are good for and how to make it show in P3d?

I use it to give different parts of a model different color tints, for example.
You don’t need to add anything to make vertex colors show. But my problem is when I enable lighting, they disappear.

This depends on your material. If your material has an explicit diffuse color, that color replaces the vertex color. If the material does not have an explicit diffuse color, it allows the vertex color to show through.


Awesome! That works, thanks alot!

Seems like the Shader Generator still doesn’t support it though, I’ll look into fixing that. :slight_smile: