Skip to main content
27 votes

Difference in glDrawArrays and glDrawElements

Each glDraw* is a draw call. 1 glDrawArrays is 1 draw call. 1 glDrawElements is 1 draw call. It doesn't matter (so far as draw call count is concerned) how many vertices or indices you use, 1 glDraw*...
Maximus Minimus's user avatar
5 votes

GL_INVALID_OPERATION on glBindVertexArray Despite glGenVertexArrays()

There is another way this can happen (I just ran into this one myself); VAOs are like FBOs; they aren't shared between shared OpenGL contexts. That if, if you call glGenVertexArrays() from one ...
Trevor Powell's user avatar
2 votes
Accepted

Combining varying vertex variable and vertex variable in OpenGL. How to?

Yes, you do need to duplicate vertices. Oftentimes this is required by normals. Another often reason - UV maps, Surfaces. I come to think of vertices not as points in 3D space, but as "unique set of ...
Kromster's user avatar
  • 10.7k
2 votes
Accepted

What is a efficient way for adding and removing vertices and indices in C++?

One thing you can do is defer the deletion of vertices. Replace a "removed" vertex's data with NAN values, but leave it where it is, and record its index in a separate small collection of &...
DMGregory's user avatar
  • 135k
1 vote

Cannot Draw a triangle without VAO on MacOS

Above a certain GL version Macs only support OpenGL core profiles, which require VAOs. This is perfectly legal, but it does mean that code written for other platforms, where compatibility profiles are ...
Maximus Minimus's user avatar
1 vote

How can I efficiently store Vertex data in C#/XNA?

I know this is an old post but I will send my reply for others to see. What you can do is possibly save ALL the chunks in their OWN chunk files on your computer. Have like two float/into variables <...
user10773870's user avatar
1 vote
Accepted

What to do with unused vertices?

Just don't draw them. For example, if you have 3 quads in a buffer, and you only wish to draw quads 0 and 2: ...
Maximus Minimus's user avatar
1 vote

Difference in glDrawArrays and glDrawElements

When you use glDrawArrays you have to choose an indexing pattern, one of GL_TRIANGLES, ...
Chris E's user avatar
  • 11
1 vote

Streaming to VAO VertexBuffer using OpenGL Direct State Access for Instancing

Your question has nothing to do with direct state access. Your problems would still happen if you weren't using DSA functions. ...
Nicol Bolas's user avatar
  • 26.1k
1 vote

Heightmap vertex list to vertex + index list

Creating the vertices is quite easy. You already have the x and z component, the y component is the height in your heightmap with the given position. You probably want to scale this somehow as heights ...
Tristan Kreuziger's user avatar
1 vote
Accepted

In game engine, how to get the vertices buffers of different vertex formats for render from the mesh file properly?

If you have lots of different input formats then #2 would probably make more sense, however you might end up with a lot of overhead (however I think more modern systems like UE4 do something like this)...
CobaltHex's user avatar
  • 2,248

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