Skip to main content
4 votes
Accepted

Efficient Dynamic Memory Management

deleteBuffer will delete the buffer in WebGL (and OpenGL) but I'm just curious, is there any reason not to just reuse the same buffer just put new data in it? (eg. have a pool of buffers?)
gman's user avatar
  • 840
3 votes
Accepted

No performance gain from instanced rendering?

Instancing is an improvement relative to multiple draw calls, with state changes between each draw. Instancing exists to allow you to provide per-instance data to each instance, so that it can ...
Nicol Bolas's user avatar
  • 26.1k
3 votes
Accepted

VBO interleaving dillema

not to mention I'm nowhere close to actually drawing the scene I need to - So then do you really want to spend extra time on data transformations, when you could be working on getting the scene ...
DMGregory's user avatar
  • 135k
3 votes
Accepted

opengl two vbo names

glVertexAttribPointer(0, 6, GL_FLOAT, GL_FALSE, 0, 0); This GL call is illegal; if we read the documentation for glVertexAttribPointer we will see: size Specifies ...
Maximus Minimus's user avatar
3 votes
Accepted

Puting all vertex attributes of a scene into a single VBO

You were calculating the starting offsets into the buffer to render from incorrectly. The byte offset used is pointer + first * <...
Alex - GlassEditor.com's user avatar
3 votes
Accepted

What is the best way to interpolate vertex data in OpenGL?

I would implement a model matrix as suggested in the comments. Calculate the new position, (x1 y1): ...
Exide's user avatar
  • 146
3 votes
Accepted

Python GLFW and PyOpenGL: How to update a VBO from a thread while rendering at the same time

If you want to be able to read and write buffers while they're being used, you can use "persistently-mapped buffers". Be aware that by using them, you will become responsible for handling ...
the_Demongod's user avatar
2 votes

Porting deprecated OpenGL to "modern" issues

...
Maximus Minimus's user avatar
2 votes

How should I structure VBOs for my 2d world data?

Your bullet list reads increasingly more efficient as you go. This should probably be taken as a hint on how to realistically get this done. The last thing you really want to be doing is modifying ...
Andon M. Coleman's user avatar
2 votes
Accepted

Best way to add and remove quads in a VBO?

You don't need a dictionary for this, just use an infinite array (c++ - vector, java - arraylist, c# - list) and store an id in the order they can be found in the vbo. If you want to remove one of ...
Bálint's user avatar
  • 14.9k
2 votes

How to Create A Vertex Buffer Object from Wavefront Data

The good news is that you already have most of the code that you need to do this. It's easy to take glBegin/glEnd code, modify it to write to a memory buffer instead of making direct glTexCoord/...
Maximus Minimus's user avatar
2 votes

Poor performance with LWJGL VBO triangles

This is not how you are supposed to use VBOs and you will likely get better performance from immediate mode (glBegin/glEnd). There are a number of things seriously wrong with your code, including: ...
Maximus Minimus's user avatar
2 votes

How can I draw 500 million triangles with OpenGL?

I just don't know what you want to draw. If you want to draw one object with that many triangles, you probably want to use indexed rendering. But if you want to draw that many independent triangles ...
mrdlink's user avatar
  • 323
1 vote

opengl two vbo names

Your problem is this call: glVertexAttribPointer(0, 6, GL_FLOAT, GL_FALSE, 0, 0); In the documentation here size, parameter 2 should be between 1-4. You specified ...
LancesLance's user avatar
1 vote
Accepted

OpenGL: Shader using wrong layout location

This is happening because you're using a stride parameter of 0. In OpenGL stride 0 means that the data is tightly-packed and not interleaved; in your case this ...
Maximus Minimus's user avatar
1 vote
Accepted

i need suggestion animation technique for 3d?

What you're showing looks like it can be accomplished with conventional "skeletal' or "skinned mesh" animation. To do this, we do not export a completely separate model file for every animation frame,...
DMGregory's user avatar
  • 135k
1 vote
Accepted

Migrating 2D game from immediate mode to VBOs

Having spent a not-insignificant amount of time rewriting my rendering code, here is what I would like to tell my past self... Immediate Mode vs. "Modern" OpenGL Immediate mode is terrible practice; ...
Dan's user avatar
  • 255
1 vote

opengl bump mapping (normal mapping) problem with VBO and GLSL

That's not how bump mapping works. Bump mapping adds additional detail to a model, but doesn't change the triangles. You need to render a mooth mesh to make the edges invisible (the normals of a ...
Bálint's user avatar
  • 14.9k
1 vote

Textures problem in LWJGL VBO`s

Let's look at some possible mistakes: 1.) ...
Bálint's user avatar
  • 14.9k
1 vote

Scale VBO magnitudes based on aspect ratio

You need to recalculate your projection matrix whenever the screen aspect ratio changes. 1/100th of the screen width and height is still exactly 1/100th of the screen width and height when the ...
Stephane Hockenhull's user avatar
1 vote

Storing rendering data for voxel game 1 VAO and VBO or 1 for every chunk

I base my water shader off of this work, its directX based but I'm sure with a bit of work you can convert it over but ill go over how I do it so you have an idea\recipe. First up I make a copy of ...
Justin William Stanley Bryant's user avatar
1 vote

Best way to draw a textfield in OpenGL, when performance really matters?

Is it OK to recreate a VBO for every visible change? No, this is never OK. Creating (and destroying) GPU objects at runtime will absolutely kill your performance, and that's on top of the huge ...
Maximus Minimus's user avatar
1 vote
Accepted

How to get a safe index for glVertexAttribPointer without shader?

What you're asking for is impossible. You are essentially asking how to get the address of an object in memory without ever actually creating the object. I don't want to assign the index, because ...
Sean Middleditch's user avatar
1 vote

Rendering without VAO's & VBO's?

The debugger's messages are pretty clear : "clean" core OpenGL should use VAO's and VBO's, not access client-side (i.e. RAM) data. That it works on their end is likely a consequence of their graphics ...
Quentin's user avatar
  • 1,178
1 vote
Accepted

Draw wrong faces in obj model with OpenGL VBO

There are better ways than what I show here, but if you're working on a small game (aka.: you're not working on an A++ game) then you'll be fine with this: The part where you extract the vertex, ...
Bálint's user avatar
  • 14.9k
1 vote
Accepted

Best strategy on VAO and texture coordinates for voxel rendering?

With modern OpenGL, you can solve this elegantly by using instancing and texture arrays. Texture arrays Please see https://www.opengl.org/wiki/Array_Texture for an overview. Using a texture array ...
Maximus Minimus's user avatar
1 vote
Accepted

When should a VBO be unbind or not?

Before glfwCreateWindow() call these functions: ...
Shot's user avatar
  • 238
1 vote

LWJGL version problems

VAOs were introduced in OpenGL 3.0, so if your computer doesn't support OpenGL 3.0 then you're probably out of luck. However, they were available as an extension slightly before that - called ...
Quitting Due To Antisemitism's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible