🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Shading a texture.

Started by
1 comment, last by Keith P Parsons 23 years, 11 months ago
I''m having trouble shading the textures that I''m using on various polygons. With out a texture just using the diffuse Material color it looks shaded. But when I apply a texture I get the texture but no shading. Does anyone know how to shading to a texture? Does anyone know were I can find some code that does this?
Advertisement
You need to modulate the shading on top of the texture. Meaning that if you have lit vertices then you need to set the vertex color as the first color componet and the texture as the second texture and modulate them together.
---Ranok---
Yup, in other words make sure your texture environment is set to GL_MODULATE and not GL_REPLACE

Paul Groves
pauls opengl page
paul's opengl message board
Paul Grovespauls opengl page

This topic is closed to new replies.

Advertisement