Skip to main content
gamedev.net
๐Ÿ”’ Locked

GL_NORMALIZE

Started by lazE Nov 30, 2004 at 3:53 AM 2 replies 3.8k views
Original Post
lazE
lazE
Will enabling GL_NORMALIZE compute normals for me and get them of unit length or does it just take normals I've already computed and turn them into unit normals? Thanks.
"We are what we repeatedly do. Excellence, therefore, is not an act, but a habit."-Aristotle
todderod
todderod
It will not calculate normals for you, just normalize every normal that you feed the pipeline with afaik.
CipherCraft
CipherCraft
The Red Book states:

Quote:
If you perform irregular transformations, or if you specify nonunit-length normals, then you should have OpenGL automatically normalize your normal vectors after the transformations. To do this, call glEnable (GL_NORMALIZE).

If you supply unit-length normals, and you perform only uniform scaling, you can use glEnable (GL_RESCALE_NORMAL) to scale the normals by a constant factor.


And as todderod already stated, you must supply the normals yourself.

So as to your question: the answer is that GL_NORMALIZE will not generate normals, but will normalize the ones you've already provided. Beware that this is done for each new frame you render...

hth
CipherCraft
Solias
Solias
Quote:
Original post by CipherCraft
Beware that this is done for each new frame you render...


If your normals aren't changing every frame you are probably better of normalizing them yourself. Rotation and translation will not affect the length of your normals, but scale will. So if you want to use glScale() with lighting you will need to turn on GL_NORMALIZE.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.