Sign in to follow this  

GL_NORMALIZE

This topic is 4761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this