Questions tagged [vertex-buffer]

A Vertex Buffer is an object that enables transmitting a collection of vertices to a graphics device for non-immediate or streaming rendering.

A Vertex Buffer is an object that enables transmitting a collection of vertices to a graphics device for non-immediate ot streaming rendering.

Examples are OpenGL's Vertex Buffer Object and Microsoft.XNA VertexBuffer class.

329 questions
4
votes
1 answer

Can I have multiple GL_ARRAY_BUFFER buffers?

So I was looking at another SO question regarding the command glVertexAttribPointer and I ran into a slight confusion. The accepted answer to this question explains, But there's an additional implied piece of state that is also stored away for…
4
votes
2 answers

OpenGL 4 providing data to vertex buffer

I use old way to provide the data to vertex buffer in OpenGL glGenBuffers(1, buffer); glBindBuffer(GL_ARRAY_BUFFER, buffer); glBufferData(GL_ARRAY_BUFFER, sizeof(pos), pos, GL_STATIC_DRAW); glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0,…
nameless323
  • 160
  • 7
4
votes
1 answer

OpenGL buffers - Stride vs Tightly packed

What are the pros and cons for using strided vertex buffers vs tighly packed buffers for each attribute? What I mean is for instance: Stride: xyzrgb xyzrgb xyzrgb Tight: xyzxyzxyz rgbrgbrgb At first glance it might look like you easily can change…
bofjas
  • 1,186
  • 7
  • 19
4
votes
2 answers

DirectX - halfs instead of floats in vertex buffer

Recently I decided to compress my vertex data to make rendering more efficient, and I came across a solution - using half (specifically, half4 and half2) instead of float for storing my vertex data. My vertex struct is given below: …
RaZeR RawByte
  • 238
  • 1
  • 10
4
votes
1 answer

Binding a second vertex buffer seems to spoil my first vertex buffer, OpenGL OES ios 5.1

I'm creating two different vertex buffers, that use two different shaders to render them. As soon as I bind the second vertex buffer, the data I parked in the first vertex buffer seems to be corrupted or lost. If I generate and draw one vertex…
bobobobo
  • 64,917
  • 62
  • 258
  • 363
3
votes
2 answers

Drawing with Vertex Buffer Objects in OpenGL ES 1.1 not working

I have my OpenGL code working but I am trying to improve its performance a bit (would like to bump up the frame-rate a bit on older devices). I am trying to do this using a Vertex Buffer Object. All my code does is draw a series of 360 GL_TRIANGLES…
Ross Kimes
  • 1,234
  • 1
  • 12
  • 34
3
votes
1 answer

Can I glDeleteBuffer a VBO and IBO after binding to a VAO?

I've read that a VBO (Vertex Buffer Object) essentially keeps a reference count, so that if the VBO's name is given to glDeleteBuffers(), it isn't truly dismissed if a living VAO (Vertex Array Object) still references it. This behavior is similar…
Anne Quinn
  • 12,609
  • 8
  • 54
  • 101
3
votes
2 answers

How do I fix the following gcc warnings?

I've started learning OpenGL and managed to create a spinning cube using vertex buffer objects. However, when I compile my code, gcc issues the following warnings: || sdlogl.c: In function ‘initGL’: sdlogl.c|48| warning: implicit declaration of…
Alexandros
  • 3,044
  • 1
  • 23
  • 37
3
votes
1 answer

Most generally correct way of updating a vertex buffer in Vulkan

Assume a vertex buffer in device memory and a staging buffer that's host coherent and visible. Also assume a desktop system with a discrete GPU (so separate memories). And lastly, assume correct inter-frame synchronization. I see two general…
Blindy
  • 65,249
  • 10
  • 91
  • 131
3
votes
1 answer

Memory management for vertex buffer data

Assume that I need to render static picture (100 stars). I generate star data (position, color, size) to std::vector stars; Then I create a class for D3D rendering, which consist a buffer: CGalaxyMapRenderer { … CComPtr
ToughDev
  • 117
  • 1
  • 5
3
votes
1 answer

Passing VBO to shaders with different layouts

If I have a vertex shader that expects this... layout(location = 0) in vec3 aPos; layout(location = 1) in vec4 aBoneWeights; layout(location = 2) in vec4 aBoneIndices; How do I pass a a VBO that is already organised for each vertex…
tobaroony
  • 35
  • 3
3
votes
2 answers

Question regarding the memory alignment offset multiple for Vertex buffer data when calling vkCmdBindVertexBuffers()

I'm creating a Vulkan based renderer backend for my game framework. At the moment I'm loading in a mesh with around 10,000 unique triangles (not indexed - all individual) where each vertex has a position value, RGB value, no normals and no texture…
user11019761
3
votes
2 answers

Code Assist, OpenGL VAO/VBO Classes not drawing

Edit II: Current Code works great! Thanks everyone. I went ahead and included my shader code for reference at the bottom though they do absolutely nothing at this point really. I am trying to get up and going with OpenGL 4.1 and am still very…
3
votes
1 answer

How Might I organize vertex data in WebGL for a frame-by-frame (very specific) animated program?

I have been working on an animated graphics project with very specific requirements, and after quite a bit of searching and test coding, I have figured that I could take several approaches, but the Khronos and MDN documentation I have been reading…
synchronizer
  • 1,955
  • 1
  • 14
  • 37
3
votes
1 answer

OpenGL: Do I still need an array of vertices after buffering to VBO?

Let's say that I have an array of vertices and a VBO pointer: std::vector vertices; GLuint vbo; glBindBuffer(GL_ARRAY_BUFFER, vbo); Now I buffer the data: glBufferData( GL_ARRAY_BUFFER, vertices.size()*sizeof(Vertex), …
freakish
  • 54,167
  • 9
  • 132
  • 169