Jump to content
  • Advertisement

Archived

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

willyx

Alpha problem with Light enabled

This topic is 6197 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!