View Full Version : glScalef changes lighting?
I need to use glScalef(2,2,2) and now this triangle that's facing the camera loses about half its light. Normally it gets full illumination from the light behind the camera. Lighting is correct after using glTranslatef and glRotatef, what gives? Maybe its not lighting? Textures are disabled and smooth shading is on.
05-04-2003, 03:28 AM
the noramls you supply (with glNormal3f et al) are transformed by the inverse transpose of the modelview matrix. Scaling the normals producees incorrect results since they become non unit length. To fix this either glEnable(GL_NORMALIZE) or don't use scaling. If you're using software transform and lighting using the rescale normals function (see opengl spec) can be faster than enabling normalization. On all decent graphics hardware since about 2000 or so this is pointless however, just enable normalization.
Ah, I see. Scaling works fine now, thanks!
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.