Showing posts with label Geometry Shader. Show all posts
Showing posts with label Geometry Shader. Show all posts

Tuesday, 11 March 2014

Honours Project Update - DirectX

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.

Figure 3 - Current Max number of cubes (11 Million)


Anyways check out the video below to see a slightly older version of the application with consistently updating heightmaps.



Email: markmmiller@hotmail.co.uk
Xbox Live: Dr Death MK 2
Steam: 7thsanctum

Origin: 7thsanctum
Youtube: 7thsanctum
Github: 7thsanctum

Wednesday, 10 April 2013

DirectX - Geometry Shader (Lot's of cubes and particles!)

Just posting a quick update for my geometry shader experiments. I managed to increase the particle count by a crazy amount to just above 450,000 ! The first program I made to do this created just plain old particles, billboarded towards the camera and with basic blending.
Be sure to click to view in HD
This was pretty cool and I easily managed to get above the 450,000 target. At this amount the system runs smoothly and gets a nice steady 52 FPS. This is at fullscreen 1920*1080 resolution.
Look at those pretty particles!
 After this I played about with multiple emitters and pumping up the emission rate but none of these gave me any satisfaction. Then I remembered  the geometry shader isn't just for particles, I could create any geometry from a single point, so what about cubes? I then did some jiggery pokery inside the shader, spent far too long working out how to create a cube using a triangle strip and voila, the cube demo was born.
Over 450,000 of the finest cubes known to man
Now for this system you would think it would run 6 times slower due to the extra faces, dropping from 52 to about 9 fps. You'd be wrong though, with this system the application still manages an impressive 28 FPS at fullscreen 1920*1080, this is all without any form of instancing, culling or other optimization techniques.
For a bunch of cubes they sure are colourful
Although this program isn't a significant achievement in the realms of computer technology it goes to demonstrate the significant power of the Geometry Shader as well as the GPU. This level of geometry would simply not be possible on the CPU in real time. Anyways, check out some realtime videos of this stuff below, be sure to watch in full HD for the best quality!  Due to the way youtube compresses videos down I had to alter the brightness which is why there is a colour difference with the screenshots above. I really should modify this in shader but that would be sensible.
Also check out some random cool patterns I made below.


Email : markmmiller@hotmail.co.uk
Xbox Live : Dr Death MK 2
Steam : 7thsanctum