I have a display list that includes glColor3 calls. I want to be able to fade in and fade out what the display list draws. Am I hosed? Calling glColor4 before the display list draws doesn’t work. BTW the display list has no texturng or lighting - it’s a starfield using points.
From the spec, the color3x calls set implicitely alpha to 1.0, so you need something else for your fade.
A simple fullscreen black quad drawn on top of the scene with blending should be enough : just slide the black quad color from from rgba 0,0,0,0 to 0,0,0,1.
One thought - maybe you could use stencil buffer to indicate which pixels should be darkened. I haven’t worked with it for a long time but it should look like this:
0) draw whatever goes before the starfield
clear stencil buffer
draw starfield writing to stencil buffer
draw quad with stencil test on(and depth write off)
draw whatever goes after the starfield with stencil test off
Enable lighting, set diffuse/specular/ambient to black. Set emissive to the colour + alpha you desire. Bob’s yer uncle. The glColor’s in your display list will be ignored because lighting’s on, and any enabled lights will have no effect because your material reflectance values are set to zero. You’ll just get the emissive showing through.
Also, depending on what sorts of interpolation issues you might have, you could use a texture and texture coordinates instead of colors, then you could use one color call before the display list to set alpha.