about normals of vertex

Hi,guys!
If i got a mesh consits of multiple poloygons,some vertices are shared by some poloygons,can i assign the different normals to the same vertex???

Yes, in that case you duplicate the vertex and set desired normal to each copy.

See recent thread http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=306317#Post306317 and don’t miss the link from remdul pointing to http://www.bytehazard.com/code/vertnorm.html

Can i submit the vertex and normal data array to OPENGL,use fewer data represents vertex,and more data represents normals since a vertex correspond to multiple normals

it all depends on how you would interleave your data in your VBOs and your IBOs I guess.

No you can’t. You must have for each vertex its normal. This will be the same for texture coordinates, colors and other vertex attributes. And this whether you use indicies or not.

Theoretically, you could achieve a fixed normal:vertex ratio with glVertexAttribDivisor(). You could share each normal to exactly 3 vertices for example. However this fixed ratio is in use for a whole draw call, which makes it difficult to be useful for normal sharing. Also you need to use glVertexAttribPointer() etc., and needs at least OpenGL version 3.3.

Vertex duplication is general and effective solution, just go for it.

If you want, you can add an abstraction layer above OpenGL buffers, where you can set attributes per “point” (same vertex location) and per “corner” (corner of specific polygon). When baking these to OpenGL buffers you can merge corners which are equal (or close enough) to a single vertex. Corners with differing attribute values must have the whole vertex duplicated.

It is covered in the Wiki
http://www.opengl.org/wiki/FAQ#Multi_indexed_rendering