PDA

View Full Version : normal mapping



nk
09-28-2004, 06:00 AM
Does anyone know a link to a simple tutorial with normal mapping - ex. a plane with 2 textures: one with data to show and one with the normals
AND WITHOUT CG, just OGL shading...

Aeluned
09-28-2004, 06:22 AM
Didn't search for a link, but it's really not that hard.

chapter 9 of the Orange Book (OpenGL shading language) describes how to implement a vertex and fragment shader that emulate the FFP (fixed functionality pipeline).

Offload the light calculations to your fragment shader - declare and define the varying vec3 'normal' in your vertex shader.

all you have to do now is supply the fragment shader with a normal map and modify the passed in interpolated normal by the value in the normal map texture lookup.

all of your FFP code will take care of the rest.

CrazyButcher
09-28-2004, 11:09 AM
http://www.ati.com/developer/sdk/RADEONSDK/Html/Samples/OpenGL/RADEONSimpleDOT3.html

nk
09-29-2004, 12:59 AM
For CrazyButcher: the example is interesting, but I think I wasn't clear: I want normal mapping using OGL shading language.

MattS
09-29-2004, 04:11 AM
http://download.nvidia.com/developer/SDK/Individual_Samples/DEMOS/OpenGL/bump_mapping .zip (http://download.nvidia.com/developer/SDK/Individual_Samples/DEMOS/OpenGL/bump_mapping.zip)