Thursday, September 29, 2011

In-depth video on micropolygons in OpenGL

Anyone interested in OpenGL and micropolygons should definitely check out the following 1-hour-long video presentation by Kayvon Fatahalian, "Evolving the OpenGL Graphics Pipeline in Pursuit of Real-Time, Film-Quality Rendering":


Lots of interesting insights in the future of GPU hardware.

Tuesday, September 27, 2011

Real-time dynamic GPU path tracing

A small teaser of something I'm working on, rendered in real-time on a GeForce GTS 450:


12 samples per pixel, max path length = 4, 584x266 render resolution, Stanford Bunny with 69k triangles (rendered in about 0.4 seconds on a low-end GTS450):



This will eventually become a full-fledged game inspired by this video:

A few details on Imagination's PowerVR GPU with Caustic Graphics hardware ray tracing

A few days ago, an article appeared on the Japanese website 4gamer.net about an in-development PowerVR GPU, the PowerVR RTX, which is said to have integrated ray tracing hardware from Caustic Graphics (acquired by Imagination Technologies in December 2010). The article is in Japanese, and the Google translated version is barely understandable:

http://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Fwww.4gamer.net%2Fgames%2F017%2FG001762%2F20110920023%2F

Saturday, September 24, 2011

Video of Unbiased FPS + a new video of Brigade!

The following two videos of "Unbiased FPS" were rendered on a GTS 450 and demonstrate mouse look, shooting mechanics and how adjusting the number of averaged frames affects the amount of noise and blurring. Youtube has a terrible video compression algorithm for videos containing fine-grained noise (such as Monte Carlo noise), so these came out much worse than expected:




The frame averaging technique (implemented by Kerrash) significantly reduces the amount of noise without affecting the framerate, but the resulting blurring of fast moving objects is of course less than ideal. At the upcoming Siggraph Asia 2011, a paper entitled "Image-space bidirectional scene reprojection" will be presented which could potentially solve the blurring issue by reconstructing additional frames without distracting blurry artefacts (there are two versions, a raster based version and an image-based one). The video accompanying the paper shows a lot of promise and is definitely worth checking out: http://research.microsoft.com/en-us/um/people/hoppe/proj/bireproj/

On a sidenote, I found a new, short video of the Brigade path tracer, showing a real-time pathtraced animated character: http://www.youtube.com/watch?v=RbxoZK6Apj8 (no details on the hardware used)



The video shows very nice soft shadows and path traced ambient light coming from the skydome (calculated in real-time contrary to the constant ambient term which is used by many games to approximate indirect lighting).

Wednesday, September 21, 2011

Unbiased FPS

Another small experiment to see how a path traced first person shooter game might look like (all screenshots rendered on a 8600M GT):



4spp, reusing samples from the previous 6 frames, 720p resolution:


720p resolution, 4spp with 12 averaged frames (reusing samples from the previous 12 frames, resulting in heavy blur for moving objects, but crisp image quality for the rest of the scene):



Some features:

- a first person "gun" sticks to the camera and shoots chrome balls with physical weight

- mouse look is semi-functional, you can move the mouse cursor up to the borders of the screen

- the car can be controlled with the arrow keys

- the robot has an initial angular momentum, but essentially does nothing

- the camera is controlled with mouse + WASD keys (the classic FPS controls)

- the number of averaged frames can now be set with a slider (from 0 to 12). It regulates the amount of "blur" caused by reusing samples from previous frames and is very useful for comparison purposes. Setting the slider to 1 or higher greatly reduces the amount of noise at the expense of a more blurry image and doesn't have any impact on the framerate. You can for example quadruple the number of samples per pixel (thereby halving the amount of noise) for free and if the framerate is high enough, the blurring isn't even that distracting. Setting the slider to 12 with just 4 spp results in a very high quality image (effectively more than 100 spp) at high framerates, but at the expense of lots of motion blur when the car or camera are moving

There are no acceleration structures used (not even a bounding box around the car or the robot). Implementing those should give a nice ray tracing performance boost.

Monday, September 12, 2011

Video of Octane Render rendering in real-time on 8x GTX580s

I just saw a very impressive video on Youtube, showing real-time rendering of a complex interior scene with Octane Render using eight GTX 580s. Octane Render has very recently improved its "direct lighting/AO" kernel which includes a new ambient occlusion preset and a diffuse indirect lighting option (there are now separate sliders for specular, glossy and diffuse path depth and a slider for AO distance) so that it is now capable of rendering very realistic looking interior scenes extremely fast:


Screengrab from Youtube:



Some observations:

- in contrast to the type of scenes that is usually used to show off unbiased renderers (wide open outdoor scenes with shiny cars and lots of direct lighting from a skydome or sun/sky) this is an interior scene that is mostly lit by indirect lighting with many glossy surfaces

- the scene in the video contains more than 1.3 million triangles

- rendered at very high resolution (1500x1000 pixels)

- perfect scaling with number of GPUs (99-100% extra performance per additional GPU)

- while navigating through the scene, the image remains remarkably clear and recognizable without ever degenerating into a pixelated mess of big, blocky (and often black) pixels

- convergence to a noise-free image is extremely quick

It's not hard to imagine that this renderer will be truly real-time with the upcoming generation of GPUs (according to Nvidia, Kepler will be more than twice as fast at path tracing as Fermi, just like Fermi is 2-4x as fast as Tesla (GT200) thanks to caches and other improvements (see http://www.youtube.com/watch?v=0IC2NIogWR4) and AMD's Graphics Core Next will be much more focused on GPGPU computing than previous architectures). These graphics can be rendered noise-free in real-time at high resolution with techniques like adaptive sampling, image reconstruction, compressed sensing (a hot topic in medical imaging currently), edge-aware filtering of indirect lighting (e.g. the a-trous wavelet noise filter), extraction of spatiotemporal coherence with reprojection, path regeneration, reusing samples with frame averaging and frameless rendering. Rendering complex, 100% photorealistic scenes in real-time is much closer than commonly believed and cloud rendering will play a key role in accelerating this process.

UPDATE: another interior animation rendered on a Nvidia GTX 590 with Octane Render's new indirect diffuse lighting/AO kernel: http://www.youtube.com/watch?v=O2Aufjr44g4Hi
Rendertime per frame: ~1 minute, 1024 samples per pixel (see screenshot in this thread). This is absolutely amazing...

Wednesday, September 7, 2011

Unbiased Stunt Racer in HD!

I've changed the 'Unbiased Stunt Racer' demo a little bit: I've added the buildings from my Futuristic Buildings demo to the scene and also added a function to adjust the speed of the physics simulation at runtime with the N and M keys. The platform and sphere are also moving at a speed that's independent of the framerate, so the game is still playable on high-end cards like the GTX 480 and higher. The new executable contains 480p and 720p executables. I find it mindblowing that real-time path tracing is feasable today at HD resolutions using only one GPU.

Below is a 720p image of the new demo, rendered on a 8600M GT at 8 samples per pixel:



Some 480p screenshots (all captured on a 8600m GT):




A video will follow soon and the source code will also be uploaded. The code is very messy with lots of obsolete comments and there are heaps of global variables, which isn't good programming practice but it does the job. :)

The executable "Unbiased Stunt Racer HD Final" is available at http://code.google.com/p/tokap-the-once-known-as-pong/downloads/list

This will be one of my last demos involving only spheres and boxes as primitives. The limitations on the number of objects and shapes are starting to outweigh the benefits of these cheap-to-intersect primitives, so I'm moving to the wonderful world of triangles and BVHs soon.

UPDATE: source code is online at http://code.google.com/p/tokap-the-once-known-as-pong/downloads/list

UPDATE 2: sneak peek at an upcoming demo (robot and car will be user controlled and "shootable")



UPDATE 3: Finally found some time to make an HD video of Unbiased Stunt Racer HD:

720p "fly-through":


480p gameplay:

Executable and source can be found at http://code.google.com/p/tokap-the-once-known-as-pong/downloads/list




There is also a new paper and video on reducing Monte Carlo rendering noise called "Random parameter filtering" with amazing results (thanks to ompf.org forum): http://agl.unm.edu/rpf/ The video is definitely worth the download and shows great potential for real-time path tracing.

Monday, September 5, 2011

Unbiased Stunt Racer!

For the last couple of days, I've been busy creating "Unbiased Stunt Racer", a new real-time path traced demo involving physics, a vehicle and a shooting robot. It's actually a mix of a platformer and a stunt driving game. First you have to reach a platform by driving the vehicle over a ramp, then you have to reach another platform with a robot which is shooting at you, by driving over two rails where a nasty chrome sphere hinders the passage. The final goal is to push the robot off of his cosy place. The sunlight is constantly changing position and color, casting nice soft shadows over the scene. Below is a walkthrough video (rendered on GTS450) and some screenshots:








The number of samples per pixel can now be altered at runtime with the O and P keys. Pressing space resets the car. I've converted some of the stratified sampling in the original code back to purely random sampling, resulting in a slightly noisier but more realistic image.

An executable demo for Unbiased Stunt Racer is available at http://code.google.com/p/tokap-the-once-known-as-pong/downloads/list

The biggest advantage of using real-time ray tracing/path tracing for these "games" (besides having higher quality graphics) is that almost anyone can immediately start creating simple games without worrying about lighting, shadows, multiple reflections, refractions and all combinations of these effects. Everything just works as expected and without any effort on the artist side. It's like a "push button" game engine: just create the scene and the renderer takes care of everything else.

Thursday, September 1, 2011

New video of Unbiased Physics Games

Changed the ground color and brightened up the sky in preparation for an upcoming demo called "Unbiased Stunt Racer" (courtesy of Anonymous blog reader :). It looks a little bit more realistic now (480p video on GTS 450):



"Unbiased Physics Games v1.0" executable demo at http://code.google.com/p/tokap-the-once-known-as-pong/downloads/list

Tuesday, August 30, 2011

OTOY partners with GPU path tracing renderers Octane and Brigade!

Wowowow... this is superawesome news! An article on Venturebeat today revealed that OTOY will be partnering with two fantastic renderers, Octane Render from Refractive Software and Brigade from Jacco Bikker, both pioneers in interactive/realtime high quality GPU based rendering.

I've blogged about these three developers before, and the fact that all three will be joining forces is just breathtakingly awesome! It's a dream come true:

- Octane Render is by far the fastest, most feature rich and highest quality unbiased GPU renderer, trouncing traditional biased and unbiased CPU renderers

- Brigade is a realtime CPU/GPU path tracer targeted at games (with many noise reducing optimizations) developed by Jacco Bikker, who also developed the GPU path tracing code used in my latest demos

- OTOY is an emerging cloud rendering/cloud gaming company (probably best known from the AMD Radeon 4800 and 5800 launch events and the Ruby demo which used voxel ray tracing) that also owns LightStage, a state-of-the-art dome-shaped capturing environment for creating 100% photorealistic digital actors, which was used in blockbuster movies like Benjamin Button, Avatar and The Social Network

This new partnership means that there is now a very high concentration of high-quality rendering know-how and I've got a feeling that there will be more to come. This will have a profound impact on the movie/game/rendering industry... I'm extremely happy and excited to see what's coming from all this :D.

The VentureBeat article is here: http://venturebeat.com/2011/08/30/otoy-cloud-video-games/

Sunday, August 28, 2011

UPG: Unbiased Physics Games!



I've been working on some new real-time path traced demos during the past week involving physics, driving and shooting, three popular ingredients in action games. The demos will be bundled under a new 3 letter acronym, i.e. UPG (GPU in reverse), which stands for Unbiased Physics Games.

I've created two new small games:

- a simple driving game where you can pull some driving stunts with lighting effects (the camera follows the car):


- a simple shooter game where you can hit the car and a robot-like character which will respond to the impact of a cannonball:



Both games use the GPU path tracer developed by Jacco Bikker for the Simplex Paternitas demo. The videos were recorded on a GTS450 with 16 samples per pixel (which already offers very good image quality with little noise) at a resolution of 640x480.

The robot and car in the second demo are both encapsulated by a "hitbox" (an axis aligned bounding box to maximize the path tracing performance), which position is updated every frame.

I'm going to implement a movable and "shootable" light hanging from a chain, which should create dramatic shadow effects. Some basic AI path finding code so the robot starts chasing and shooting the user-controlled car might also be an option. Still thinking about implementing oriented bounding boxes which would enable some cool collapsing structures. Plenty of ideas still and new ones are coming every day, there's just not enough time to execute all of them :) On the rendering side, I think I'll shift the geometric focus of the demos to triangle meshes and two-level BVH or grid, because there's only so much you can do with spheres and boxes - even though they're relatively cheap to intersect.

I've also tried porting the code to OpenCL with the recently released OpenCL1.1 drivers from Nvidia but the OpenCL kernel refuses to build for some reason and there's no easy way to find out what's causing the error. It will take some time to get this right.

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


Friday, August 19, 2011

Ray tracing in CryEngine 3!

Crytek has pioneered a lot of well known rendering techniques like screen space ambient occlusion and light propagation volumes for real-time dynamic global illumination. Proving that they're still at the forefront of real-time rendering, Crytek revealed at Siggraph that they are using a limited form of ray tracing in CryEngine 3 to enable real-time local reflections. The technique involves screen space ray marching along the direction of the reflection vector. More info about this method and lots of other interesting details in their Siggraph presentation at http://advances.realtimerendering.com/s2011/index.html

It's nice to see that ray tracing is finally being used by a leading game developer (without a doubt the most talented PC game engine developer of the moment), albeit in a limited form. If SSAO is any indication, we'll be seeing ray tracing based reflections in all of the other major game engines within the next year. From there, it's only a small step to use full ray tracing for reflections, shadows, refractions and ultimately global illumination. :)

Tuesday, August 16, 2011

Unbiased Truck with Plausible Bullet Physics!

The physics in the previous demo were funny and also a bit strange, because the chassis dove down when the wheels were going up. I discovered that the Z-angle of the chassis had to have the same sign as the Z-angle of the wheels, which gives a much more plausible result, although the wheels are still quite jerky and are jumping around because of the loose suspension. The car will pull itself to its original state in most cases, so I've decided to leave the wonky physics as is.

Rendered on 8600m gt:



Unbiased truck test drive in the Cornell Box:



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

Some people reported problems with the last executable, so I included an updated version of "cudart.dll" this time (the CUDA 4.0 version).

Monday, August 15, 2011

Unbiased Truck with Bullet Physics!!

After lots of trial-and-error, I have finally implemented car physics in the real-time path traced Unbiased Truck demos. Bullet doesn't like it when physical objects are not placed according to Newtonian rules, which has caused some unexpected behaviour and crashes.

The Bullet SDK provides a vehicle physics example with parameters for wheel friction, suspension, chassis stiffness, etc. The "car" consists of a rigid chassis with four independent wheels. Matching the physics world with the rendered world took some time to get right: for example, since each of the four wheels can move independently from each other and from the car chassis, each "rim" had to match up perfectly with its respective wheel.

Crashing the car into the walls is just plain fun. When hitting a wall, the car seems to disintegrate at first, after which it pulls its wheels and chassis together again.

The video below was rendered on a 8600M GT at low resolution, spp and max path length to achieve a somewhat playable framerate (it should look much better on a high end Fermi GPU):

512x256 resolution, max path length=3, 4 samples per pixel/frame:



256x256 resolution, max path length=4, 4 samples per pixel/frame:



A better video with higher framerate and image quality will follow soon. The new executable demo "Unbiased Truck Bullet Physics" can be downloaded from:

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


This is all work in progress. I'm planning to port this to the GPU path tracer developed by Jacco Bikker (which was also used in the Futuristic Buildings demos), which has support for AABB acceleration structures, better shadows, and which generally runs faster. A camera will follow the car, not only by targeting the car's center, but by moving along with it behind the car. Some basic shooting mechanics will be included as well, and maybe also some ragdoll physics with one of these:


WebGL water ray tracing demo

Link I always like a nice real-time ray tracing demo, especially when it involves physics. Evan Wallace released a very impressive WebGL demo featuring real-time raytraced water with caustics and physics (waves, buoyancy).

The demo is playable (Google Chrome browser required) at http://madebyevan.com/webgl-water/

Youtube: http://www.youtube.com/watch?v=i6aEQ5pY1aQ

Source code is available in the Chrome browser (right-click on the page > Inspect element > choose the "Scripts" button > choose "renderer.js" from the drop-down menu)

Saturday, August 13, 2011

John Carmack: "Eventually ray tracing will win"

Aaah, delightful August... Holiday, warm, sunny, relaxing, enjoying mountains and beaches alternated with reports from QuakeCon, Siggraph and High Performance Graphics :-)

John Carmack has said some interesting things about ray tracing during the Q&A following his QuakeCon keynote this year (which was mostly about the practical problems of working with MegaTextures in a production environment). I made a transcript of the relevant Q&A portion which can be seen in its entirety on youtube: http://www.youtube.com/watch?v=00Q9-ftiPVQ#t=18m30s

"I expect, as we look at next-gen console and broad enough adoption of PC stuff, that there will be some novelty games that are all raytraced or all voxeled on there. But when you look at the top end triple A titles, I do not expect that transition happening in that timeframe but I keep looking at it.
There’s a lot of these things that we look at every five years on and on and eventually… you know I do think that some form of raytracing, of forward tracing or reversed tracing rather than forward rendering will eventually win because there’s so many things that just get magically better there. There’s so much crap that we deal with in rasterisation with, okay let’s depth fade or fake our atmospheric stuff using environment maps, use shadows. And when you just say “well just trace a ray” a lot of these problems vanish. But one interesting thing that people say “look real-time raytracing on current hardware”, that’s what I did in OpenCL recently and I did some interesting work with that. But the real truth is, you don’t just trace one ray it goes sixty frames per second.
To do the things that people want to see out of ray tracing, you’re gonna need to trace a dozen rays on there if you want your soft reflections or even sharp reflections if you got bump mapping on there and not to look like a mess of noise on there, you start needing an order of magnitude more rays than that. And most people still avert their gaze from the whole problem of dynamic geometry. There’s some interesting work that goes on with very rapid GPU assisted KD tree construction that’s starting to look at some of that, but it’s still a long ways off. It’s always the problem of fighting against an entrenched incumbent where we’re doing polygon… Vertex fragment polygon based rasterizers are so far and away the most successful parallel computing architecture ever it’s not even funny. I mean all the research projects and everything else just haven’t added up to one fraction of the value that we get out of that. And there’s a lot of work, lots of smart people, lots of effort and lots of great results coming out of it. Eventually ray tracing will win, but it’s not clear exactly when it’s gonna be."

There is also a brand new video and interview with Carmack on PCPer where he's rambeling about voxels, ray tracing and Larrabee, Fusion, GPUs with ARM cores (Project Denver/Maxwell):


From the article:
"On the topic of ray tracing, a frequently debated issue on PC Perspective, Carmack does admit to finding its uses quite surprising and has spent some time building ray tracing engines for development testing. He seemed surprised by the results in his initial attempt to replace rasterization with a ray tracing engine, getting as much as 60 FPS at 720p resolutions on a Fermi-based NVIDIA graphics card. When performance dropped below the targeted frame rate he was able to either produce an image of a lower resolution and display that or use previous frames to sort of “blend” them for a smoother image. The issue though is the delta between a tech demo and fully implemented gaming engine – demos deal with static models, there is no character animation, etc. And while the fact that it runs at 60 FPS at 720p sounds impressive, if you were drawing that with a traditional rasterization engine it would be running at 1000 FPS!"
A transcript of the PCPer interview with Carmack (with some in-depth thoughts about ray tracing) can be found here: http://www.pcper.com/reviews/Editorial/John-Carmack-Interview-GPU-Race-Intel-Graphics-Ray-Tracing-Voxels-and-more/Intervi


There's also new interesting research material from HPG, mainly about ray tracing: active thread compaction for GPU path tracing (Wald) (performance boost is much less than initially thought), improving SIMD efficiency for GPU Monte Carlo rendering with stream compaction (van Antwerpen), 10x faster HLBVH (Garanzha), raytraced moblur (Grünschloss), VoxelPipe (Pantaleoni), CUDA rasterization (Laine):




Wednesday, August 10, 2011

GTS 450 video of Unbiased Sphere Stack Shooter game

Much better quality video (480p) of "Unbiased Sphere Stack Shooter" rendered on a GTS 450:



The photoreal lighting of the scene is much more obvious in this video (less noise, higher framerate and higher resolution than the previous vid which was rendered on a 8600M GT) Unfortunately Youtube puts a nasty filter over the image, the original image quality is much crisper.

The executable demo of TOKAP Unbiased Sphere Stack Shooter is available at http://code.google.com/p/tokap-the-once-known-as-pong/downloads/list (CUDA 4.0 required)

After much tinkering with the Bullet code (converting quaternions to degrees) the car physics for Unbiased Truck Soccer are finally working (just one car atm, but it looks hilarious), so I'll be posting a new demo and video soon.

Monday, August 8, 2011

Small update on CentiLeo


There is also a dedicated website about CentiLeo at http://www.centileo.com. Some interesting quotes from the website:
"CPU-based rendering solutions (even many-core, e.g. 16-core) are much slower than our GPU-based software (around 25x slower). Such 16-core CPUs are 3-4x more expensive than our GPU."

Wednesday, August 3, 2011

Unbiased Sphere Stack Shooter, the first real-time path traced shooter

A physics based demo without user interaction with the physical objects in the scene is only half as fun, so I've been working on a little physics based game where you can shoot a ball into the scene and hit physics objects. It's not a real game, it's just mindless fun and the graphics are as good as photoreal.







Features:

- real-time path traced graphics on the GPU: produces ultra-high quality physically accurate global illumination, soft shadows and reflections

- integration of the Bullet physics engine: start/pause the physics simulation by pressing 'm'

- first person camera: move forward, backwards and sideways with the arrow keys

- mouse look: click and hold the left mouse button to look around the scene (already working, but needs a bit more work to make it more robust)

- shooting mechanics: fire a ball into the stack or try hitting a bouncing sphere by pressing 'Enter'. The ball is shot from the current camera position at the current view target in the center of the screen. Due to performance reasons, only one ball is shot at a time (the same ball is 'recycled' with every shot).

Make the physics go berserk!


Video rendered on 8600M GT (a better quality video on GTS 450 will follow soon):