Advantage of GL_TRIANGLE_STRIP?

Sage
Posts: 1,232
Joined: 2002.10
Post: #16
Any attribute you enable must point to valid data at draw time. Else, undefined behavior (including crash.)

To understand how pointers are set, please read the VBO specification.

Specifically, these paragraphs:
Code:
A buffer object binding point is added to the client state associated
    with each vertex array type.  The client does not directly specify
    the bindings to with these new binding points.  Instead, the commands
    that specify the locations and organizations of vertex arrays
    copy the buffer object name that is bound to ARRAY_BUFFER_ARB to the
    binding point corresponding to the vertex array of the type being
    specified.  For example, the NormalPointer command copies the value
    of ARRAY_BUFFER_BINDING_ARB (the queriable name of the buffer binding
    corresponding to the target ARRAY_BUFFER_ARB) to the client state
    variable NORMAL_ARRAY_BUFFER_BINDING_ARB.

Rendering commands ArrayElement, DrawArrays, DrawElements,
    DrawRangeElements, MultiDrawArrays, and MultiDrawElements operate as
    previously defined, except that data for enabled vertex, variant, and
    attrib arrays are sourced from buffers if the array's buffer binding
    is non-zero.  When an array is sourced from a buffer object, the
    pointer value of that array is used to compute an offset, in basic
    machine units, into the data store of the buffer object.  This offset
    is computed by subtracting a null pointer from the pointer value,
    where both pointers are treated as pointers to basic machine units.

So, as Skorche said, if you change VBO bindings, you need to reset the pointer(s) to make that actually take effect.

Understanding how the state is tracked will hopefully clear everything up.
Quote this message in a reply
Member
Posts: 95
Joined: 2009.09
Post: #17
(Jul 20, 2010 10:10 AM)arekkusu Wrote:  So, as Skorche said, if you change VBO bindings, you need to reset the pointer(s) to make that actually take effect.

Just to be on the save side here and maybe this is due to the language barrier, which openGL command do you mean by "reset the pointer(s)"?

EDIT:
Question 2: What is this about ARB? I never read anything in the OpenGL ES programming Guide about this extension. I mean I followed the instructions in their sample : OpenGL ES Programming Guide
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #18
glVertexPointer, glNormalPointer ... glVertexAttribPointer are the commands that set the pointers.

Just like the spec says in that first paragraph I quoted-- when you call one of those commands, GL remembers the pointer you specify, along with the stride/type etc. Also, the name of the currently bound VBO (the thing you bound to ARRAY_BUFFER) is copied to the corresponding per-attribute binding point (VERTEX_ARRAY_BUFFER_BINDING, NORMAL_ARRAY_BUFFER_BINDING ... VERTEX_ATTRIB_ARRAY_BUFFER_BINDING[n]).

When you draw, GL looks at all of the enabled attributes. For each:
if there is an VBO bound to the corresponding binding point (VERTEX_ARRAY_BUFFER_BINDING, etc) then the pointer is treated as an offset to the (allocated by GL) base address of the corresponding buffer.
else, the pointer is a pointer to client memory.

Again: to summarize, glBindBuffer(GL_ARRAY_BUFFER, foo) only changes the binding. The value of GL_ARRAY_BUFFER does nothing at draw time.



The ARB VBO spec is the original desktop extension. It was rolled into desktop OpenGL 1.5.
OpenGL ES 1.1 is based on desktop OpenGL 1.5. The VBO functionality is very similar (though ES is slightly more limited.)
Quote this message in a reply
Member
Posts: 95
Joined: 2009.09
Post: #19
(Jul 21, 2010 08:35 AM)arekkusu Wrote:  glVertexPointer, glNormalPointer ... glVertexAttribPointer are the commands that set the pointers.

Thank you for clarifying, then I understood you correctly.

Sadly thats the way I understood it all the way, so I still don't see why it isn't working Sad
Quote this message in a reply
Member
Posts: 95
Joined: 2009.09
Post: #20
Forget my former ranting, I forgot I changed the type of the normals and uv-coords to "SHORT"s and still put GL_Floats into the VBO.

Sadly I also realised I have a 2G iPod Touch (I always thought its 3G since I bought it after 9.09.09, but appearently they sent the old ones to customers in europe buying stuff last september).

So now the VBO's are working perfectly and I can confirm they don't add a single FPS on PowerVR MBX GPU's.

:/
Quote this message in a reply
Apprentice
Posts: 19
Joined: 2010.03
Post: #21
(Jul 23, 2010 02:54 AM)Bersaelor Wrote:  Forget my former ranting, I forgot I changed the type of the normals and uv-coords to "SHORT"s and still put GL_Floats into the VBO.

Sadly I also realised I have a 2G iPod Touch (I always thought its 3G since I bought it after 9.09.09, but appearently they sent the old ones to customers in europe buying stuff last september).

So now the VBO's are working perfectly and I can confirm they don't add a single FPS on PowerVR MBX GPU's.

:/

That might be the case but it could be you have an even bigger slowdown masking any gain you've just made, too many redundant material changes for example.

Congrats on making some progress though Smile

Good luck.
Quote this message in a reply
Member
Posts: 142
Joined: 2002.11
Post: #22
(Jul 23, 2010 02:54 AM)Bersaelor Wrote:  Forget my former ranting, I forgot I changed the type of the normals and uv-coords to "SHORT"s and still put GL_Floats into the VBO.

Sadly I also realised I have a 2G iPod Touch (I always thought its 3G since I bought it after 9.09.09, but appearently they sent the old ones to customers in europe buying stuff last september).

So now the VBO's are working perfectly and I can confirm they don't add a single FPS on PowerVR MBX GPU's.

:/

Not surprised Rasp

Quote:On most POWERVR MBX systems you might not see a noticeable increase in performance using vertex buffers, but it will not degrade performance either. On newer generations of POWERVR hardware (SGX), using vertex buffers can make a noticeable difference in performance.

http://www.imgtec.com/factsheets/SDK/POW...ternal.pdf
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Normals and GL_TRIANGLE_STRIP Mars_999 12 10,000 Jul 30, 2003 10:00 PM
Last Post: Mars_999
  How to take advantage of HW T&L? morgant 14 5,844 Jun 20, 2003 04:08 PM
Last Post: OneSadCookie