Real-time Global Illumination and Ray Tracing

Started by
22 comments, last by fastcall22 13 years, 4 months ago
Hello, guys! After several years learning from this site I'm glad to give my own contribute to the community.

I'm here to present the work I've done for my master which is a rendering engine called Serenity that combines GPU lighting and ray traced lighting in order to approximate global illumination.
The main idea behind this work is that GPUs have become powerful enough to generate diffuse global illumination effects. However, sharp global illumination effects like reflections and refractions are still hard to generate using rasterization based techniques, in this case ray tracing is better suited.
Therefore, the engine combines the best of two worlds by using rasterization to generate direct lighting and indirect diffuse lighting, and ray tracing to generate reflections and refractions.

In particular, the engine generates direct lighting through phong illumination and soft shadow mapping generated with the Percentage-Closer Soft Shadows technique.
The indirect diffuse lighting is simulated by an implementation of the Light Propagation Volumes technique combined with a technique that I developed, called Sky Lighting Irradiance Volume, which simulates sky lighting and Screen Space Ambient Occlusion.
The ray traced reflections and refractions are generated by an hybrid real-time ray tracer that splits the rendering process between the CPU and the GPU to take advantage of their particular computing benefits (i.e. coherent vs inchoerent processing). All the ligthing is processed on the GPU, even for ray traced effects, by using Deferred Rendering to unify all the lighting. What the ray tracer does is generate G-buffers containing information about the reflected/refracted scene that are uploaded to the GPU to be used for lighting.

Check my website www.voltaico.net to learn more about the engine. In the Games & Demos section you can download a demo called "Kindergarten" that I created to show its capabilities.

Here is a
">video of the engine running.

And here are some screenshots:







[Edited by - jcabeleira on December 12, 2010 2:45:00 PM]
Advertisement
This is total WIN.

Is the framerate shown in the video the actual framerate? If so, congrats on making an unbelievable job. If not, congrats on making a believable but still amazing job :).
Thanks. :)

Yes, that is the actual frame rate. Around 20 FPS in average, although it can drop substancialy when ray traced effects occcupy the entire screen. The worst case scenario can drop the frame rate to 6 FPS, but it is rare.
I assume the GI is single bounce, and that the propagation volumes you mentioned are the same ones presented in the Crytek paper?

That being said, DUUUUDE. Great work!
Wow - good, as I'm also doing research into raytracing, hybrid rendering and such, could you please describe how are you doing raytracing and how are you mixing together GPU and CPU rendering?

It seems you're doing something similar to what am I doing (generating GBuffers multiple times, once on GPU for "primary rays" and once on CPU for "reflected rays")... or? Although reecntly I'm working on realtime raytracing library (for my purposes), so I'm right now doing mostly CPU only rendering.

I'm though using radiosity instead of LPVs to achieve GI (although currently I'm considering crazy idea of another kind of GI in realtime).

May I ask about PCSS? How many samples are you using?

And at last what kind of hardware have you used?

EDIT: I didn't managed to run it... using either Linux and WinE 1.3 (I had to try it :D), or WinXP on Radeon 6800, HD 5470 or HD 2900xt. I've got also older 8800GT from NVidia here, though dunno if it is supported.

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

Looks great!
[size="1"]Try GardenMind by Inspirado Games !
All feedback welcome.
[s]
[/s]

[size="1"]Twitter: [twitter]Owen_Inspirado[/twitter]
Facebook: Owen Wiggins

[size="1"]Google+: Owen Wiggins

realy impressiv^^

downloaded the demo but it just crashs :-( (q6600, AMD5770)
Quote:Original post by tombofsoldier
I assume the GI is single bounce, and that the propagation volumes you mentioned are the same ones presented in the Crytek paper?

That being said, DUUUUDE. Great work!


Yes, I use the first version of Crytek's technique so it is single bounce only. The second version of the technique can handle multiple bounces but it tends to be visually unstable.


Quote:Original post by Vilem Otte
Wow - good, as I'm also doing research into raytracing, hybrid rendering and such, could you please describe how are you doing raytracing and how are you mixing together GPU and CPU rendering?


It's hard to explain in a few words, but I'll try. The rays are first created by rendering the reflective/refractive surfaces on the GPU using a shader that calculates the per-pixel reflection and refraction of the view vector. The result is stored on a buffer that represents a reflection and a refraction ray for each pixel.
The buffer is downloaded to system memory where the ray tracer reads the rays of each pixel and performs the traversal and intersection. For each ray that hits the scene, the scene attributes at the intersection point (color, normal, position, etc.) are extracted and stored on one of the two g-buffers according to the ray type (there is one for reflections and another for refractions).
Once they are filled, both the G-buffers are uploaded to video memory to be used for lighting. At this stage, the lighting is computed separately for both reflections and refractions and stored on additional buffers which represent the view of the scene through that particular ray traced effect.
These additional buffers are then added to the final image using any blending effect to simulate the desired reflective/refractive material, usually a fresnel term.
Feel free to read the "Ray Traced Illumination" chapter of my thesis for more details.

Quote:Original post by Vilem Otte
It seems you're doing something similar to what am I doing (generating GBuffers multiple times, once on GPU for "primary rays" and once on CPU for "reflected rays")


Exactly.

Quote:Original post by Vilem Otte
May I ask about PCSS? How many samples are you using?


8 search samples and 32 shadow samples.

Quote:Original post by Vilem Otte
And at last what kind of hardware have you used?


Intel Quad Core 2.66 Ghz and an Nvidia GTX 260.

downloaded the demo but it just crashs :-( (q6600, AMD5770)

Quote:Original post by Danny02
realy impressiv^^

downloaded the demo but it just crashs :-( (q6600, AMD5770)


I'm sorry but the demo only runs on NVIDIA hardware since I do not have an AMD graphics board available for testing.
So basically you're doing the thing almost same way, although...

Quote:The buffer is downloaded to system memory where the ray tracer reads the rays of each pixel and performs the traversal and intersection.

Is not what am I doing, I perform primary raycast on CPU also (but just traversal, intersection and spawn of new ray, no shading or buffer filling involved ... it eats time, lots of it). E.g my ray tracer could be easily extended to perform whole pipeline (e.g. pure ray tracing), although GPU can do much nicer eye-candy shading :P (no computational power on CPU, although dirty SSE and lots of multithreading can make it realtime with shading of course ... like in Arauna ray tracer).

Quote:8 search samples and 32 shadow samples.

Wow, I often use 16 search and 16 shadow samples without getting that nice results ... tbh I never tried using less search than shadow samples ... it's time to give it a try!

And as for raytracing, feel free to come to ompf.org forums and discuss it here, if you wish. I smell some really fast ray tracing here.
btw. and fyi you mention noisy realtime path tracing, path tracing by nature is noisy, and combining many noisy images together one can get smooth (and converging to physically based result ... it is unbiased solution), e.g. even lots of offline path tracers have noisy results ... although Jacco Bikker did some extensive upgrades of his Brigade and it is much less noisy nowadays (see his minecraft path tracing).

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

Processor: Intel i5 750
Graphics: AMD HD5850
Drivers: 8.762.0.0
OS: Windows 7 64-bit

All I get it a white screen and "sereniry.exe has stopped working."

Debugger say:

"Unhandled exception at 0x0130f37c in Serenity.exe: 0xC0000005: Access violation reading location 0x00000010."

This topic is closed to new replies.

Advertisement