top of page
Search
  • OceanBoundDev

Buffer optimization

I'm about to embark on dynamically combining pre-warped ship parts into singular models for decreased render calls and increased performance. I don't like having to rewrite and refactor important code, so I decided it was best I check which buffer layout renders fastest BEFORE writing my (admittedly pretty straightforward) model combination code.

Imagine being so hellbent on achieving peak graphical performance you literally write four different model classes just to see which one will render fastest. You'd have to be- (water begins cascading down forehead) -like a complete maniac or something. For anyone wondering, the most optimal technique seems to be to store all vertex attributes (position, normal, texture coordinate, tangents, etc.) in one long buffer, and access it via an index buffer and an offset. Conveniently, this is how the PLY model format reads, making it incredibly easy to use .PLY as a standard model format for my game. Less conveniently, PLYs take too long to load and I already decided in the long run it was best to just byte-stream data in and out of the program. Yes, I'm worried about malformed model files crashing the program and am tossing up how much error checking I want to include. I'll fix that later, I hope.

Pictured: Render times for 100,000 draw calls from each format of the example model; two separate linear buffers without indexing, two separate linear buffers with indexing, one mixed data buffer with indexing and offset, and one mixed buffer with no indexing with offset.


0 views0 comments

Recent Posts

See All
bottom of page