Volume Rendering : An Overview

I made a presentation which outlines the different methods for Volume Rendering, going into detail about Sparse Voxel Octrees ray casting. It gives a good overview on how to tackle the problem of rendering huge datasets.

Keywords: Direct volume rendering, texture mapping, splatting, ray marching, octree, kd-tree, memory management, GPU.

There’s also a PDF version available.

I’m providing this material because I think this is useful for other people interested in the subject. You won’t find any PhD-critical info, of course ;)

Efficient rendering using Sparse Voxel Octrees

I’ve been reading a lot lately about using voxels in CG. I’ve always been fascinated by ways of moving away from the traditional polygon-based pipeline, and things are really starting to look good for voxels.

Sampling all geometric and texture data on a regular grid allows for unique content, theoretically. No more repeating textures, pieces of scenery, … artists can basically create a scene and add little customizations to every object, without sacrificing rendering budget, as long as you’ve got a good way of streaming the right data to the GPU. Interesting work is done by Cyril Crassin on Gigavoxels, a paper which shows a working implementation of the Voxels-in-a-tree concept.

Continue reading

Call of Pripyat

I’ve been enjoying playing S.T.A.L.K.E.R. : Call of Pripyat lately, which is the third installment in the series. For people who don’t know the S.T.A.L.K.E.R. games: they are based in the fictituous radioactive ‘zone’ which was created after the 1986 Chernobyl disaster. It is loosely based on the novel Roadside Picnic by Arkady and Boris Strugatsy. You play a ‘stalker’, which is the name the book uses for adventurous people entering the zone to find anomalies, artifacts and unknown technology, which spawned when the disaster happened.

The S.T.A.L.K.E.R. games were made by Ukranian developer GSC Game World, and they have tendency to be a little rough around the edges: lots of crashes, glitches and bugs. Sometimes it seems like the promise of an open world with non-linear story progression and unhampered discovery was a bit too much for a relatively small studio. Luckily, the internet always finds a way: an artist going by the name of Pavel has compiled a mod called “Call of Pripyat Complete“, which bundles a gigantic amount of new artwork, scripts, weather effects and bug fixes.

Continue reading

Mafia II: Lighting analysis

I’m having a playthrough of Mafia II at the moment – went into it with a bit of hesitation because of the mixed reviews, but turns out it’s pretty okay. It focuses heavily on the story-based content, so just don’t go in expecting a free-roaming adventure, because besides buying clothes and weapons, there isn’t much to do in the city. Which is just fine, because the story is interesting enough, very cinematic.

2K Czeh built their own tech for this, the so-called Illusion Engine. As always, it’s very hard to find more information about the exact technology and algorithms used. The closest I could find after a lot of googling was  a quote from a CGTalk article“We use pre-calculated occlusion maps but apart from that all the lights and shadows are calculated in real-time which enables us to quickly experiment and change the lighting throughout the game.”

Apart from the pre-baked maps everything seems to be in real-time allright, with the amount of lights casting a dynamic object shadow capped to 3 or 4, it’s hard to tell. I suspect the game uses Deferred Rendering (confirmed by WP) to get away with a lot of the other light casting elements in the scene, like in the shot below. The regular techniques to mask the lack of hardware anti-aliasing are used: lots of Depth Of Field-filtering and edge blurring using a Sobel filter, similar to the one I describe in my thesis. The game is running in DirectX 9 mode, which explains the lack of hardware AA. Even without all the fancy normal bump mapping on characters, it just goes to show what a good texture artist can do to make a character look very lifelike – although the detail gets lost when it comes to the suit in the picture on the right.

Here’s a call out to all developers out there: I’m well aware that keeping the exact specs and techniques used in your engine is needed – it’s a commercial asset after all. Nevertheless, it would be nice to have some more general information about how different lighting conditions are handled. All we get now is buzzwords like dynamic and lifelike.

Displaying Shadow Volumes

Today I found a way to render the shadow volumes used in the stencil buffer technique I posted about yesterday in Ogre3D. Sometimes all you need is a ninja and three penguins to get a good insight. These are the shadow maps for one single point light source. Notice how the ninja’s katana extends the shadow volume significantly, and how the intersections of the shadow volume with the objects themselves define self-shadowing. Not shown in the picture is how the shadow volumes extend to infinity: this is necessary to be able to use Carmack’s Reverse.

Then we will fight in the shade

I’ve spent the day reading up on shadowing techniques for real-time rendering which can be used in the Ogre3D project I’m working on. I was not familiar with the details of the shadow volume method using stencil maps. It’s actually pretty clever, and it’s interesting to read how John Carmack (ID Software) developed the depth-fail-method (also known as Carmack’s Reverse) to be able to use the stencil shadow technique in scenes where the player/camera was inside the shadow volume. This is how they established the  shadows of those things creeping up behind you in Doom 3.

    Here’s a comparison I performed in Ogre3D:

    Some good resources (some outdated, but the basics still apply):

    Ogre3D ASCII

    I’m working my way through Ogre3D at the moment, to freshen up my C++/Visual Studio skills. I got my student copy from DreamSpark : seems that I’m still registered as a student, and thus qualified for free software - Yoink!. Browsing through the samples, I thought this was a nice touch: the SDK includes an ASCII shader (made in CG), sampling a 3D ASCII cube for values. It seems like a totally backwards way to approach rendering, but I like the silliness of it.

    What I’ll be doing with this engine is still a bit uncertain. I’m thinking about implementing my GPU-accelerated technique to draw suggestive contours, cooking up a game from scratch (an educative experience), … we’ll see where it leads!

    Structure From Motion Update

    This is one of the latest results of our Capita Selecta project (Selected Heads. Hah, the things I do with language …), in which we try to reconstruct human faces using Structure From Motion techniques.

    I refer to the previous posts about this subject for technical details, but in short: we only use a camera to capture images from several (random) viewpoints around the object, and then we run them through an SFM pipeline to match keypoints and build a point cloud. As you can see, the detail is getting pretty good, and the depth estimation doesn’t suffer from too much noise like it used to.

    The model contains 112 457 coloured vertices, so even without applying any form of texturing (and just interpolating the colors between the vertices), we can get a pretty good image. Images were made using a high-resolution photo camera tethered via USB. The point cloud viewer is a modified version of the OpenGL viewer I made for my thesis project.

    Continue reading