TheOpenSpaceProgram / new-ospgl

A space exploration game in OpenGL. Devblog: https://tatjam.github.io/index.html
MIT License
42 stars 6 forks source link

Use uniform blocks in most shaders #51

Open tatjam opened 1 year ago

tatjam commented 1 year ago

Instead of setting all the transform matrices (which are quite a few in our "double" world) every frame, we can create a uniform block and set that instead.

This should offer a performance improvement (albeit possibly minor) as instead of (5 * object) uniform sets, we would have a single call at the start of the frame. Implementation details here: https://learnopengl.com/Advanced-OpenGL/Advanced-GLSL