Tuesday, April 26, 2011

Cycles, a new unbiased CPU/GPU renderer for Blender

The GPU path tracing virus keeps spreading at an incredible rate: Blender is soon going to have a fully integrated physically based renderer, codenamed 'Cycles', which can use the CPU or the GPU for rendering (GPU path tracing starts at 1:18).

http://code.blender.org/index.php/2011/04/modernizing-shading-and-rendering/

Changing materials, moving objects around and adding/deleting new objects can be done in real-time and the Cycles rendering engine can also rebuild the acceleration structure of the Suzanne model at lightning fast speeds. The source code will be available in about two weeks! It's going to be really cool when you can modify your model and immediately see the changes rendered in real-time in photoreal quality. Speaking of real-time editing and rendering, one of Luxrender's developers has made an utterly amazing video showing live editing of a physics simulation inside Blender and rendering it in real-time with Luxrender's PathGPU2 (a 100% OpenCL path tracer and part of SmallLuxGPU v1.8 with a heavy focus on animation rendering):

http://www.youtube.com/watch?v=bSQoJW9ajmU (real-time part starts at 1:23)

The video was rendered on a Core i7 920 + 2x ATI HD4890's, certainly not a bad system, but the HD4000 series was not exactly conceived with OpenCL computing in mind. I would love to see a GTX580 rendering this scene though. According to the graph below from Anandtech depicting the performance of SmallLuxGPU 1.7, I can imagine that card would just fly in this scene and make the video that much more awesome!



Update: SmallLuxGPU 1.8beta (which incorporates Metropolis light transport in OpenCL) is now available for download from the Luxrender forum

Update2: A lot of useful information and implementation details on the Cycles renderer can be found on http://wiki.blender.org/index.php/Dev:2.5/Source/Cycles under the header "Design"

Tuesday, April 19, 2011

Incredible real-time GPU path tracer using WebGL

Yesterday I came across another awesome GPU renderer (made by Evan Wallace), it's a very neat and extremely fast path tracer using GLSL shaders running in the browser:


A WebGL-enabled browser is required to run this (I highly recommend the latest Chrome build from http://www.khronos.org/webg/wiki/Getting_a_WebGL_Implementation#Chrome.2FChromium (the Chrome Canary build works great if you're on Windows, Firefox 4.0 crashes and other Chrome versions didn't work for me, it just keeps loading).

It's great fun to edit the scene: move the light or objects and see soft shadows being cast in real-time (60 fps) on the walls and other objects. You can also change materials and add extra objects. It renders blazingly fast even on very low end GPUs. Very impressive!




Source code for the path tracer:
There's also a GLSL version (Mac OS X):

With this technology, a path traced physics simulation like the one in this video is perfectly possible in real-time on a current GPU. Or maybe a real-time path traced version of Tetris ;)




Tuesday, April 12, 2011

CentiLeo: a brand new interactive out-of-core CUDA path tracer for massive models

Wow, the real-time GPU path tracing goodness just keeps on coming! I've barely recovered from the fantastic real-time path traced Kajiya scene by Jacco Bikker and Jeroen van Schijndel, and now I stumbled upon another hugely impressive interactive GPU path tracer, called CentiLeo, which is able to render massive models (such as a stripped down Boeing 777 model containing 370 million polygons) interactively with global illumination on just 1 GTX 480 using out-of-core GPU path tracing (3-10 frames per second at 1024x768, 1 sample per pixel with 1 GI bounce from an HDR image).

A twelve-minute video in HD of this amazing renderer in action:

http://www.youtube.com/watch?v=mxx9dyPO0js

Some screengrabs of the video with more info:









The planned features sound extremely exciting and seem to be aimed at production rendering with among other things bidirectional path tracing, Metropolis light transport, hair and displacement mapping:



All these features will be CUDA based according to the author of the video (see youtube comments):
"the target is CUDA implementation because it is fast and flexible enough. BDPT, MLT, tesselation, displacement mapping, hair/fur, texture filtering - sure, will be CUDA-based.

Programmable materials can be done in CUDA. But an additional idea would be to port some existing CPU/C++ material shaders to work with our GPU compute building blocks. Voxels are not yet planned. But they can be potentially implemented.

Our goal is to finish the TODO feature list by September 2011. The concepts are pretty simple, but all the devil is in details. The future work is engineering. Almost all research was already done.
The website will be created this or next week. This demo shows what we can do now."

The holy grail for game graphics:



This tech would be an ideal fit for rendering huge voxel data sets stored in a sparse voxel octree at interactive rates with high-quality global illumination. Definitely something to keep an eye on in the future.

Wednesday, April 6, 2011

Scene from Kajiya's paper 'The rendering equation' can now be path traced in real-time on the GPU! UPDATE: exe available

This is just incredible, another milestone in the history of rendering! Jacco Bikker, the main developer behind the real-time path tracer Brigade, and Jeroen van Schijndel, an IGAD research assistant, have made a new simple but superb path tracer (similar to tokaspt) which can render the classic path tracing scene from the 1986 paper "The rendering equation" by Jim Kajiya in real-time on just one GTX 470! There is very little noise overall, there's just some in the glass spheres and in the shadowed caustics.




Some stats:

- 512x512 rendering resolution
- 8 bounces
- 64 samples per pixel
- 12 frames/second on 1 GTX470

The amazing path tracing speed is partly due to the fact that there are no triangle meshes but only geometric primitives (spheres and boxes) in this scene, which are computationally much cheaper to intersect than triangles. The scene in the video is not 100 % identical to the original one (the structure consisting of the revolved parabola with the oblate spheroid, 'mushroom' for short ;-), is missing), but they're working on it (UPDATE 2: the mushroom is finished, see link at the end of this post). This is the original scene from the 1986 paper:


The above is an off-screen photograph (published in the paper). This is the direct feed image:


It's really mind-boggling when you realize that Kajiya needed 1221 minutes (20.35 hours) to render this image on a supercomputer from 1986 (an IBM 3081 mainframe) and 25 years later it can be computed at the same resolution in 36 milliseconds on a GTX580! A speed up of 2 million times!! Sounds like a great 25th anniversary :D !


(gotta love that '80ies font :-)

I would love to see some animation in this scene, for example an animated light casting moving shadows or a collapse of the pile of green spheres, which would greatly accentuate the "real-timeness" of the path tracing.

UPDATE: Executable and source code for this demo are now available at the links in this thread on the ompf forum. It's awesome, I'm getting a frametime of 1900ms in the 64 spp version on my poor 8600M GT, which is 49x slower than a GTX580 in this demo (kajiya-perf, default view at 64 spp/frame needs 1759 ms/frame on my 8600M GT and only 36 ms/frame on a GTX580)! Time to upgrade :)

UPDATE 2: Like Jacco Bikker has promised in the comments, the mushroom-like structure is now done! Visit http://ompf.org/forum/viewtopic.php?f=6&t=3174 for a screenshot of the updated scene and for more info on this project.

Monday, April 4, 2011

GPU Metropolis light transport with OpenCL in LuxRender!

This is very neat: after Dietger van Antwerpen successfully implemented Metropolis light transport (MLT) on the GPU using CUDA and the Brigade path tracer framework, one of the LuxRender developers now has succeeded at making MLT work on the GPU with OpenCL.

http://www.luxrender.net/forum/viewtopic.php?f=34&t=5795 (registration required)

Unlike Luxrender's SmallLuxGPU, which is a hybrid CPU+GPU renderer that only uses the GPU for ray intersections, this MLT algorithm is running entirely on the GPU using OpenCL, offering a vast speed boost over the hybrid approach. Fireflies (bright pixels produced by caustics) are sampled away much more efficiently than when using the standard path tracing integrator. Very complex lighting situations (e.g. light passing through a keyhole) should benefit as well.

It's great to see a smart and efficient rendering algorithm like MLT (which many believed to be impossible on current GPUs) is now popping up in several GPU renderers. Hopefully bidirectional path tracing running entirely on the GPU (with MLT on top, something that has already been done by Dietger van Antwerpen) will become widespread soon as well.

Tuesday, March 29, 2011

720p video of Unbiased Truck Soccer Sunny Sky with caustics!

HD video: http://www.youtube.com/watch?v=ymo57ElhHvY
Rendered with my 8600M GT, it's still doing a pretty good job despite its age :) The caustics from the glass sphere are not reflected in the mirror ball because max path length is set to 3 for performance reasons. Setting max path length to 4 will show the reflection of the caustic light pattern.

Download executable: http://code.google.com/p/tokap-the-once-known-as-pong/downloads/list



Increasing the emission values (RGB) of the "sun" to 4, 4, 2 makes the caustics more obvious:

Monday, March 28, 2011

Unbiased Truck Soccer: Sunny sky with only a few traces of rayn!

Another test in the quest for faster convergence speed, this time using a skydome and sun.








One of the advantages of using a skydome to light the scene is that the difference between 2 and 3 bounces of indirect light is not as large as when using an area light:

max path length 1 (zero bounces)


max path length 2 (1 bounce)


2 bounces


3 bounces


Another advantage is the very fast convergence speed compared to using area lights due to the fact that almost every pixel can 'see' the skydome. Only the pixels that are occluded from the skydome (e.g. the ground patch under the car) clean up slower because they are indirectly lit. Using bidirectional path tracing would greatly increase the convergence speed of these pixels (edit: as pointed out by Iliyan in the comments, bidir path tracing would actually perform worse in this outdoor scene where standard path tracing shines).

An overcast sky can be simulated by using only the skydome for lighting (without an emitting sun sphere):




In this case, the noise clears up very fast with just a few samples. This lighting setup will be used for the Unbiased Truck Soccer game.

Download the executable for this sky test at http://code.google.com/p/tokap-the-once-known-as-pong/downloads/list (package updated with glass sphere for some nice caustics)

To brighten/darken the sun, select the sun sphere by right-clicking it, click the 'emi' button on the top right of the screen and change the values at the bottom of the screen to e.g. 10, 10, 5. Overbrightening the sun will cause the shadows to look sharper and more pronounced, but will also increase the noise to unacceptable levels:

Sunday, March 27, 2011

Unbiased Truck Soccer: motion blur tests

I made some tests to determine which amount of motion blur (accomplished by accumulating samples from previous frames) is acceptable for relatively fast moving objects.

The picture below shows a comparison of the scene from 'Unbiased Truck Soccer' with different amounts of motion blur: no motion blur (left), averaging the last 3 frames (middle) and averaging the last 6 frames (right). These images were all rendered on a 8600M GT with a frame rate of barely 5 fps, so the comparison is not representative for more powerful GPUs, but it provides a general idea of the "noise freeness" of parts of the image that are static like the walls, floor and ceiling. The three little rectangles at the bottom of the picture show a close-up comparison of a noisy area of the ceiling which is lit only with indirect lighting.



A low-res video:


The truck is performing a looped animation. The camera can be moved by holding the middle mouse button (dragging in image plane) and Shift + middle mouse button (zooming).

The new test can be downloaded from http://code.google.com/p/tokap-the-once-known-as-pong/downloads/list The package contains three executables, with different amounts of motion blur (none, average of last 3 frames and average of last 6 frames).

On a GTX 580 this demo should run at 60 fps at default settings (768x512 resolution, max path length 4, 4 samples per pixel per pass blurred to 12 (motion blur = 1) or 24 (motion blur = 2) samples per pixel).

Monday, March 21, 2011

OTOY at the Abu Dhabi Media Summit 2011

Last week, AMD held a session about "Content and the Cloud" at the Abu Dhabi Media Summit with OTOY's Jules Urbach as one of the main speakers. A video of the complete session can be found at

http://www.youtube.com/watch?v=WGcyyTZfXTE

Some interesting snippets that were shown and talked about:

- Crysis 2 rendered in the cloud at the highest settings and streamed to an iPad using OTOY's tech

- games can be rendered for 16 concurrent users with a single GPU

- (around the 16:00 mark) path tracing!!! A very short clip was shown where Jules manipulates an extremely high detail model from the Transformers movie (created by ILM) on an iPhone in real-time, rendered in the cloud with path tracing and displayed at 60 fps. Path tracing will scale to as many servers as are available. This will really revolutionize the way games and films are made. A blurry picture below:

- Software tools such as Blender will be delivered through the cloud with OTOY

- WebCL! The next logical step after WebGL, which will make the GPU computing power from the cloud accessible through a webbrowser. Very interesting.

- Operating systems, next-gen consoles, Blu-Ray discs will become irrelevant when all apps run in the cloud

- The same assets from the Gaiking movie (to be released next year), will be used in a Gaiking game that can only be played on the cloud due to the massive computing resources it will require for rendering the graphics in real-time. Tantalizing... :-D

Screen from the Gaiking teaser trailer:



Thursday, March 17, 2011

Unbiased Truck Soccer: First physics test with Bullet Physics

UPDATE: I've uploaded the executables for the Bullet physics test and the new scene with the soccer playing field at http://code.google.com/p/tokap-the-once-known-as-pong/downloads/list

I've recreated the truck from 'Unbiased Truck Soccer' in the Bullet Physics engine and applied some physical properties to make it behave like a real vehicle like suspension stiffness, damping, rolling and friction.

This is a video of what the gameplay should be like when using the Bullet Physics engine, made with the built-in debug OpenGL renderer of Bullet:


And a Soccer game is not complete without a huge open playing field. The goals will be represented by a blue and a red sphere. Players can score by bumping the soccer ball against the opponent's sphere.
The hardest part is using the output of the Bullet Physics engine to update the position of the trucks and the soccer ball in the real-time path tracer. It should be fairly straightforward though, so I hope to have a working version soon!






Tuesday, March 15, 2011

Unbiased Truck Soccer: coming soon!




I had the idea for this game just yesterday. The goal is to push the ball against the moving goal (glowing paddle) of the opponent and score. Once it's finished and physics are actually working, you will be able to move the truck in every way, not just forward, backward and strafing left and right. Initially it will be a two player game, but hopefully I can make a single player game with an AI controlled truck.

In this particular case, path tracing provides very real and natural looking lighting and shadows. And it's still somewhat real-time on my poor laptop with 8600M GT (2.3 fps, with 4 samples per pixel , max path length 4, at default resolution), so I'm confident that it will look and play much better on a high end GPU. A GTX580, which is 20 times faster than my card (measured with Cornell Box Pong), should be able to reach 40 fps at 4 spp, default resolution. Image quality at 4 spp is very acceptable thanks to the frame averaging trick (reusing samples from previous frames to fake motion blur) by Kerrash. Hopefully I can get the Bullet physics engine working soon.

Download the exe for this WIP Tokap Unbiased Truck Soccer at http://code.google.com/p/tokap-the-once-known-as-pong/

The following GIF (click on it to see the whole image) shows the effect of the max path length on the lighting in the scene. The difference in realism between the image with path length 1 (zero bounces = direct lighting only, no global illumination) and the image with path length 2 (1 bounce global illumination) is huge. Reflections and color bleeding (mostly visible on the surfaces facing downward and on the ceiling) are completely missing from the image with path length 1. Refractive objects need at least a path length of 3 to become (slightly) transparent. The effect on framerate is also interesting: rendering with path length 3 (1.08 fps) halves the framerate compared to rendering with direct light only (2.07 fps).








Below is a simple chart plotting max path length against framerate. The numbers are for the above scene at default resolution and 4 spp on a 8600M GT. The curve demonstrates that the framerate is less impacted at higher path lengths.



UPDATE: 2 more videos

Mapping the movement keys to the eye pupils gives this result:


Playing with the main light source (720p video):


Rocky's opinion about the current state of game graphics:

Update 12 on real-time path tracing: Meet Rocky



Path traced in real-time on a 8600M GT. I hope to have physics working soon, so I can make a (multiplayer) game with trucks bumping and crashing into one another. Or a game with two trucks and a ball, where each truck has to push the ball into the goal of the adversary. Unbiased Truck Soccer, path traced in real-time. Joy ;)

Download 'tokap truck eyes' executable and source code at http://code.google.com/p/tokap-the-once-known-as-pong/

Sunday, March 13, 2011

Update 11 on real-time path traced Tokap: Pimped out, chromed out truck!



Since Tokap can (currently) only ray trace spheres, I've decided to build a funny looking car out of spheres: the body of the car consists of 3 merged diffuse spheres, the top sphere is a blue refractive sphere, the wheels are grey diffuse spheres with reflective spheres inside them representing the rims. The headlight is a reflective chrome like sphere with an emitting sphere inside. The car can currently only move forward, backward, and strafe sideways.

Image with motion blur, 20 spp (reusing samples from previous frames), 0.84 fps on 8600M GT


Image without motion blur, 20 spp, 0.84 fps (on 8600M GT):


High resolution image with motion blur, 8 spp with frame averaging, 0.77 fps



This is an image where the main light source is turned off and the scene is only lit by the emitting white spheres in the headlights:



Some videos:

Notice the soft shadows and ambient occlusion under the car, and color bleeding from the floor onto the body of the car. Photorealism becomes a piece of cake with path tracing :-).

Everything is still rendered on my humble laptop with a 8600M GT, maybe it's time to upgrade ;-) Even on such low end hardware, the amount of noise is quite acceptable in this particular scene (where everything is mostly directly lit).

Download this 'tokap truck' executable (CUDA enabled GPU required) at http://code.google.com/p/tokap-the-once-known-as-pong/

Stay tuned for more tests with hopefully some physics so the truck can drive up a slope, push a ball, collide with another truck, ...


Chromed out ;)



UPDATE: more videos!




If anyone has a better CUDA GPU than mine (which is not unlikely ;-), I would really appreciate it if you could capture a short video and upload it somewhere.