Support for Vertex/Index Buffers
by
, 23-05-2022 at 08:08 AM (89752 Views)
Added support for vertex/index buffers to the engine. Yes, yes, until now there were no GL buffers support in the engine - the geometry was always drawn directly from memory. This may seem strange, because everywhere they write that it is absolutely necessary to use OpenGL buffers for performance reasons. But in practice, everything worked quite fine without buffers - even on mobile devices.
To check this out I wrote a small demo that draws a million triangles in a frame. On an old GTX 550ti in FullHD resolution, I got 319 FPS with buffers, and 268 FPS without. That is, the use of buffers, even in a scene where they are most useful, increased FPS by only 19%. On the one hand, the difference is evident, on the other hand, it's not really crucial. Of course, in other scenes with a different payload and bottlenecks, the effect will be even lower.
What's more interesting: I found that in 64 bit mode FPS is significantly higher than in 32 bit mode. Seems there are some overheads with data transfer from a 32-bit app to the 64-bit driver.
Source code: https://github.com/Cooler2/ApusGameE...o/VertexBuffer