vertex buffer objects and per face normals

vertex buffer objects and per face normals

Post by halex200 » Wed, 03 May 2006 19:50:38


Hi, I need to use per face normals (that is, I need cubes appear as cubes
and not as spheres :-) using VBO. The only solution I know, is to split my
geometry in the single faces, but this would create redundant data (normals,
vertices, uv coords).
Is there a better way?
Thank you
 
 
 

vertex buffer objects and per face normals

Post by Gernot Fri » Wed, 03 May 2006 21:08:31


"halex2000" < XXXX@XXXXX.COM > schrieb im Newsbeitrag


No. A nomral and a vertex always come together.

 
 
 

vertex buffer objects and per face normals

Post by halex200 » Wed, 03 May 2006 21:15:00

Well, thank you. Does this mean that I need to repeat every vertex as many
times as are the polygons that share it?
I don't like it at all, but ok... thank you again!

"Gernot Frisch" < XXXX@XXXXX.COM > ha scritto nel messaggio
 
 
 

vertex buffer objects and per face normals

Post by jbwes » Wed, 03 May 2006 23:43:16


You may well find that display lists are faster & consume less memory for
this case.
jbw
 
 
 

vertex buffer objects and per face normals

Post by forkazo » Thu, 04 May 2006 14:13:19


Counterintuitively, a vertex is *not* just a position in space. A
vertex is a position in x,y,z,u,v,w, and normal space, etc. If two
vertices happen to have the same x,y,x position, but differ in some of
the other dimensions, then they are treated as different vertices.

Imagine trying to convince OpenGL that two vertices that shared X and Y
coordinates but differed in the Z coordinate were actually the same
vertex. Sure, you would hate to duplicate the X and Y data which is
identical between them, but implimenting such a special case isn't
really worth the trouble.
 
 
 

vertex buffer objects and per face normals

Post by halex200 » Thu, 04 May 2006 20:39:21

Thank you. Then I will write a function to split my polygons (since 3ds
format , as far as I know, only contains shared vertices).

"forkazoo" < XXXX@XXXXX.COM > ha scritto nel messaggio
 
 
 

vertex buffer objects and per face normals

Post by jbwes » Thu, 04 May 2006 23:01:08


That's not necessarily the best solution. if you have some objection to
display lists, which may well be faster and take less memory than split-up
VBO's, what happens if you replicate the normals 3 times and then pass them
in with a VBO and/or with a FLAT shademodel? It's not "right" but it might
be pretty close.

-jbw
 
 
 

vertex buffer objects and per face normals

Post by halex200 » Fri, 05 May 2006 17:14:24

I've nothing against display list, but I was always told that VBO are much
faster (due to data stored on video ram). In addition, I'm a beginner with
opengl and since I was able to make VBO running, I don't feel like spending
the time for learning disply lists.
Anyway, as soon as I will move from experimenting to a true little project I
will consider them. Thank you again.

"jbwest" < XXXX@XXXXX.COM > ha scritto nel messaggio
 
 
 

vertex buffer objects and per face normals

Post by jbwes » Sat, 06 May 2006 09:08:38


VBO's are not always faster, and in this case are likely slower in my
experience. Display lists are in video ram also, usually.

-jbw