Sfera: a game with real-time path tracing rendering back

Board: Home Board index Raytracing Visuals, Tools, Demos & Sources

(L) [2011/12/12] [ost by Dade] [Sfera: a game with real-time path tracing rendering] Wayback!

I have spent the last weeks on my idea of a little game with real-time path tracing named Sfera. It is mostly written with OpenCL and uses Bullet Physics as physic engine. The source code and some pre-compiled binary is available at [LINK http://code.google.com/p/sfera]

A demo video is available at [LINK http://www.youtube.com/watch?v=Dh9uWYaiP3s] and should explain how Sfera works.
sfera.jpg
Sfera includes few un-conventional technical choose like a BVH with sphere bounding box (to reduce GPU threads divergence), brute force path tracing (i.e. no direct light sampling), the capability to store many data on constant GPU memory, etc. As result it can achieve some impressive number in term of raw samples/sec (i.e. over 1 Giga-samples/sec).
(L) [2011/12/12] [ost by toxie] [Sfera: a game with real-time path tracing rendering] Wayback!

Very cool, also some nice materials on some planets there.. Was this inspired by Super Mario Galaxy? [SMILEY :)]
(L) [2011/12/12] [ost by Dade] [Sfera: a game with real-time path tracing rendering] Wayback!

>> toxie wrote:Very cool, also some nice materials on some planets there.. Was this inspired by Super Mario Galaxy?
Just a little  [SMILEY ;)]
(L) [2011/12/12] [ost by straaljager] [Sfera: a game with real-time path tracing rendering] Wayback!

Very impressive Dade  [SMILEY :D]

It's amazing to see those bumpmapped specular and diffuse surfaces converge so damn fast.

Do you reuse samples from previous frames as there seems to be some motion blur? Any plans on implementing other primitives besides spheres (axis aligned boxes for example)?
(L) [2011/12/13] [ost by Dade] [Sfera: a game with real-time path tracing rendering] Wayback!

>> straaljager wrote:
It's amazing to see those bumpmapped specular and diffuse surfaces converge so damn fast.

Do you reuse samples from previous frames as there seems to be some motion blur?

Yes, this is how the image pipeline works:

1) sample the image via brute force path tracing ([LINK http://code.google.com/p/sfera/source/browse/src/renderer/ocl/kernels/kernel_core.cl#832] kernel) and average multiple sample over the same pixel (the number of sample per pixel is controlled by this parameter ([LINK http://code.google.com/p/sfera/wiki/ConfigurationFile#Number_of_pass_per_frame]);

2) filter the image by applying a box filter 3 times in order to emulate a Gaussian filter ([LINK http://code.google.com/p/sfera/source/browse/src/renderer/ocl/kernels/kernel_core.cl#1171] and [LINK http://code.google.com/p/sfera/source/browse/src/renderer/ocl/kernels/kernel_core.cl#1189] kernels). This behavior can be controlled by render.filter properties ([LINK http://code.google.com/p/sfera/wiki/ConfigurationFile#Image_filter]);

3) I use an accumulation-like buffer to blend the new frame over the last one. It is just a linear combination where the amount of blending is controlled by how much the camera was moving. This behavior can be controlled via few properties too ([LINK http://code.google.com/p/sfera/wiki/ConfigurationFile#Frame_blending_%28alias_ghost_effect%29]).

The step #3 is really simply to implement (and run fast) but produce a quite good result. You can play with configuration parameters (i.e. disable image filtering, using a very small frame blending, etc.) to have the feeling of how much post processing seems even more important, for instance, than just doubling the number of samples per pixel in order to reduce the perceived noise.
 >> straaljager wrote:Any plans on implementing other primitives besides spheres (axis aligned boxes for example)?
At least inside Sfera, I would like to remain sphere-only (a bit like Minecraft is cube-only) but I would like to be able to handle very high number of spheres. Sfera uses a BVH built from zero each frame, it is a bit  rude at the moment (even if still fast given the small number of primitives it has to handle).
(L) [2011/12/13] [ost by straaljager] [Sfera: a game with real-time path tracing rendering] Wayback!

>> Dade wrote:At least inside Sfera, I would like to remain sphere-only (a bit like Minecraft is cube-only) but I would like to be able to handle very high number of spheres.
FYI, there is a raytraced game (running on CUDA), called AntiPlanet, that is also built around a world made of spheres and uses a BVH to handle very high numbers of spheres. There is some info about the engine at [LINK http://www.virtualray.ru/eng/engine.html] and a video at [LINK http://www.youtube.com/watch?v=1eqWtzC0Jbo]. The SDK is available as well.

After seeing Sfera, I think that a real-time path traced version of AntiPlanet with HDR skydome lighting is entirely feasible and could be very awesome.

back