OpenGL: buffer performance issue

I have a question related to the performance of a Buffer object. I rendered the grid using standard Vertex arrays (non-interlaced), and I wanted to change it to a Buffer Object to get some performance boost. When I present the buffer object, I was shocked when I found out that using the Buffers object reduces performance four times. I think buffers should improve performance. It's true? So, I think I'm doing something wrong ...

I displayed a 3d map and reduced the amount of memory needed. I use only one slab (vertex set) to render the entire map. I only change the texture coordinates and the y value at the vertex position for each tile of the map. Buffers for position and texture coordinates are created using the GL_DYNAMIC_DRAW parameter. The index buffer is created using GL_STATIC_DRAW because it does not change during map display. Thus, for each tile, map buffers are displayed and not displayed at least once. Should I use only one buffer for texture coordinates and positions?

Thank,

+3
source share
2 answers

/ GL_MODELVIEW/GL_TEXTURE ( GL_STATIC_DRAW). 1x1, rect (0, 0) - (1, 1) glTranslate. .

VBOs , . . opengl, .

+2

, GL_STREAM_DRAW ( , ), GL_DYNAMIC_DRAW ( , ). , , GL_STREAM_DRAW, ol, , .

, glMapBuffer , GL_WRITE_ONLY, , . , , , (, ...) . , .

+2

Source: https://habr.com/ru/post/1753481/


All Articles