Results 1 to 7 of 7

Thread: about normals of vertex

  1. #1
    Member Contributor
    Join Date
    Nov 2011
    Posts
    52

    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???

  2. #2
    Senior Member Regular Contributor imported_tksuoran's Avatar
    Join Date
    Mar 2008
    Location
    Cambridge, UK
    Posts
    223

    Re: about normals of vertex

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

    See recent thread http://www.opengl.org/discussion_boa...317#Post306317 and don't miss the link from remdul pointing to http://www.bytehazard.com/code/vertnorm.html

  3. #3
    Member Contributor
    Join Date
    Nov 2011
    Posts
    52

    Re: about normals of vertex

    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

  4. #4
    Member Contributor
    Join Date
    Jan 2010
    Location
    Japan - Greece
    Posts
    99

    Re: about normals of vertex

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

  5. #5
    Senior Member Regular Contributor
    Join Date
    Oct 2010
    Location
    France
    Posts
    458

    Re: about normals of vertex

    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.

  6. #6
    Senior Member Regular Contributor imported_tksuoran's Avatar
    Join Date
    Mar 2008
    Location
    Cambridge, UK
    Posts
    223

    Re: about normals of vertex

    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.

  7. #7
    V-man
    Guest

    Re: about normals of vertex


Similar Threads

  1. Replies: 6
    Last Post: 04-14-2004, 10:07 PM
  2. face normals or vertex normals
    By infinitecmdz in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 02-21-2004, 07:29 AM
  3. vertex normals or face normals
    By infinitecmdz in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-20-2004, 09:35 AM
  4. is it possible to have vertex normals or even face normals using triangle strips nt
    By wildeyedboyfromfreecloud in forum OpenGL: Advanced Coding
    Replies: 63
    Last Post: 03-19-2002, 11:42 PM
  5. Face Normals vs. Vertex Normals
    By detzel in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 03-05-2001, 10:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean