I’m looking at making high quality material properties with transparency. The only way I can think to do this currently is a two pass rendering method:
Diffuse lighting/coloring/texturing using {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}
Highlights from specular light and/or reflections using {GL_ONE, GL_ONE}
The two passes are necessary simply because you can only have one blend mode at a time and different aspects of the lighting require different blend modes. I don’t know of any tricks for getting the same visual quality in a single pass. Does anyone know a way?
There was talk at the OpenGL BOF at Siggraph of blend shaders, but I don’t know anything about those yet or if they would help.
Maybe I don’t understand correctly. Doesn’t that require you to use the color that is already in the framebuffer? I thought gl_FBColor was not implemented.
Originally posted by mogumbo: Maybe I don’t understand correctly. Doesn’t that require you to use the color that is already in the framebuffer? I thought gl_FBColor was not implemented.
Nope, that’s not what he’s saying.
If I understand you right what you want to is
(dif * tex) * alpha + (1-alpha) * fb + spec
What dorbie is saying is that you can do it with GL_ONE, GL_ONE_MINUS_SRC_ALPHA by doing