View Full Version : is gl_Normal averaged vector?
08-08-2010, 04:15 AM
For shading, normal vector per vertex should be averaged by normals of triangles sharing the vertex. In applying shading, i'm confused with whether gl_Normal representing built-in attribute normal vector per vertex is averaged vector.
Should i average normal vector by myself?
08-08-2010, 05:27 AM
In fact normals are specified per vertex, like all vertex attributes.
That means that in the vertex shader, the normal must have already been calculated by you.
In the fragment shader, the normal is a linear interpolation between the 3 adjacent vertices, so for best results it should be renormalized within the shader.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.