Friday, January 18, 2013

Soft Shadows and Glossy Specular Reflection

It has been a while since I posted my last update. I have made some major changes since then. I am still working on optimizations of the ray traversal algorithms and data structures. I have implemented soft shadows and glossy specular reflection by using a technique that loosely follows what Cyril Crassin pioneered and what Epic's Unreal Engine 4 is using for dynamic lighting (Sparse Voxel Octree Cone Tracing). 

Models courtesy of Dmitriy Parkin (Imrod), Happy Buddha and Dragon (Stanford 3D Scanning Repository)
Thanks to Jon Olick for optimization tips.

800x600 @ 25-60 fps (2x GTX 680)

Surprisingly, the performance on an Nvidia Geforce GTX 580 is not much slower than a single GTX 680. I suppose there are some ways I could better take advantage of the Kepler architecture of the 680 over the 580's Fermi.

Friday, November 16, 2012

Better Scene Management

Improved scene bounding volume hierarchy. This scene contains 2,500 instanced Imrod Models.

480x360 @ 25-30 fps

There is still much I want to do in the way of optimizations. My goal is still at least 30 fps at a resolution of 1280x720 (720p).

Once I get closer to this goal, I will be implementing soft shadows, depth of field, and glossy reflection capabilities. The soft shadows will actually make it faster as secondary rays will not be traversing as deeply into the octrees, and the sampling will be interpolated for smoothness. The same goes for depth of field and glossy reflections. Hopefully I will also benefit from utilizing texture memory rather than global memory for the voxel data.

My next blog entry will hopefully show models with color rather than being textured white.

Imrod Model by Dmitry Parkin

Thursday, August 30, 2012

Instance Test

Just a quick test of the instancing capabilities. In this test there are 1,323 Imrod Models SVODepth(11). Only one copy of the octree resides in GPU memory taking 75 MB; the rest are instanced but have there own lighting.

480x400 ~ 4-25 fps  -  (~2.2 billion) Visible Voxels
2x GTX 680

It runs slow as I have yet to optimize the scene octree and there are a few other bottlenecks I am working on.

Here is a 1280x720 render at 20+ fps of a single model:

Tuesday, August 21, 2012

Instancing and Shadows

800x600 ~30 fps - SVODepth(11/8) ~ 50 Million visible voxels
2x GTX 680

This is a low resolution render of a scene that utilizes instancing of only two octree models. I am now in the process of developing an octree based scene graph data structure. This scene graph octree will reduce overall overdraw and speed up rendering substantially.

Wednesday, August 8, 2012

Better Shading

Fixed the shading and added spherical environment mapped specular reflections.

800x600 ~50 fps - SVODepth(11) ~ 2 Million visible voxels
1x GTX 680

My next goal is to implement some sort of contour mapping per voxel, so that even at a lower subdivision level it will still look as detailed as this example.

Friday, July 20, 2012

Rendering Imrod

I was compelled to try and render the Imrod model that Jon Olick (worked for ID Software at one point) rendered with voxels. Below is a video of Jon's render, and below that is mine. Jon's is better...

800x600 ~60 fps - SVODepth(10) ~ 2 Million visible voxels
1x GTX 680

I have been optimizing all that I can without the ability to even debug my parallel code, as the Nvidia Cuda Development site has been down from a malicious attack for the past week. I have been in dire need of the Nvidia Parallel Nsight 2.2 debugging app.

I plan to implement voxel contours so that the voxels no longer have the cubical shape when viewed up close, but rather have a smoother surface that better represents the high poly source model.

Disclaimer: This model is the intellectual property of Dmitry Parkin -

Wednesday, July 11, 2012

Optimization Underway

I have been slaving away at this thing for a while now in an effort to optimize the heck out of it. I am making some progress.

640x480 - ~50 fps - SVO Depth(9)
1x GTX 580

OBJ polygon count: 6,615,041
SVO voxel count: 1,484,810 (22% the detail of OBJ)
OBJ file size: ~500 MB
SVO file size: ~88 MB (17% the size of OBJ) 
5% relative size difference over OBJ

My goal is to get the SVO files compressed down much further. Due to the hierarchical nature of sparse voxel octrees, much of the data I am currently saving to the file can actually be rebuilt at load time. I believe I can cut out at least 16 MB of data from the above example.