tags:

views:

28

answers:

1

Hello all,

I am rendering a 3D object WITHOUT lighting. However, I would like to change the opacity of this object.

Is it possible? Or, will I have any rendering issue?

Thank you

+1  A: 

Enable blending using glEnable(GL_BLEND), then choose the correct blending function you need (glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) should be fine) and set the correct color of your model so it has an alpha component different from 1 (either from a texture or from glColor4. function).

tibur
Hello tibur,I am sorry for the typo I put on the original post.The correct question is updated. Basically, I would like not enable lighting but change the opacity. Is that possible?
q0987
@q0987 : tibur's answer doesn't mention lighting at all. Just enable blending, set the blending source and destination factors, and you're ready to go. Opacity is additive alpha blending.
Mads Elvheim