PDA

View Full Version : Storing normals for a non-smoothed sphere



Exoide
03-08-2010, 06:58 AM
Hi there,

I'm creating a sphere by hand using VBOs and IBO, currently I calculate the vertex positions, normal positions and create the sphere using triangles. I did the calculation of normals for a smoothed sphere and it works perfect. I've tested it with some lights and it's nice. It works like glutSolidSphere().

But now I wanna show the same sphere but in a non-smoothed way (like 3DS MAX does) I mean, using orthogonal normals in each triangle. That's easy but the problem is that each triangle has their vertices shared with the adjacent triangles so for each vertex I need more than one normal.

The question is there's a clever way to store the normals in the VBO?

Can someone suggest me a clever way to do that?

Thank you.

overlay
03-08-2010, 09:00 AM
Hello,

OpenGL does not have indexing per attribute. I added a feature request:
http://www.opengl.org/discussion_boards/...5744#Post265744 (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Main=51439&Number=2657 44#Post265744)

Meanwhile, if you go through the tdiscussion hread itself you will find some workaround with the current capabilities of OpenGL (see Ilian Dinev posts)