Thursday, February 16, 2012

Bidirectional path tracing in OptiX


While there are a lot of unidirectional GPU path tracers in the wild, bidirectional path tracers running purely on the GPU are still very uncommon. BDPT helps in speeding up convergence in scenes with lots of indirect lighting, such as the alleys in Sponza and interior scenes and also makes caustics appear much faster than unidirectional path tracers. In late 2010, there was a fantastic demo by Dietger van Antwerpen (former Brigade developer) showing Kelemen-style Metropolis light transport on top of a bidirectional GPU path tracer (see http://raytracey.blogspot.com/2010/12/real-time-metropolis-light-transport-on.html) and this guy seems to have found a way to make it work on the GPU with OptiX: 


 Should be interesting to see further results.

Wednesday, February 15, 2012

Real-time path tracing of complex buildings with Brigade 2 on 2 GTX 580s

I finally got a new system specifically built to do some serious real-time path tracing tests. It contains 1 quad core Core-i7 and 2 GTX 580 GPUs and it just rips through the most complex scenes you throw at it. Brigade 2 doesn't use the CPU for rendering, but it is important for dynamic scenes that require multiple BVH updates/rebuilds, which is currently done on the CPU. 

The Brigade 2 path tracer can really show its muscle on such a powerful system and regularly breaks 250 million rays per second as can be seen in the following video of a real-time path traced building containing 430k triangles (640x480 full render resolution, 8 spp per frame, motion blur with frame averaging): 




Color bleeding from the floor on the overhanging structure:
Orange color bleeding on the disk shaped roof:

The building model is free and can be found on http://www.3dmodelfree.com/3dmodel/list475-1.htm (requires 3D Studio Max). The next logical step is to build a street and eventually an entire city, in which you can leisurely cruise around GTA 4 style. It's perfectly doable, I'll post some screens and vids soon. Photorealistic gaming, it's just around the corner :-)

Tuesday, February 7, 2012

Brigade 2: buildings test 1

A new test with Brigade 2 showing highly detailed architecture (220k triangles):

Video: http://www.youtube.com/watch?v=MvBjBANaXvs



The building is a free model from http://www.designshoot.com/large-architectural-building-3d-model-max.html/. It's supposed to look much more realistic with textures, I'm still learning how to properly texture and assign materials. 

Monday, February 6, 2012

Brigade 2: driving test 1

Another simple test with Brigade 2. I've managed to make the camera follow the vehicle while it's driving, which greatly enhances the immersion. I've also added a ramp to the scene:




4 spp with frame averaging, note the diffuse color bleeding from the floor onto the blocks at the left:

In a next test I will add some spiffy looking and highly detailed architecture to the scene (untextured at first). This image shows color bleeding and the use of diffuse, glossy, perfectly specular and refractive materials, all path traced in real-time:

Videos of this scene will be posted tomorrow. 

Friday, February 3, 2012

Trailer of Brigade powered real-time path traced game "It's about time"!

Today, the Brigade developers released an astonishing trailer for "It's about time", a puzzle game set in an Aztec city which is real-time path traced using the Brigade 2 engine.




Download a higher quality video at  http://igad.nhtv.nl/~bikker/files/About.avi

Some of the features that are showcased in the video:

- dynamic day/night cycles: with this technology, high quality precomputed light maps like the ones used in Mirror's Edge (which by far has the best static lighting in a game) are no longer needed. Pixel-perfect soft or hard shadows and indirect lighting are calculated on-the-fly

real-time path traced diffuse color bleeding: no instant radiosity or derivatives are used, which only affect 

real depth-of-field: no z-buffer based post-process hack, but the real thing computed by stochastically jittering the origins of eye rays to simulate a physical lens 

real raytraced ambient occlusion:  no screen space AO using the depth buffer

- dynamic objects receive the exact same direct and indirect lighting as their environment and their material properties can also affect their surroundings 

- an unlimited number of lights can be used

- reflections/refractions/glossy surfaces don't seem to be used in this video but can be handled effortlessly as shown by the Reflect game (reflective spheres, glass tubes)

Dynamic day/night cycle:

Shadow (blocked sunlight) + ambient occlusion (blocked skylight) under the box:

Long stretched shadows are rendered with pixel-perfect accuracy, which is plainly impossible with today's rasterization based shadowing techniques:


Reddish diffuse color bleeding + true raytraced depth of field:

Pillars with very subtle greenish color bleeding from light bounced of of the ground:


An overview of the game world:


It's evident that real-time path tracing is a feasible option for games with many outdoor environments, even today. With some selective filtering of diffuse indirect lighting, even indoors shouldn't be too problematic when avoiding pathological cases such as a room that is only lit by light coming through a narrow opening. 

The ease of creating a game with this tech is unrivaled: artists don't have to worry about wrong looking or badly aliased shadows, reflections, transparency or any combinations of those. It will look just as expected right out of the box. There would also be no waiting time (for baked lighting) between iterations any longer.

To end this post with a cheesy conclusion: Yes, we are witnessing the future of real-time game graphics today! It's about time really.

I really can't wait to play this game (and mod the hell out of it).

Thursday, February 2, 2012

Separable subsurface scattering

This has nothing to do with ray tracing, but this is a truly amazing video demonstrating a new technique to realistically render human skin:

Vimeo vid: http://vimeo.com/36048029

Original blogpost, including executable demo + source code: http://www.iryoku.com/separable-sss-released

Tuesday, January 31, 2012

VoxLOD: Interactive ray tracing of massive models with indirect lighting using voxels

Just encountered an impressive video of a technology named VoxLOD on Youtube today:


As the name aptly implies, VoxLOD uses a voxel-based LOD scheme to smoothly stream in and visualize the geometry of the massive model. The first part of the video shows direct lighting only (primary and shadow rays), while the second half is much more interesting and demonstrates real-time one bounce diffuse indirect lighting (filtered Monte Carlo GI). From the paper "Interactive ray tracing of large models using voxel hierarchies":
"We cast one shadow ray per primary or diffuse ray, and two random diffuse rays per primary ray. The diffuse rays are used to compute both one bounce of indirect irradiance and environment irradiance, which are processed with a bilateral filter [TM98] to eliminate noise."

"There are two light sources: a point light (the Sun) and a hemispherical one (the sky). I use Monte Carlo integration to compute the GI with one bounce of indirect lighting. Nothing is precomputed (except the massive model data structure of course).

I trace only two GI rays per pixel, and therefore, the resulting image must be heavily filtered in order to eliminate the extreme noise. While all the ray tracing is done on the CPU, the noise filter runs on the GPU and is implemented in CUDA. Since diffuse indirect lighting is quite low frequency, it is adequate to use low LODs for the GI rays."
Another interesting tidbit from the paper:

"By using LOD voxels, significantly higher frame rates can be achieved, with minimal loss of image quality, because ray traversals are less deep, memory accesses are more coherent, and intersections with voxels are free, contrary to triangles (the voxel fills its parent node, therefore, the intersection is equal to the already computed intersection with the node). Furthermore, the LOD framework can also reduce the amount of aliasing artifacts, especially in case of highly tessellated models"

The quality of the indirect lighting looks pretty amazing for just 2 (filtered) random samples per pixel and is completely noise-free, as can be seen in this picture from the paper


All the ray tracing is currently CPU based (the GI algorithm runs at 1-2 fps on a quad core cpu), but it would probably run in real-time at much higher framerates when implemented entirely on the GPU.

Thursday, January 26, 2012

Brigade 2 Blowout!

Jacco Bikker, one of the Brigade developers, posted some updates about the Brigade 2 path tracer:

- there is a new downloadable demo showing off the Blinn shader (Fermi only). I haven't been able to test it yet, but the screenshot looks sweet!

- a brand new video of the Reflect game using Brigade 2 running on 2 GTX 470 GPUs, which demonstrates some dramatic lighting effects and very low noise levels (for a real-time path traced interior scene)

All can be seen and downloaded from here: http://igad.nhtv.nl/~bikker/

There should also be a playable Reflect demo up by tomorrow!

GigaVoxels thesis online

Cyril Crassin has just posted his entire PhD thesis on GigaVoxels, the sparse voxel octree raycasting technology which supports efficient depth-of-field, soft shadows, animated voxel objects and indirect lighting at

http://blog.icare3d.org/2012/01/phd-thesis-gigavoxels.html

There are over 200 pages of voxel raytracing goodies :)


Tuesday, January 24, 2012

Real-time path traced Sponza fly-through on 3 GPUs!

I've sent the executable of the teapot in Sponza scene to a friend, szczyglo74 on Youtube, who has a much more powerful rig than my own (a PC with 3 GPUs: 1 GTX 590 (dual gpu card) + 1 GTX 460)  and who made some very cool real-time videos of the sponza scene. Many thanks szczyglo!

The maximum path depth in each of these videos is 4 (= 3 bounces max):

32 spp per frame (480x360, 1/4th render resolution, 8 fps): 

http://www.youtube.com/watch?v=fVAl-oKAL9I  :awesome video, shows real-time convergence in most parts of the scene

32 spp per frame (640x480, 1/4th render resolution, 4.7 fps): 


8 spp per frame (480x360, 1/4th render resolution, ~21fps): 


4 spp per frame (640x480, 1/4th render resolution, ~18fps):



The above videos clearly show the importance of the number of samples per pixel per frame in indirectly lit areas: despite the low max path depth of 4, it is still possible to discern some details in the corridors in the first two videos (32 spp per frame) during navigation, while the last two videos (8 and 4 spp per frame) are obviously too dark in these regions, but clear up very fast with a stationary camera. Note that these tests were made with a kernel that is not optimized for indirect lighting (no multiple importance sampling is used here). 

I'm quite happy with the sense of photorealism in these videos, especially when you consider that this is just brute force path tracing (no caching, filtering or interpolation yet nor anything like image reconstruction, adaptive sampling, importance sampling, bidirectional pt, eye path reprojection, ... which are all interesting approaches). A textured version of Sponza will probably further increase the realism, which is something I will try in a next test.  

Monday, January 23, 2012

Utah Teapot in Sponza continued

I've managed to get the "teapot in Sponza" scene to render slightly faster by treating all objects in the scene as static.

Youtube videos (rendered on a GeForce GTS 450):



Sunday, January 22, 2012

Optix 2.5 released

A few days ago, Nvidia has released OptiX SDK 2.5 RC1 which stands out compared to prior releases due to a number of major improvements:

- out-of-core GPU ray tracing: scenes can now exceed the amount of available GPU RAM (up to 3 times)

- HLBVH2 support (Garanzha and Pantaleoni): replaces the previous LBVH builder and is able to build the BVH acceleration structure on the GPU at a fraction of the time it would take a CPU, which allows for completely dynamic scenes by rebuilding the acceleration structure each frame in real-time (e.g. the HLBVH2 paper reports building times of 10.5 ms on a GTX480 for a model consisting of 1.76M fully dynamic polygons). HLBVH2 traversal speed is said to be comparable to a CPU built BVH

This will greatly benefit real-time GPU path traced games and animations as it not only reduces the BVH build times by several orders of magnitude compared to CPU builders, but also eliminates costly per-frame CPU-to-GPU transfers of the updated BVH (when built on the cpu)

- the SDK path tracing sample is enhanced with multiple importance sampling

Friday, January 20, 2012

Real-time browser based path tracer

While searching the net for ways to improve convergence in dynamic, path traced environments, I stumbled upon this neat web-based path tracer created by Edward Porten:


It uses progressive spatial caching and runs pretty fast despite being CPU-based.


Also check out some other browser-based demos from the same author at http://www.openprocessing.org/portal/?userID=6535

The Sphere flake tracer uses a cool looking frameless rendering technique, roughly comparable to frame averaging.

"Hair Ball" and  "Terrain Ray Marching"  are awesome as well.

Thursday, January 19, 2012

Brigade 2 Teapot in Sponza test

Testing indirect lighting with motion blur in Brigade 2 with the teapot and the Sponza atrium:

Youtube videos:

http://www.youtube.com/watch?v=QCPCAZlS5QI (8 spp per frame)
Some pics:

This is a particularly nasty scene, since all the light is coming from the skydome through the narrow roof  (no portals or importance sampling are used, max path depth is 4). Nevertheless, it still converges rather quickly on a GTS 450 using the motion blur trick. 

Wednesday, January 18, 2012

Brigade 2 motion blur test continued

I made some side-by-side comparisons from the Utah teapot scene (http://www.youtube.com/watch?v=KxELvSK3Gl0) to show the difference that the motion blur technique makes in areas that are partially lit with indirect lighting. Both sides in the comparison screens use only 4 samples per pixel. The low samplerate is required to achieve playable framerates. Motion blur (frame averaging) is disabled in the left image, while the right image averages the pixels of the current frame with those of the previous 7 frames (equivalent to 32 samples per pixel). The difference in obscured regions is enormous. This is the quality that can be achieved in real-time (+10 fps) using one current high end GPU (GTX 570 or better): 


Edges and shadows become much more clearly defined:


Video (low framerate, rendered at 640x480 on a GTS 450):


It's amazing what such a simple trick can do to the quality of the image, without losing any detail. My next test will involve a 3rd person car camera like the one in  http://www.youtube.com/watch?v=SOic3eE8wrs which should work really well in combination with the motion blur (no sudden sideways movement).

Tuesday, January 17, 2012

New paper about noise reduction for real-time/interactive path tracing

"Practical noise reduction for progressive stochastic ray tracing with perceptual control"

Check it out here: http://www.karsten-schwenk.de/papers/papers_noisered.html

The "supplemental.zip" folder contains some very nice comparison videos.

Brigade 2 motion blurred Utah teapot


Small update on my previous post about motion blur in Brigade 2. I've made a small Bullet physics demo featuring a holy symbol of computer graphics, the Utah teapot:


The video was rendered on a low end GTS 450. The scene is inspired by and meant to be a real-time remake of an animation rendered with GPU path tracing using SmallLuxGPU (last scene in the video). 

Sunday, January 15, 2012

Brigade 2 motion blur test

Today I've added cheap camera motion blur to the Brigade 2 path tracer using the OpenGL accumulation buffer. The technique blends the pixels of one or more previous frames with the current frame and works very well for real-time path traced dynamic scenes, provided the framerate is sufficiently high (10+ fps).  The difference in image quality is huge: path tracing noise is drastically reduced and since all calculations pertaining to the accumulation buffer are hardware accelerated on the GPU, there is zero impact on the rendering performance. Depending on the accumulation value, you essentially get two to ten times the amount of samples per pixel for free at the expense of slight blurring caused by the frame averaging (the blurring is actually not so bad because it adds a nice cinematic effect). 

Below is a comparison image of a stress test of an indoor scene without and with motion blur applied (rendered on 8600M GT). The images were rendered with multiple importance sampling using only 1 sample per pixel to better show the differences (converging is off):


Comparison of the scene with the rotating ogre from a previous demo (see http://raytracey.blogspot.com/2011/12/videos-and-executable-demo-of-brigade-2.html) rendered at 1 sample per pixel (on a 8600M GT), with (right) and without motion blur:


The following image has nothing to do with frame averaging but it is an image from an earlier test of the MIS indoor scene with a highly detailed Alyx character (40k triangles) with a Blinn shader applied. It rendered very fast:

I'll upload some videos of the above tests soon. 

Monday, January 9, 2012

A new real-time sphere path tracer (CUDA and OpenCL)

Real-time path tracing of spheres on the GPU is hot it seems :-)


It looks very impressive and pretty. The path tracer owes its speed to the fact that it is completely running on the GPU and to a custom precomputed hashing algorithm. More info at http://bertolami.com/projectView.php?content=research_content&project=real-time-path-tracer There are also downloadable executables further down the page.

Tokaspt (by tbp), Sfera (by LuxRender's Dade), the WebGL path tracer (by Evan Wallace), ... the list of real-time GPU path tracers featuring dynamic scenes with spheres keeps growing. 

Brigade 2 GI test

Just a small test with a Cornell box scene to test diffuse color bleeding with Brigade 2, rendered on my faithful 8600M GT (the female character is a high poly version of Alyx from Half-Life 2 (character model from here), containing almost 40k triangles and can be moved around the scene in real-time, the spheres are made of triangles):

Some more tests with an area light that show indirect lighting and subtle brownish/greenish color bleeding on the left side of the character:

These scenes use Brigade's multiple importance sampling kernel which drastically reduces the noise in interior scenes compared to the kernel used in previous test scenes (which converged fast because those were open outdoor scenes lit by an HDR skydome).  Brigade's MIS algorithm allows this kind of interior scenes to converge extremely fast as can be seen in this video made by Jacco Bikker. It uses two GTX 470s to render at real-time framerates with 80 spp per frame!