Archived

This topic is now archived and is closed to further replies.

willyx

Alpha problem with Light enabled

Recommended Posts

if i use this before apply the texture glColor4f(1.0f,1.0f,1.0f,0.5f); I''ve the texture with 50% solid. But if i enable glEnable(GL_LIGHTING); the texture is 100% solid. Lights works and the alpha channel of the texture is well used, but not modify from the glColor4f. How i can solve this problem?

Share this post


Link to post
Share on other sites
Hello Willyx,

yeah, if you use lighting the color is ignored, but the material color is used. Use glMaterial* to change the color when using lighting.
Alternative you can call glEnable(GL_COLOR_MATERIAL) and everytime you call glColor* the material will be changed too. Try it out. Use glColorMaterial to customize the behavior when GL_COLOR_MATERIAL is enabled.

Hope it helps
Ben

Share this post


Link to post
Share on other sites
Thanks,thanks,thanks!
Yes now works fine...i''ll put your name in the greetings of my final exam (i''m doing a game in openGL for that)

Share this post


Link to post
Share on other sites