PDA

View Full Version : NV_texgen_reflection software equivalent



MichaelK
07-01-2003, 04:33 AM
Since GL_NV_texgen_reflection is not supported on older cards I have to fallback to software texcoord generation if this ext is not supported.
I have searched all the web but found nothing except Brian Pauls Mesa3D library. But you know this library is so Messy, that I cant figure out whats going on.
I anyone could drop me a link with valuable information about generating normal and reflection map I would be very thankful.

mk

Nutty
07-01-2003, 04:57 AM
Just do;

For every vertex, calculate vertex to eye vector, and reflect that in the normal, and use that as the cubemap tex coords.

Mazy
07-01-2003, 05:01 AM
Isn't it just a normal reflection calculation?

R = 2(NL)N - L , where you replace the Lightvector(L) to the EyeVector instead?

But what use can you have of it on older HW:s? it makes a lookup in a cubemap if i understand it correctly, and older hardware that doenst support NV_reflectiom ( or similar) doesnt support cubemaps either..

MichaelK
07-01-2003, 05:11 AM
Thanks Mazy. (N?L) means (N dot L)?

But what use can you have of it on older HW:s? it makes a lookup in a cubemap if i understand it correctly, and older hardware that doenst support
NV_reflectiom ( or similar) doesnt support cubemaps either..
NORMAL_MAP can be used also with 2D textures. I use NORMAL_MAP for simple light reflections on objects. My app will probably be run on a laptop, with very poor card, that doesnt support this extension.
Thanks

Mazy
07-01-2003, 05:23 AM
? looks like a dot in my browser http://www.opengl.org/discussion_boards/ubb/smile.gif

isnt the 2d equalent of reflection just a simple sphere_mapping?

MichaelK
07-01-2003, 05:46 AM
Originally posted by Mazy:
? looks like a dot in my browser http://www.opengl.org/discussion_boards/ubb/smile.gif

isnt the 2d equalent of reflection just a simple sphere_mapping?


Really? I have to check it tonihgt. I thought that sphere mapping doesnt use normals. And now it shows up that it does!