ES2 and VBOs

Hello all,
I searched the web for an answer to my question below - without luck so far. I hope that the question makes sense…!

I develop for Android 2.2. I wish to make a GLES20 graphics application using “Java”. Furthermore I want to use VBOs.

In GL10, one rendered the VBOs (for instance) like this:


            GL11 gl11 = (GL11) gl;
            gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
            gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertexBufferObjectId);
            gl11.glVertexPointer(3, GL10.GL_FLOAT, VERTEX_SIZE, 0);
            gl.glEnableClientState(GL10.GL_NORMAL_ARRAY);
            gl11.glNormalPointer(GL10.GL_FLOAT, VERTEX_SIZE, VERTEX_NORMAL_BUFFER_INDEX_OFFSET * FLOAT_SIZE);
            gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mElementBufferObjectId);
            gl11.glDrawElements(GL10.GL_TRIANGLES, mIndexCount, GL10.GL_UNSIGNED_SHORT, 0);

(this is actually an extract from the CubeMap Android example).

In GL20 everybody creates their buffers using ByteBuffer.allocateDirect. Then, they are rendered / loaded using attribute pointers


GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false, TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
...

(the argument “mTriangleVertices” is a Buffer, not the “name” of a VBO (int).

To my understanding the Buffers in the GL10 version are in VRAM whereas the buffers in the GLES20 version live in RAM. Unfortunately this part in the ES20 documentation by Munshi and Leech (pp. 24 / 25) is not very clear to me.

I would like to make sure that there is no need / no possibility to use buffers loaded to VRAM using glBufferData in GLES20.

Any help would be appreciated.

Kind regards, Jan

I would like to use BindBuffer in combination

You can and should use VBOs in OpenGL ES 2.0, too. The commands to handle buffer objects (e.g. glBindBuffer, glBufferData) are available in ES2.0, you just use the generic glVertexAttribPointer instead of the different gl*Pointer variants in ES1.x.

Hi Georg,
thanks a lot for taking the time to reply to my question. After I read your hint I took the time and courage to google my problem once again and stumbled across this: Google Issue Tracker
…which is basically the answer to my problem:
Yes, VBOs should be used but in GLES2.0 you cannot - at least with the current implementation.

Thanks again & cheers,
Jan

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.