I'm at a loss using VBO allocating

I use VBO to render my terrain. I allocate after a button press.
I can scale the terrain size. if I create a terrain, the software render it wery well with 1 texture. Then, Defining a new one with the same or lesser terrain works too. But defining a larger terrain result an invisible terrain without texture.
I have no idea what could be the problem.

gl.glColor3f( 0.4f, 0.5f, 1.0f );
gl.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, vertexNames[actualTerrain][0] );
gl.glVertexPointer( 3, GL.GL_FLOAT, 0, BufferUtils.bufferOffset( vertexOffsets[actualTerrain][k][l] * BufferUtils.SIZEOF_FLOAT ) );

gl.glBindTexture( GL.GL_TEXTURE_2D, detailTextures[actualTerrain][ p ] );
gl.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, names[2] );
gl.glTexCoordPointer( 2, GL.GL_FLOAT, 0, BufferUtils.bufferOffset(0) );
gl.glEnable( GL.GL_TEXTURE_2D );

gl.glBindBufferARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB, names[0] );

gl.glEnableClientState( GL.GL_VERTEX_ARRAY);
gl.glEnableClientState( GL.GL_TEXTURE_COORD_ARRAY );

gl.glDrawRangeElements( GL.GL_TRIANGLE_STRIP, 0, vertexIndexCount, vertexIndexCount, GL.GL_UNSIGNED_INT, BufferUtils.bufferOffset( 0 ) );

gl.glDisableClientState( GL.GL_VERTEX_ARRAY);
gl.glDisableClientState( GL.GL_TEXTURE_COORD_ARRAY );

It dowsn’t work when I create a larger terrain than last one.
The tringle_strip appears but the texture not.


The vbo creation code:

public static void deleteVBONames(){
if( vertexNames[actualTerrain][0] != 0 ){ gl.glDeleteBuffersARB( 1, vertexNames[actualTerrain] ); }
}

public static void createVBONames(){
gl.glGenBuffersARB( 1, vertexNames[actualTerrain] );
gl.glBindBufferARB( GL.GL_ARRAY_BUFFER_ARB, vertexNames[actualTerrain][0] );
gl.glBufferDataARB( GL.GL_ARRAY_BUFFER_ARB, stepLimits[ actualTerrain ] * stepLimits[ actualTerrain ] * 3 * vertexCount * BufferUtils.SIZEOF_FLOAT, vertexBuffer[actualTerrain], GL.GL_DYNAMIC_DRAW_ARB );
/*int[] i = createInt1DArray( 1 );
gl.glGetBufferParameterivARB( GL.GL_ARRAY_BUFFER_ARB, GL.GL_BUFFER_SIZE_ARB, i );
System.out.println(";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"+i[0]); */
gl.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, 0);
}

The glGetBufferParameterivARB return value is equals to the new buffer size expected.

Thanks

Have you tried installing the DebugGL pipeline to see if there are any errors reported during rendering?

Also take a look at the VBO example in the jogl-demos workspace.

Hello! Thanks to try to help me.:slight_smile:

The code is written by the jogl vbo demo.

I haven’t tried installing DebugGL, I try it asap.

Thanks!

Hello,

I used this statement:
glDrawable.setGL(new DebugGL(glDrawable.getGL()));

Nothing changed. No exception has been throwned.

Has You got another idea? I hasn’t.