Sfera: a game with real-time path tracing rendering

Show-off, reference material & tools.
Dade
Posts: 206
Joined: Fri Dec 02, 2011 8:00 am

Sfera: a game with real-time path tracing rendering

Postby Dade » Mon Dec 12, 2011 8:03 am

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.jpg
sfera.jpg (82.96 KiB) Viewed 5928 times


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).

toxie
Posts: 118
Joined: Mon Nov 28, 2011 12:30 pm
Location: germany
Contact:

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

Postby toxie » Mon Dec 12, 2011 10:47 am

Very cool, also some nice materials on some planets there.. Was this inspired by Super Mario Galaxy? :)
Better you leave here with your head still full of kitty cats and puppy dogs.

Dade
Posts: 206
Joined: Fri Dec 02, 2011 8:00 am

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

Postby Dade » Mon Dec 12, 2011 12:58 pm

toxie wrote:Very cool, also some nice materials on some planets there.. Was this inspired by Super Mario Galaxy? :)


Just a little ;)

straaljager
Posts: 14
Joined: Thu Dec 01, 2011 9:45 pm

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

Postby straaljager » Mon Dec 12, 2011 1:03 pm

Very impressive Dade :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)?

Dade
Posts: 206
Joined: Fri Dec 02, 2011 8:00 am

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

Postby Dade » Tue Dec 13, 2011 9:06 am

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 (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/ConfigurationFile#Frame_blending_(alias_ghost_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.

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).

straaljager
Posts: 14
Joined: Thu Dec 01, 2011 9:45 pm

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

Postby straaljager » Tue Dec 13, 2011 10:39 am

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 http://www.virtualray.ru/eng/engine.html and a video at 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.


Return to “Tools, Demos & Sources”

Who is online

Users browsing this forum: No registered users and 1 guest