Skip to main content
gamedev.net
🔒 Locked

Texture mapping modulation

Started by Frogget 2 replies 600+ views
Original Post
Frogget
Frogget
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.
SimmerD
SimmerD
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.
Frogget
Frogget
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?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.