Hey again, it's been a while since I've written about the status of my honours project and I've added a few features over the past few weeks.
I've added in some new data to give more interesting renderings compared with the old solid rainbow block. The main ones are a perlin noise heightmap using libnoise and a simplex noise dataset. Click on the pictures to read the text!
Figure 1 - Heightmap (Perlin Noise) |
In the screenshot below, approx 1.5 million cubes are being drawn at above 40fps consistantly.
Figure 2 - Simplex Noise (192^3) |
I have also added multi-texturing but still need to modify my application to make better use of the type distribution. This allows the engine to currently render different block types with different textures.
Currently, the optimisations I have in place only remove inactive and fully surrounded cubes from being rendered, because of this I get a good performance for fixed datasets that do not change. However to update it or perform naive frustum culling it would slow it down considerably as my checks do this against every cell in the system. My next step is to fix this using the power of octrees! This is why in the gif above the number of cubes being rendered does not decrease as the camera moves. All 1.5 million of these points are being sent to the GPU and drawn into cubes using the geometry shader!
A couple of other minor things I've added to my engine, frustum culling (although I need to combine this with multi-threading and octrees before it becomes effective), back face culling in the geometry shader (which has reduced the number of vertices I need by half), text rendering and extra controls.
Main things I need to work on now are my octree implementation and improvements to my lighting model, I also need to gather more concrete performance data from other engines to find out whether or not I'm managing to improve on anything. However, I'm confident my use of the Geometry shader should provide similar performance benefits, if not greater, to the usage of vertex buffer objects once I manage to get octrees implemented. The geometry shader is a powerful stage and has allowed me to render over 11 million cubes without optimisation. Granted this is at a measly 10fps on a GTX Titan, but it does show that with the correct optimisation in place it can render large datasets well. The task now is filtering the data before it reaches the GPU. The dataset below is a solid 224^3 cube with all cells active and all cells being drawn, no filtering is performed.
Email: markmmiller@hotmail.co.uk
Xbox Live: Dr Death MK 2
Steam: 7thsanctum
Follow @7thsanctum
Origin: 7thsanctum
Youtube: 7thsanctum
Github: 7thsanctum