PDA

View Full Version : Sanity check regarding normalization with cube maps



CatAtWork
07-09-2004, 11:23 AM
Given that
fragment.texcoord[3] contains a vector multiplied by the inverse transpose of the modelview matrix.
( and is not already normalized )

texture[1] contains a normalizing cube map.

These two ARBfp snippets should be pretty much the same, right?


# normalize with math
DP3 normal.w, fragment.texcoord[3], fragment.texcoord[3];
RSQ normal.w, normal.w;
MUL normal.xyz, fragment.texcoord[3], normal.w;
# normalize via cube maps
#TEX normal.xyz, fragment.texcoord[3], texture[1], 3D;
#MAD normal.xyz, normal, two, neg_one;

Tom Nuydens
07-09-2004, 11:36 AM
TEX normal.xyz, fragment.texcoord[3], texture[1], CUBE;

-- Tom

CatAtWork
07-09-2004, 11:39 AM
Thanks Tom. *Hangs head in shame*