Загрузка...

SSBO & Bindless Textures | Coding on Java & LWJGL

My engine is almost up to date with the latest API version—OpenGL 4.5! I had to sacrifice some compatibility with older hardware for the sake of cool new features, namely SSBO and Bindless Textures.

The point is, thanks to this, I can now pass a huge amount of data to the shader and eliminate texture bindings. This means I can now render a million triangles with different textures without switching states in a single Draw call! That's basically what the whole thing was all about.

However, the bottleneck then becomes the bus between the CPU and GPU, because dynamically rendering a million triangles requires moving huge amounts of data back and forth every frame. Just one plane requires 28 floats (112 bytes). Instancing rendering could have reduced the data volume, but I specifically wrote a batcher that allows for individual vertex rendering for the sake of flexibility.

Anyway, if you're interested in technical stuff and working with shaders, here you go. There was a part where I was stuck for a long time (it's a classic, after all), but I decided to cut it out so you don't die of boredom.
I also recently wrote a TextureAtlas class. You give it the path to a folder with a bunch of sprites, and it compactly packs them into one large texture, where the regions are accessed by the name of the original image file. This might come in handy someday!

Видео SSBO & Bindless Textures | Coding on Java & LWJGL канала Alexander Bekker
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять