PDA

View Full Version : GL_RESCALE_NORMAL and GL_NORMALIZE



martinho_
05-11-2004, 08:34 AM
In the opengl spec:


Normals may be rescaled by a constant factor derived from the modelview matrix.
Rescaling can operate faster than renormalization in many cases, while resulting in
the same unit normals. does always RESCALE_NORMAL produce the same results as NORMALIZE? In that case, why does NORMALIZE exist if RESCALE_NORMAL is faster? how fast are both of them? I've read in an nvidia paper that NORMALIZE is almost for free...

Christian Schüler
05-11-2004, 10:08 AM
Normalize will give different results than rescale if your modelview transform has a non uniform scale.

3B
05-11-2004, 10:12 AM
'in many cases' != 'always'...

RESCALE_NORMALS only works (assuming the goal is unit normals) if the original normals are normalized, so thats one case where there is a difference, though that case should probably be fixed in the data if it can be preprocessed at some point.

NORMALIZE also doesn't depend on the properties of the modelview matrix(within reason)...RESCALE only works for a limited set of transforms (uniform scaling specifically).

RESCALE should be as fast or faster than NORMALIZE, since the implementation can choose to do a full normalize in both cases if it doesn't have a fast implementation of rescale in hardware. Enabling both should be slower than either by itself though, since the spec says to compute both of them even if a full normalize is done for RESCALE...