rendering normal

Hello,

I would like to make some bump mapping on a very simplified surface. Of course, I need a normal map, and I would like to read it back from the frame buffer.

Does anybody knows how to ask Opengl to render the normal at each pixel? (x in red, y in green, z in blue). So I just have to make a glReadPixels after this rendering and I’ll have my normal map!

Thanks
Denis

If you have GeForce-based card:

  1. enable the GL_NORMAL_MAP_NV generation of s/t/r texture coordinates.
  2. create cube map textures with colors == normal vertor.
  3. draw whatever you want.

this demo creates normal map in the color buffer:
2-pass Environment Mapped Bump-mapping .

Thanks!

Yes, I’ve got a G-force2
I’ll try it. It seems to be what I wanted!

Denis