Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (654)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  VBO problem with triangle strip  (Read 2314 times)
0 Members and 1 Guest are viewing this topic.
Offline Koen Samyn

Senior Newbie

« Posted 2006-08-09 09:01:30 »

Hi all,

I have a problem using a VBO in combination with a triangle strip. The program crashes when I use a larger geometry (128x128 points) and with a smaller geometry (32x32) the program runs but I see a lot of extra triangles.

The programs executes perfectly when I disable VBO's (see code in green bold).

I think the problem is in the way I define the ELEMENT_ARRAY_BUFFER, but nothing seems to help.

Using a vbo for the geometry and the non vbo version for the glDrawElements results in a guaranteed crash  Smiley

Any help is appreciated  Huh

public void draw(ViewPoint vp, GL gl, GLU glu, DrawingMode mode) {
        final boolean VBOSupported = gl.isFunctionAvailable("glGenBuffersARB") &&
                gl.isFunctionAvailable("glBindBufferARB") &&
                gl.isFunctionAvailable("glBufferDataARB") &&
        TerrainTriangleStrip strip =refinement.refineTerrain(vp);
        if (VBOSupported){
            if ( !vboCreated){
                int[] id = new int[2];
                vboID = id[0];
                indicesID = id[1];
                vboCreated = true;
                System.out.println("VBO created");

        if ( ! VBOSupported){
            gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_LINE);


Offline Koen Samyn

Senior Newbie

« Reply #1 - Posted 2006-08-11 20:09:36 »

I'm one step closer to the solution of my problem. I specified a STATIC DRAW buffer but this crashes with a lot of geometric data. When I specify a STREAM DRAW vbo buffer my application doesn't crash anymore, BUT

I get a lot of extra triangles in my application. A lot of vertices seem to connect back to index 0, which is really strange to say the least.
(say attached screenshot)

Without vbo's the same triangle strip is rendered correctly.

Anybody have any idea what could be the cause ? Huh

Offline Riven
« League of Dukes »

« JGO Overlord »

Medals: 1022
Projects: 4
Exp: 16 years

Hand over your head.

« Reply #2 - Posted 2006-08-11 21:29:42 »

I really gave it some time, but LWJGL is quite a bit different from JOGL in this case.

Anyway, suppose you passed all the right arguments, the only difference I see is that you don't rewind your strip in your VBO code.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Koen Samyn

Senior Newbie

« Reply #3 - Posted 2006-08-11 21:32:17 »

Thanks Riven, but I found my mistake (good thing this is the clueless newbie section)

I  didn't specify the correct size for my buffers.
I used the limit() function to get the size for the vbo buffer , but offcourse it has to be terrainData.limit()*4 (float size),same goes for the triangle strip buffer.

Offline Riven
« League of Dukes »

« JGO Overlord »

Medals: 1022
Projects: 4
Exp: 16 years

Hand over your head.

« Reply #4 - Posted 2006-08-11 21:40:58 »

Ah, right, LWJGL does that all for you, as it respects the position/limit of the Buffer. You also wouldn't need to pass GL_UNSIGNED_INT if you passed an IntBuffer. JOGL seems a tiny bit more lowlevel on this one.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

SHC (36 views)
2015-08-01 03:58:20

Jesse (24 views)
2015-07-29 04:35:27

Riven (44 views)
2015-07-27 16:38:00

Riven (24 views)
2015-07-27 15:35:20

Riven (27 views)
2015-07-27 12:26:13

Riven (18 views)
2015-07-27 12:23:39

BurntPizza (39 views)
2015-07-25 00:14:37

BurntPizza (48 views)
2015-07-24 22:06:39

BurntPizza (33 views)
2015-07-24 06:06:53

NoxInc (40 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!