Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualvoodoodrul

Posted 05 July 2013 - 03:43 PM

When you call glBufferData, you are telling the GPU how much memory to set aside for the buffer. First, use GL_DYNAMIC_DRAW if you are going to be changing the buffer.

 

I am not too sure about the potential consequences, if any, of calling glBufferData multiple times on the same buffer. I would surmise that changing the buffer size could trash the data stored in the VRAM. I *think* that glBufferData is similar to calling "new" on a pointer. If you need to update part of the buffer, use glBufferSubData.

That's why I thought I should be able to reuse it without flushing it.. 

 

Each chunk has its own VBO so I should be able to create/destroy them without worry. I don't need to rewrite portions of the buffer, I just need a overwrite with data that might be larger or smaller.. 

 

Think this might be a bug in LWJGL's JNI calls? *update* latest version doesn't change anything.. 


#1voodoodrul

Posted 05 July 2013 - 03:24 PM

When you call glBufferData, you are telling the GPU how much memory to set aside for the buffer. First, use GL_DYNAMIC_DRAW if you are going to be changing the buffer.

 

I am not too sure about the potential consequences, if any, of calling glBufferData multiple times on the same buffer. I would surmise that changing the buffer size could trash the data stored in the VRAM. I *think* that glBufferData is similar to calling "new" on a pointer. If you need to update part of the buffer, use glBufferSubData.

That's why I thought I should be able to reuse it without flushing it.. 

 

Each chunk has its own VBO so I should be able to create/destroy them without worry. I don't need to rewrite portions of the buffer, I just need a overwrite with data that might be larger or smaller.. 

 

Think this might be a bug in LWJGL's JNI calls?


PARTNERS