PDA

View Full Version : discussion about normals

meeshoo
09-09-2004, 12:26 AM
hi there. well, i have a problem, that i am almost sure it cannot be solved, but i want to ask u first, because i'm just human :) . so:
in 3d studio max, there is a notion called smoothing group. for those who don't know about it, i will try to explain. faces can be part of so called "smoothing groups". vertex normals of the vertices in the same smoothing groups are calculated by interpolating the normals from the 3 adiacent triangles that share the vertex. on the other hand, the vertices which are shared by triangles from different smoothing groups have 2 normal vectors, one for each group. if this 2 groups are rendered separately, when lighted those 2 normals generate a sharp edge. if all 3 triangles that share a vertex are from 3 different smoothing groups, then there will be 3 normal vectors/vertex there is the case of a cube, where vertices are making triaedral(sory for bad english) angles.

so my problem is: can we implement multiple vertex normals in OpenGL using Vertex Arrays? if u find a solution please let me know.
if u don't have any solution then here is a discussion topic:

SHOULDN'T BE IMPLEMENTED IN OPENGL MULTIPLE VERTEX_NORMAL ARRAYS, LIKE TEXTURES, TO SUPPORT UP TO THREE VERTEX NORMALS PER VERTEX?

MattS
09-09-2004, 01:20 AM
If you have a lot of 3D points in space and form triangles by indexing into these (drawing indexed primitives) then the index is used to look up the position and the normal.

So if you have two triangles which share a point in space but have a different normal from one another then you have to split the point so they no longer use the same instance of the point, i.e. create duplicate points.

To the best of my knowledge there is no way to draw indexed primitives using different indices for position, normal, texcoords etc.

Matt

meeshoo
09-09-2004, 01:50 AM
well, you're right, i've heard about this tehnique, but the number of vertices is increasing dramatically in a heavy edged model. this days i'm working on a demo for opengl ES where memory and vertex number is critical for application performance.