avarisc":2i2hkn0w said:
I want to apply something like this to voxel world data.
The problem to solve with that is having to jump over a file format to figure out where in world-space you need to load. I can imagine it being a pain to figure out.
I've noticed that OpenGL storage formats do not always have an associated load format; GL_RGBA2, for example, cannot be loaded but may be stored.
Ended up having to change the palette loading system I wrote so it would expand to the best-fitting storage. Means some quality is gained, but memory consumption during load is increased.
Also implemented texture matrices as a default shader uniform;
Motivation behind that was the fact that in previous projects a lot of texture mapping manipulation was done (sheering and scaling). In the past I didn't implement texture matrices, even when I should probably have used them.
One case in mind is the UDMF map format where the walls could have tiling textures. I used to do this via UV co-ords, which ended up with lots of geometry being generated for 1 map. Now with texture matrices, the walls can all use the same generic quad-plane and the scaling/sheering is done as a uniform matrix (which is uploaded before and drawing even begins, I am using near-zero driver overheard methods).
You can imagine a map with 200 walls; if all the walls were mapped and sized differently my previous renderers would generate 200 different geometries on the GPU, now only 1 geometry is stored and is bound only once and every single wall can be drawn in a single draw call.
Another thing I've been working on is bindless textures. Switching what textures you are using is expensive in OpenGL, the texture units are there mostly to make it so you can reduce switching (32 different textures can take a unit, each draw will select the unit where its texture lives).
Now what happens is the GPU will report a uint64 handle (which is usually a pointer in GPU memory) and that is used as the handle, no texture units or texture binding is used at all. A very big optimisation for devices that need it.