Jump to content
  • Advertisement
Sign in to follow this  
Frogget

Texture mapping modulation

This topic is 4999 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

What exactly is meant by modulation when mapping textures to a triangle? I have an assignment where I have to map a texture to a triangle using modulation to give the triangle a shaded or lit appearance. The only information I have is that you must multiply the colors of the two pixels (the triangle and the texture) together to get the resulting color. How would this work if the colors range from 0-255? Am I supposed to map those values to between 0-1 and multiply those? Any help would be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Yes, you divide the values by 255, yielding 0..1. Think of these values as a percentage of Red, Green and Blue light reflected. 0.0 means no light of that color is reflected ( all absorbed ), whereas 1.0 means all light of that color is reflected from the surface.

Share this post


Link to post
Share on other sites
Just to be sure I have this right, am I supposed to only divide the texture color values by 255 then multiply those values with underlying triangle colors, which are still between 0-255?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!