Lighting and Transparency

I have some nice transparent water wobbling away on top of my floor.

As soon as I enable lighting, the water suddenly is no longer transparent.

I was using SRC_ALPHA,ONE_MINUS_SRC_ALPHA to render the water and GL_MODULATE with an alpha of 0.3 to make it transparent. I suspect lighting interferes in some way with the modulation of the alpha component.

Any suggestions?


Easy, disable lighting when drawing the water. Or adjust the material properties of it.

yeah, your material properties (specifically GL_AMBIENT and GL_DIFFUSE need an alpha value of less than 1.0f. GL_SPECULAR can probably stay at 1.0f, though.)

Thanks guys, that’s great. I’ll give it a go.