View Full Version : HILO question

09-26-2002, 01:01 AM
If I want to use the HILO format instread of the usual RGB for normalmaps, then I have to change

glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, bump);


glTexImage2D (GL_TEXTURE_2D, 0, GL_HILO16_NV, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, bump);

What else do I have to do?

Btw, is there anyone how have done per-pixel specular lightning with texture shaders or know where to find info about it?

//Regards, Ninja

09-26-2002, 03:34 AM
Demos/papers/presentations on how to use everything about the nvidia cards is on their dev site.


09-26-2002, 08:28 PM
Normals are 3-valued vectors.

HILO textures contains 2-valued tuples.

Ergo, you can't easily put a normal map inside a HILO texture.

09-26-2002, 09:11 PM
actaully jwatte, you can, because there is a mode where it willl calculate a z value as a hemispherical projection of the x and y - giving you a unit length normal.

you must use a signed HILO format, though, and i think it only works for the dotproduct texture shader operations.

09-26-2002, 10:34 PM
a normal is 2dimensional.. it has latitude and longitude.

and yes, teh hiloformat uses 2 components for the normalmap, it calculates z = sqrt(1 - x*x - y*y) in the textureshader and uses it for a textureshader dotproduct. on a normalmap, all normals are facing upwards, => z always greater zero