I want an object of my scene to become gradually translucent, when an event occurs, and then get back gradually again to opaque.
My blending funcion is:
The effect itself works fine, but I have this problem. In the beginning and end of the effect, since lighting must be disabled for blending, the object I test looks for a moment brighter. This make sense since when lighting is enabled, this object should be darker at the position I placed it, but when lighting is disabled it is rendered only according to the glColor4f values.
Is there any way to have lighting enabled when blending? Or is there any other workaround for my problem?
fixed function lighting uses material properties, set with glMaterial(). In order for the vertex colors (set by glColor4f, etc) to affect lighting you need a call to glColorMaterial().