244
« on: September 19, 2008, 11:54:17 pm »
The easy way to render a face is to calculate the lighting
of each pixel according to the orientation of the face given by
its normal.A normal is simply a 3D vector(unity) giving that
orientation.
To obtain a better result,you can use a different normal for
each pixel.To do that,you use a texture named normalmap.
Each pixel RGB value of the normalmap represent the normal for that pixel.
Here's how you would calculate the x coordinate of the normal from the red value(0-1.0):
x = 2.0 * (redValue - 0.5)
Anim8or actually supports normalmap for bumpmapping.
Heightmaps are used because they make life easier.As soon
as they are loaded, they are converted into normalmap used
for rendering.
Here's an example: