OpenCL Voxel Splatting Demo
Here is a voxel splatting demo based on OpenCL + OpengL. Splatting is the technique that allows to merge all voxels on screen to create a smooth surface. The voxels are rendered as single points and the gap between points is filled by an OpenCL post processing filter.
Since there are still lots of rumors around about unlimited detail, I wanted to give point based rendering at try and see how well it works in OpenCL.
It turned out that the performance is much better than basic point rendering in OpenGL. While OpenGL allowed me to render around 630M pts / sec, OpenCL reached 3-4 times the speed with ~2 Billion points per second on a GTX580M GPU.
Just rendering points does not lead to a smooth surface however. For that, a post-processing filter is required. It increases the size of the points and fills the holes. I have implemented a very simple one, to show that it works. As for the culling, only frustum culling is implemented. More advanced hierarchic occlusion culling might give extra frames especially in indoor scenes. Also a hierarchic depth buffer is not been used – it might further give additional performance when adapted to point based rendering.
Main challenge for the implementation was to find a data structure that allows parallel access by stil keeping the size per voxel reasonable. Rendering the points works pretty much straight forward.
In the image, you can see the render stages:
Right : Z buffer
Middle : Colored Points
Left : Including post processing
Render Resolution: 1024×768
Framerate: 30-40 fps
Scene Dimension: 20k x 1k x 20k voxels
Dataset : 1024x1024x1024 Voxels (single instance)
Data size per voxel: 4 bytes / voxel at each LOD, total ~5 bytes, seen over all LODs
On the author’s notebook with a GTX 580M, the demo runs at around 40 FPS for 2 billion of points/second. I tested the demo with default settings (1024×768) on my GTX 680 (R306.02) and I get around 80FPS (4 billion points/sec?):
You can download the demo from this page.
[ Subscribe to Geeks3D latest news by email ]