No Transparency when lighting applied

Hello everyone :slight_smile:

I had some white transparent 3d boxes in my project, which were set up like this:

transparentBox.setTransparency(TransparencyAttrib.MAlpha)
transparentBox.setColor(1,1,1,.4)

Since I added some light sources, those boxes do not appear transparent anymore. Is there any solution for having transparent boxes with lighting? I didn’t find anything so far…

Thank you in advance and let me know, if you need more information.

Thomas

Perhaps you have a material set on your boxes? If that material has a white non-transparent diffuse color (1., 1., 1., 1.), then the light sources will effectively make your boxes appear non-transparent. Without light sources the material has no effect, which would explain why the white scene-graph color does make your boxes transparent in that case.

You might find that you get more reliable results by setting a colour-scale, instead of just a colour; in particular, I think that colour-scales do affect materials.

That’s it! Thank you so much for your quick reply :slight_smile: I deleted the material information from the .egg file and now it is transparent again!

@Thaumaturge: Also thanks to you, I will keep color-scales in mind for the future :slight_smile: