Difference between revisions of "Talk:Vertex Specification Best Practices"

From OpenGL Wiki
Jump to navigation Jump to search
m (Changed the vertex layout section)
 
Line 2: Line 2:
  
 
I removed most of the vertex alignment recommendations, since they did not make any sense. For example, "However, if we need to dynamically update a single vertex attribute in a batch every so often, we'll likely want to pull this vertex attribute off into its own VBO so we can update it by itself." is just not true, since glBufferSubdata can be used instead. I replaced it with some information on GPU internals.  [[User:Domi|Domi]] ([[User talk:Domi|talk]]) 06:04, 22 October 2012 (PDT)
 
I removed most of the vertex alignment recommendations, since they did not make any sense. For example, "However, if we need to dynamically update a single vertex attribute in a batch every so often, we'll likely want to pull this vertex attribute off into its own VBO so we can update it by itself." is just not true, since glBufferSubdata can be used instead. I replaced it with some information on GPU internals.  [[User:Domi|Domi]] ([[User talk:Domi|talk]]) 06:04, 22 October 2012 (PDT)
 +
 +
: Actually, that is true. It doesn't technically have to go into its own separate buffer object, but [[Buffer Object Streaming]] is something best done in a buffer dedicated to that purpose. Especially for orphan-based streaming, where you need to discard the entire buffer.
 +
 +
: Also, some of your recommendations are flat-out wrong, such as the "padding attributes to 4 components" nonsense. What matters to the hardware is the size of the entire vertex, and the alignment of individual attribute offsets. It is perfectly performant to use a 3-vector floating-point position and a 4-vector ubyte color, for a 16-byte vertex size. [[User:Alfonse|Alfonse]] ([[User talk:Alfonse|talk]]) 10:52, 22 October 2012 (PDT)

Latest revision as of 17:52, 22 October 2012

This page is something of a mishmash of different bits of information about how to achieve fast vertex rendering. It needs to be made more cohesive and whole. Alfonse 20:23, 6 September 2009 (UTC)

I removed most of the vertex alignment recommendations, since they did not make any sense. For example, "However, if we need to dynamically update a single vertex attribute in a batch every so often, we'll likely want to pull this vertex attribute off into its own VBO so we can update it by itself." is just not true, since glBufferSubdata can be used instead. I replaced it with some information on GPU internals. Domi (talk) 06:04, 22 October 2012 (PDT)

Actually, that is true. It doesn't technically have to go into its own separate buffer object, but Buffer Object Streaming is something best done in a buffer dedicated to that purpose. Especially for orphan-based streaming, where you need to discard the entire buffer.
Also, some of your recommendations are flat-out wrong, such as the "padding attributes to 4 components" nonsense. What matters to the hardware is the size of the entire vertex, and the alignment of individual attribute offsets. It is perfectly performant to use a 3-vector floating-point position and a 4-vector ubyte color, for a 16-byte vertex size. Alfonse (talk) 10:52, 22 October 2012 (PDT)