DuskEngine Devlog 9 - Terrain & Rendering Improvements Edition
Look at this cool new screenshot
The pine trees in the distance, hill, and skybox stars are all new additions. Now to get to the more technical details...
New terrain things
There's a new brush in the terrain editing toolbox, it's used for smoothing the verts underneath.
Here's a video.
It's based on my interpretation of the transfer of heat, except instead of heat there's height.
The terrain rendering has also been optimized by having shaders infer vertex attributes (such as position) based on the index of the current vertex and info about the heightmap itself (its size for example). This all used to be part of the vertex buffer, now the only thing in there is the normal and height of each vertex.
This also made a bunch of work when baking the terrain obsolete, so the terrain assets lost some 30% of their weight on disk as well.
More (OpenGL) rendering improvements
The chunky terrain VBO wasn't the only quirk the renderer accumulated over these past four years. Another was the unnecessary creation and use of VAOs, for example there were separate VAOs for the various types of quads used when rendering (post processing, in-world (like for particles or 3D sprites), GUI), and each skeletal animation mesh also landed in its own VAO-VBO pair.
To minimize the number of VAO switches per frame, quad VAOs have been eliminated and replaced with the equivalent data embedded in vertex shaders (the post processing quad became a fullscreen triangle though), and skele-ani meshes are now crammed into a single VAO/VBO, the same as regular meshes. This will also make it much easier to implement LOD for skele-anis, later.
More navgrid work and improvements
The navgrid building and debug rendering has been improved, removing many annoyances I had when trying to get shapes to carve it properly.
The foundation for a layer system has also been set. In the future I will make it so navgrids can be stacked in layers, in order to support things like the multiple floors of a building, or walking on rooftops and such.
That's it
Rather short but in the past month I also worked on a new game project made with Godot and made a tiny turn based strategy prototype in Unreal 5 to get to know how the engine works, so it wasn't all DuskEngine. I will post more about these projects in the future.
See you next time!