Questions tagged [vertex-buffer-object]

The tag has no usage guidance.

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

Vertex attribute alignment <4 bytes

I know that vertex attributes sourced from vertex buffers in OpenGL need to adhere to the basic alignment requirements of their base types, so e.g. 4 bytes for floats or uints. However, I am unable to ...
Christian Rau's user avatar
0 votes
2 answers
212 views

Why are the transformations of an object calculated on CPU?

If I understood correctly this is the process of rendering an object: Array of 4d vector defining points 3d points(with the fourth component 1) representing object's vertices in object/local space: <...
Bogdan Floareș's user avatar
0 votes
0 answers
53 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 ...
Lenny White's user avatar
1 vote
1 answer
453 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 ...
Jespertheend's user avatar
0 votes
0 answers
671 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/...
alexpanter's user avatar
4 votes
1 answer
563 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 ...
TomKern's user avatar
  • 251
0 votes
1 answer
152 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 ...
Lenny White's user avatar
0 votes
1 answer
218 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 ...
SungJinKang's user avatar
2 votes
1 answer
55 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 ...
Gary Allen's user avatar
2 votes
2 answers
380 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 ...
Sherlock Holmes's user avatar
1 vote
2 answers
683 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 ...
user avatar
0 votes
0 answers
23 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 ...
Sniggerfardimungus's user avatar
1 vote
1 answer
56 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: ...
clamp's user avatar
  • 113
1 vote
1 answer
82 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 ...
invertedPanda's user avatar
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 ...
Trantor's user avatar
  • 141
0 votes
1 answer
300 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): ...
scx's user avatar
  • 169
6 votes
1 answer
241 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 ...
J.Doe's user avatar
  • 1,445
3 votes
1 answer
5k 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 ...
Archmede's user avatar
  • 481
6 votes
3 answers
7k 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 ...
Makogan's user avatar
  • 1,696
4 votes
1 answer
120 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 ...
Daniel Kareh's user avatar
18 votes
2 answers
20k 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 ...
Julien Guertault's user avatar
0 votes
1 answer
333 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 ...
Younes Jafari's user avatar
6 votes
0 answers
477 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 ...
lcmylin's user avatar
  • 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 ...
user3855005's user avatar
1 vote
1 answer
519 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 ...
piegames's user avatar
  • 297
2 votes
2 answers
6k 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 ...
Adrian's user avatar
  • 667
3 votes
1 answer
978 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. ...
remi000's user avatar
  • 240
2 votes
1 answer
5k 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 ...
remi000's user avatar
  • 240
4 votes
2 answers
1k 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 ...
Adrian's user avatar
  • 667
5 votes
1 answer
201 views

OpenGL VertexArray Data "Retention"?

After calling glVertexAttribPointer to associate data of the currently bound vertex array with data from the currently bound ...
salbeira's user avatar
  • 303
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 ...
Christian_B's user avatar
1 vote
1 answer
806 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 ...
lega's user avatar
  • 57
5 votes
2 answers
980 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 ...
BPiek's user avatar
  • 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 ...
BPiek's user avatar
  • 307
4 votes
2 answers
5k 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). ...
q9f's user avatar
  • 703
5 votes
2 answers
2k 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 ...
q9f's user avatar
  • 703
14 votes
2 answers
11k 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: ...
q9f's user avatar
  • 703
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 (...
q9f's user avatar
  • 703
5 votes
1 answer
1k 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. ...
Andrew Wilson's user avatar
4 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 ...
q9f's user avatar
  • 703
11 votes
3 answers
3k 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. ...
Ethan Bierlein's user avatar