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
0
votes
1 answer

gldrawelements bad access in xcode when used outside of GLKViewController

I'm pretty new to OpenGL ES, but all I'm trying to do is draw indexed vertices using glDrawElements in a Character class. I've gotten this to work before inside of my GLKViewController class, but when I tried creating a Character class which would…
michaelsnowden
  • 6,031
  • 2
  • 38
  • 83
0
votes
1 answer

Vertex Arrays GLFW crashes c++ program

I am following one of the tutorials from the internet on glfw to make a simple 2D game. My program is stuck at a point where I have to create a vertex array to store my quad vertices and draw them on the screen. But my program crashes at line where…
Htlcs
  • 545
  • 3
  • 13
  • 26
0
votes
1 answer

How to store a VBO in a custom object

I would like to store the vertex, normal, and texture information for my Cat objects within each instance in the form of a Vertex Buffer Object, but I don't know how. I want something like this: @property(nonatomic, assign) int *indices; // vertex…
michaelsnowden
  • 6,031
  • 2
  • 38
  • 83
0
votes
1 answer

Why am I not seeing my instanced blue boxes drawn in XNA?

What's wrong with my instancing below? I'm trying to draw multiple instances of a single box with vertex colors. The examples I adapted this code from used textures and a shader rather than vertex colors. So I suspect that I'm going wrong with…
John Yost
  • 693
  • 5
  • 20
0
votes
1 answer

Best way to convert OpenGL immediate mode rendering utility methods to using VBOs?

I've written for myself a small utility class containing useful methods for rendering lines, quads, cubes, etc. quickly and easily in OpenGL. Up until now, I've been using almost entirely immediate mode, so I could focus on learning other aspects…
0
votes
2 answers

DirectX 9 Vertex Buffer crashes program when using D3DUSAGE_DYNAMIC flag

I have the following code: DirectX::device->CreateVertexBuffer(sizeof(VERTEX) * vertexCount, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, VERTEXFORMAT, D3DPOOL_MANAGED, &vertexBuffer, NULL); VOID* vertexLocking; vertexBuffer->Lock(0, 0,…
Danny
  • 9,199
  • 16
  • 53
  • 75
0
votes
1 answer

Prepare vertex data for dashed circle

Actually I have in my project function which generate vertex data for drawing ring with specified minimum radius and maximum radius. In edge case (minimum radius equal 0) it is circle with solid fill. To draw my data I'm using GL_TRIANGLE_STRIP. Now…
Gie
  • 1,907
  • 2
  • 24
  • 49
0
votes
1 answer

Vertex Array for VBO -OpenGL

I have an array which contains coordinates. It looks like: glm::vec3* Vertices; How can I pass its elements to glVertexAttribPointer. Is the only way just one dimensional array? For example; can I use something like that: float*…
user3117189
  • 69
  • 3
  • 9
0
votes
2 answers

Directx 10: Updating Vertex Buffer With CopySubresourceRegion

I have a vertex buffer created as follows: ID3D10Buffer * VertexBuffer; Vertex_PosCol * Vertices; D3D10_SUBRESOURCE_DATA VertexData; Vertices = new Vertex_PosCol[VerticeCount]; Vertices[0].Position = D3DXVECTOR3(0.0f, 0.0f, 0.0f); …
MJLaukala
  • 171
  • 1
  • 3
  • 13
0
votes
1 answer

Best practice for simple DirectX overlay rendering

I'm creating a DirectX 11 game that renders complex meshes in 3D space. I'm using vertex/index buffers/shaders and this all works fine. However I now want to perform some basic 'overlay' rendering - more specifically, I want to render wireframe…
RobJ
  • 25
  • 3
0
votes
0 answers

JOGL - updating vertex coordinates - glMapBuffer always returns null

I want to change vertex positions when key pressed. I use glMapBuffer to get buffer, but it always returns null. This is the code: Creating vertex buffer: FloatBuffer verticesBuffer = FloatBuffer.allocate(vertices.length * 8); for (int i =…
0
votes
1 answer

OpenGL ES Polygon with Normals rendering (Note the 'ES!')

Ok... imagine I have a relatively simple solid that has six distinct normals but actually has close to 48 faces (8 faces per direction) and there are a LOT of shared vertices between faces. What's the most efficient way to render that in OpenGL? I…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
0
votes
1 answer

Passing a Vertex Array of any number of values to GLSL Vertex Shader

I need a way to pass an array to the Vertex Shader that contains multiple values for each vertex. I have this: One array of 3d points One array of 3d normals for each point One array of faces (all triangles) One array of ALL the neighborhood…
fern17
  • 467
  • 6
  • 20
0
votes
1 answer

opengl VBO rendering doesn't work properly

At the beginning of my code I have initialized the vbo: GLuint VBO; then my vertex and color array: GL float vertandcol[]={x1,y1, z1, r1,g1,b1, ...........,x3, y3, z3, r3,g3,b3}; Now I create and bind the vbo and allocate the…
0
votes
0 answers

How can I draw SDL_Texture (SDL 2) using vertex buffer (OpenGL 4+)?

I've tried to find some code, but found only obsolete. I've made only verts & indices arrays (hope they are correct): const SDL_Point blocksCount = { 4, 16 }; //I have texture with 4x16 squares 8x8 px. f32 *verts = new f32[(blocksCount.x + 1) *…
Necronomicron
  • 1,150
  • 4
  • 24
  • 47