Questions tagged [vertex-buffer-object]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

Why use buffer streaming instead of collecting data on CPU and uploading to GPU all at once

Say I have a couple of meshes that I want to reupload to GPU for each frame. I can do this by generating a single array from all the meshes on CPU and then uploading to GPU (ex with ...
1 vote
1 answer
224 views

What does it mean for a buffer to be "tightly packed"?

I keep running into this phrase when reading specs and tutorials, but I have no idea what "tightly packed" is supposed to mean. Is it simply the opposite of an interleaved buffer? I.e. all ...
0 votes
0 answers
105 views

Bind shader storage buffer object for vertex input

I'm trying to learn about compute shaders, and as such decided to give it a go at implementing the particle system described in these slides: https://www.khronos.org/assets/uploads/developers/library/...
3 votes
1 answer
183 views

Which provides better intuition: THREE.Geometry or THREE.BufferGeometry?

THREE.js recently dropped support for THREE.Geometry in favor of exclusively THREE.BufferGeometry. I'm trying to decide which paradigm to teach in my computer graphics course to best provide students ...
  • 241
-1 votes
1 answer
71 views

Passing non-interleaved data to glBufferStorage without using glBufferSubData

I would like to use glBufferStorage to load data once into the vertex buffer. However sometimes I want to pass non-interleaved data from separate arrays like shown ...
0 votes
1 answer
90 views

Are vertices of each LOD version always loaded into VRAM

Are vertices of each LOD version always loaded into VRAM? I know many game engines have a LOD feature for mesh vertices and textures. I'm just wondering if all vertices and textures of all(each) LOD ...
1 vote
1 answer
37 views

Different Vertex structures in multi-purpose system

A typical definition of a Vertex structure in C++ might look something like this: struct Vertex { Vec3 pos; Vec3 color; } However, we found ourselves ...
2 votes
2 answers
152 views

How does a Vertex Buffer manage memory?

I'm learning OpenGL and I'm trying to understand things properly. If my understanding is incorrect at any point, please correct me. Introduction So let's say we have a triangle. This triangle has its ...
0 votes
2 answers
261 views

Efficiently transferring only needed parts of the vertex data to the GPU (C++/OpenGL)

I have a situation, where I have an array of vertices on the CPU side, for which, besides rendering-relevant data, like their position, I have a lot of other data at each vertex. All vertex data is ...
's user avatar
0 votes
0 answers
18 views

Rendering different array types in the same vertex/fragment shader?

I have a pretty basic widget rendering, largely based upon the learnopengl.com "hello triangle." I'm actually using a tristrip to create two triangles, forming a semi-opaque square over the ...
0 votes
0 answers
107 views

How to deallocate memory for vertex buffer objects

I have a class that handles loading buffers for a mesh: ...
1 vote
1 answer
53 views

Performance of particle implementation

I am about to implement the renderer for a simple particle system. Every particle has to be updated every frame (position, rotation, scale) and so I was wondering which way is usually faster: ...
  • 113
1 vote
0 answers
26 views

Confusion about glVertexAttribPointer and non-active attributes

When binding an attribute index using glVertexAttribPointer, what happens when a later bound program does not contain an attribute at said index? Is the behaviour undefined, or is the attribute ...
3 votes
1 answer
2k views

Vulkan: efficient way to update VBO mesh vertices?

I would like to change/add/remove some mesh vertices in existing VBO's (while deforming and remeshing 3D objects) . With OpenGL I would have to reload whole vertex VBO's. I suppose with Vulkan there ...
  • 141
0 votes
1 answer
243 views

Adding vbos to a vao once it has been created

Is it possible to add vbos to vbos after their creation? For example (pseudo-code): ...
  • 171
6 votes
1 answer
210 views

Same draw call causing extremely different GPU usage under different triangle orders

So I have a bit of a predicament I am trying to solve. I have 10,000 triangle strips I am trying to draw. Each one has a z-order for the entire strip and within each strip the most recent triangles ...
  • 1,365
3 votes
1 answer
4k views

Replacing Vertex Attributes (glBufferData vs glBufferSubData)

I'm sending a large number of data to the vertex shader. I use glBufferData to generate my ...
  • 399
5 votes
3 answers
4k views

What is an OpenGL VAO in a nutshell?

Before I get downvoted. I am not asking how to use them, I know how to use them. I am trying to understand what they are. For example, an array is actually a contiguous section of memory, a linked ...
  • 1,449
4 votes
1 answer
114 views

Role of gl.vertexAttrib

I'm re-learning WebGL, and I stumbled upon gl.vertexAttribPointer and gl.vertexAttrib. To my knowledge, gl.vertexAttribPointer tells the GPU how the data in the currently binded buffer relates to the ...
15 votes
2 answers
15k views

GL_STATIC_DRAW vs GL_DYNAMIC_DRAW vs GL_STREAM_DRAW: does it matter?

In OpenGL the buffer object functions (glBufferData, glBufferSubData, and probably a few others) have a parameter ...
0 votes
1 answer
311 views

How to read vertex color before rendering texture?

I'm using VBO to upload vertex array, colors and then texture coordinates! I did implement mouse pick with color coding technique. It works fine but when I render texture after ReadPixels, it returns ...
6 votes
0 answers
404 views

In Metal, what performance advantages are there, if any, to using vertex descriptors and the [[stage_in]] qualifier?

Metal seems to provide two very different ways to access vertex data in your vertex shader. You can: Create an MTLVertexDescriptor object, which describes vertex ...
  • 413
2 votes
1 answer
1k views

Passing Colour from program to vertex shader

New to opengl! I am having issues with passing colours from the program to vertex shader. I am creating a grid where I want to control the color of each cell.Thus I am generating each cell and having ...
1 vote
1 answer
444 views

LWJGL/OpenGL render textured quad

So this should be easy and simple, but I still can't get it to work. All I need is a small example program that: Takes in a BufferedImage (TYPE_INT_ARGB) Renders that BufferedImage on a textured quad ...
  • 297
2 votes
2 answers
5k views

Can one VAO store multiple calls to glVertexAttribPointer?

If no, Should I create a new VAO for every VBO that has its own vertex attribute configurations? Could you please give me a snippet code example that shows how to use one VAO for multiple VBOs? All ...
  • 627
2 votes
1 answer
776 views

Multiple buffers and calling glBufferSubData

In my project, for convenience I would like to use many buffers. Many buffers in my case means 50-100 terrain patches represented by buffers with vertex coordinates, normals, indices and maybe color. ...
  • 230
2 votes
1 answer
4k views

Multiple VAO share a VBO

Let's say I have a have 10 different terrains. Each terrain have the same x and z coordinates, but they have different y coordinate, normals and colors. The indices used for element rendering is also ...
  • 230
4 votes
2 answers
828 views

How glVertexAttribPointer works?

I know that when you call glVertexAttribPointer, you are specifying how the buffer currently binded should take its own data. But if you can have binded one buffer per type (Let's say GL_ARRAY_BUFFER ...
  • 627
5 votes
1 answer
124 views

OpenGL VertexArray Data "Retention"?

After calling glVertexAttribPointer to associate data of the currently bound vertex array with data from the currently bound ...
  • 273
4 votes
1 answer
2k views

Attribute Location in Multiple Shader Programs

I'm trying to switch between the rendering of two different scenes as fast as possible using OpenGL. For all my OpenGL related stuff I wrote a wrapper-class which provides a quite easy way of adding ...
1 vote
1 answer
760 views

How to use Shaders with vertex & index buffers?

I'm trying to render a randomly generated terrain with vertex buffers and OpenGL. I want to use a shader to color the terrain, but it seemms like my shader isn't used. I have used shaders before when ...
  • 57
5 votes
2 answers
914 views

Sharing calculation result between shader programs in OpenGL

Question Is there a way to compute something in a first shader program (eg. screen-space coordinates from word-space ones) and access those results in an another shader program? Possible solutions ...
  • 307
8 votes
1 answer
1k views

Label Placing for thousands of objects with OpenGL

Question How to manage data (GPU,CPU) for dynamic label placement in 3d for thousands of objects (OpenGL)? Details objects: count: 2k-10k type: points/quads labels: bilboarding data: text and ...
  • 307
3 votes
2 answers
3k views

How to encode/decode buffer data in glTF?

I'm playing around with base64 embedded data URI's and tried to analyze the buffer data of the gltf box sample model, as defined in this example here (line 76). ...
  • 603
3 votes
2 answers
1k views

Is it possible to store the plain buffer data in gltf files?

The GL Transmission Format comes along with a JSON styled main file which basicly describes the scene and binary files which contain the buffers. I'm currently writing a WebGL library and I need to ...
  • 603
13 votes
2 answers
9k views

What is an index buffer and how is it related to vertex buffers?

I have a vertex buffer like this: 0.0, 0.0, 1.0, 0.0, 0.0, 0.6, 1.0, 0.6, 0.5, 1.0 I have the following index buffer: ...
  • 603
5 votes
3 answers
3k views

Is it possible to create minimal glTF files with vertex and index buffers?

I am currently looking into glTF to use as a transfer format for my WebGL project. I already have the geometries I wish to render on my WebGL client available as preprocessed vertex and index buffers (...
  • 603
4 votes
1 answer
856 views

Dx12 Vertex Buffer incorrect

I'm playing around with directX 12 and I'm having some problems loading geometry in. I have a std::vector vertices definition and I do exactly what the dx12 template does with it. ...
3 votes
2 answers
4k views

Are there any gltf example datasets available? [closed]

I'm currently researching my options on effeciently exchanging data for a webgl application. I understand the gltf format is still being drafted but I need some example data to understand whether this ...
  • 603
10 votes
3 answers
2k views

Why do Vertex Buffer Objects improve performance?

From my basic understanding, a Vertex Buffer Object works something like this (pseudo code): Normally, if one wanted to say, draw a square, one could issue line drawing commands. ...