Bit of a technical post today.
I’ve spent the last few days making some much needed optimizations to Lay of the Land. I have drastically improved the games overall FPS and reduced traversal stutter.
Previously the game was CPU bottlenecked on the render thread due to huge numbers of draw calls. This resulted in poor GPU utilization. This was particularly apparent when facing away from the sun/moon during sunset/sunrise as this scenario results in the most shadow pass draw calls (over 15000 in some areas on max settings).
In my voxel engine the world is divided into 32x32x32 voxel meshes that vary in size depending on LOD. I have made a system that merges nearby voxel meshes of the same LOD into larger “chunks”. This saves a huge number of draw calls resulting in much better render thread performance and GPU utilization. Now this optimisation does cost a bit of ram/vram as the nearby meshes are basically stored twice.
I can't discard the non merged meshes as I need to hide/show the merged and non merged meshes when their part of the world is edited for quick updating. I am also still using the non merged meshes in the lumen scene, for collision and for nav mesh gen. The merged meshes are basically just for rendering in the base and shadow passes.
All in all the game is now almost never render thread bound, GPU usage is almost always near 100% and the number of draw calls in the worst scenarios is down to around 4000. This results in a worst case fps boost at max settings on a 4070 at 2560x1080 from around 30-40 fps to now around 70-80 fps. That's an increase of 100-130%.
I have also reduced CPU bottlenecks on the game thread. This is where most of the games stutters were occurring which would happen during traversal. The stutters were caused by a combination of me not streaming some assets correctly and not being smart about how I was creating/using voxel mesh rendering components, among other things.
Anyway the game now runs much smoother and feels so much better to play. I’m really happy with how the performance is turning out and I still have more optimisations in mind. Also as a bonus max render distance is now also actually playable now on high end systems.
Cranium Baby
2024-08-20 16:37:46 +0000 UTCTooley1998
2024-08-18 23:02:18 +0000 UTCxbox360_minecraft
2024-08-17 00:44:33 +0000 UTCmrwoofwoof
2024-08-16 15:40:24 +0000 UTCDoge
2024-08-16 10:45:23 +0000 UTCRetlaw
2024-08-16 07:55:34 +0000 UTC