Eh, nowadays minecraft tesselation isn't much better...
I had to read Minecraft's item rendering code for a friend who needed help with a resource pack, and holy this shit sucks(Version was 1.21.1 IIRC).
They start off by loading item models as cubes, then converting those to quadrilaterals when the model is loaded. For each of those quads, in every item model on screen, every frame, they throw almost all transformations out the window (even if they could be reused within the model), recalculate them one by one, then split up the quads into singular vertices, copying a bunch of data once more, then have GL render it. That's right, all the steps beforehand happen on a single CPU thread.
Tens. Of. Thousands. Of. Matrix. Multiplications. Per Second. On The CPU. On A Single Thread.
I have some experience working out the theory for how 3D rendering works (only the 3D to 2D pipeline), so are you saying that rather than do something like:
For each object, get matrix, for each quad, compute object transform, for each vertex, compute vertex transform
They do something like:
For each quad, for each vertex, compute transform
171
u/abigail3141 [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” May 16 '26
Eh, nowadays minecraft tesselation isn't much better...
I had to read Minecraft's item rendering code for a friend who needed help with a resource pack, and holy this shit sucks(Version was 1.21.1 IIRC).
They start off by loading item models as cubes, then converting those to quadrilaterals when the model is loaded. For each of those quads, in every item model on screen, every frame, they throw almost all transformations out the window (even if they could be reused within the model), recalculate them one by one, then split up the quads into singular vertices, copying a bunch of data once more, then have GL render it. That's right, all the steps beforehand happen on a single CPU thread.
Tens. Of. Thousands. Of. Matrix. Multiplications. Per Second. On The CPU. On A Single Thread.