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 http://code.google.com/p/sfera
A demo video is available at http://www.youtube.com/watch?v=Dh9uWYaiP3s and should explain how Sfera works.
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).
Sfera: a game with real-time path tracing rendering
Re: Sfera: a game with real-time path tracing rendering
Very cool, also some nice materials on some planets there.. Was this inspired by Super Mario Galaxy? 

Re: Sfera: a game with real-time path tracing rendering
Just a littletoxie wrote:Very cool, also some nice materials on some planets there.. Was this inspired by Super Mario Galaxy?

-
- Posts: 24
- Joined: Thu Dec 01, 2011 9:45 pm
- Location: Switzerland
- Contact:
Re: Sfera: a game with real-time path tracing rendering
Very impressive Dade
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)?

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)?
Re: Sfera: a game with real-time path tracing rendering
Yes, this is how the image pipeline works: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?
1) sample the image via brute force path tracing (http://code.google.com/p/sfera/source/b ... ore.cl#832 kernel) and average multiple sample over the same pixel (the number of sample per pixel is controlled by this parameter (http://code.google.com/p/sfera/wiki/Con ... _per_frame);
2) filter the image by applying a box filter 3 times in order to emulate a Gaussian filter (http://code.google.com/p/sfera/source/b ... re.cl#1171 and http://code.google.com/p/sfera/source/b ... re.cl#1189 kernels). This behavior can be controlled by render.filter properties (http://code.google.com/p/sfera/wiki/Con ... age_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 (http://code.google.com/p/sfera/wiki/Con ... st_effect)).
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.
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).straaljager wrote:Any plans on implementing other primitives besides spheres (axis aligned boxes for example)?
-
- Posts: 24
- Joined: Thu Dec 01, 2011 9:45 pm
- Location: Switzerland
- Contact:
Re: Sfera: a game with real-time path tracing rendering
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 http://www.virtualray.ru/eng/engine.html and a video at http://www.youtube.com/watch?v=1eqWtzC0Jbo. The SDK is available as well.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.
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.