Wednesday 8 September 2010

Kicking it off in 3D!

Ok so here it is, the first piece on “A Love Of Game Worlds”. This piece will not be about game worlds specifically but about experiencing them in stereoscopic 3D and my recent attempt to create this effect in the Unreal Development Kit.

I’ve always been a bit skeptical about the added value of stereoscopic 3D in games. My first encounter with this gimmick was at last year’s Gamescom when I stood in line for almost an hour to see the Avatar game in 3D. I’m calling it a gimmick on purpose because that’s the way I felt walking away after the presentation; slightly disappointed.

The Avatar demo didn’t convince me to upgrade to a new 3D-TV set nor to invest in a 3D set-up for my PC (e.g. Nvidia card+glasses+120 Hz monitor = $$$). With a weak first impression and considerable costs for an upgrade, I came to the conclusion I would not get into the 3d stuff in the foreseeable future. A year has passed and 3D has become more hot-topic than ever. Sony is making a push with its 3D enabled TV-sets and backing it up with considerable game content (Killzone 3 for example) while Nintendo is offering the chance to experience the world of 3D without glasses on the Nintendo 3DS. Even the people over at Crytek saw the added value of supporting 3D on their upcoming Crysis 2. Returning to GDC Europe and Gamescom this year I was ready to give this 3D business another try and I am glad I did!

At Gamescom this year I was able to try some of the games in 3D (sadly no Killzone 3 or 3DS) and what I experienced has come a long way since last year’s Avatar demo. At GDC the tech people from Crytek gave an interesting talk about how they achieved the 3D effect in Crysis 2 and after I returned from Cologne I was ready for some 3D in my own living room.

Because I still think dedicated 3D systems are a bit pricey I decided to see if I could make my own 3D effect in UDK. I always like doing some research and figuring out new techniques and the effect would be a nice added bonus to any game I’d make in the future using UDK. The Unreal Development Kit has recently been 3D enabled but in order to use the 3d settings a user would still require an Nvidia set-up for his pc. I wanted to make something everybody could use without spending a lot of money by using common Red/Cyan anaglyph glasses.

Red/Cyan glasses have been around since the 50's and I guess almost everybody has looked at pop-up images or stereoscopic photos at some point in their lives. The red and cyan filters allow viewers to see a slightly different image with each eye thus creating a 3D effect of added depth or things popping out of the image. Stereoscopic photos are being made by using two cameras and combining the two images in a program like Photoshop or a dedicated tool. In a real-time game environment where you’re being shown an average of 30+ images a second there’s no time to use external programs to create the effect. So I had to create the filter in the Unreal Engine as a postproces effect. Here are some screenshots of the first version of the effect with and without 3d enabled. Get your 3D glasses ready. (click on the images for a larger version)

without 3d filter
Without 3D filter

with 3d filter
With 3D filter

It works by taking the rendered frame and offsetting the color channels along the horizontal axis. The amount of offset is determined by the depth of the objects in the frame. It’s not perfect yet and I’ll keep playing with the effect to see if I can further improve the results. I will post the shader set-up somewhere in the future along with a video of the effect during gameplay. In the meanwhile here are some more on/off images.

without 3d filter
Without 3D filter

with 3d filter
With 3D filter

without 3d filter
Without 3D filter

with 3d filter
With 3D filter

Of course using Red/Cyan glasses has its limitations and the results will not be as powerful as the more advanced 3D options available like the active glasses. For one, the available color space is more limited because using too much red or tints of blue could break the effect. Also, wearing two colored filters over your eyes will change your perception of the colors on screen and might break the mood intended by the artists who created it.

As for my skepticism on the 3D in games? I think technology is rapidly improving and we are slowly moveing past the stage where the 3D feels like a gimmick. By the time the hardware is affordable enough for the mainstream to switch over, Game Developers will have enough experience to get the most out of it and add considerable value to our playing experience. For now I’ll keep to my Red/Cyan glasses, occasional 3D movie in the theaters and replaying some of my favorite titles on the HD-TV I recently bought.

SIDENOTE: For those of you who would like to experience some 3D action on your pc without spending a whole lot of money I stumbled across a display driver that allows you to play your games in anaglyph 3D (various colours). I also found an internet retailer who supplies all sorts of 3D glasses; some even with a decent look.
I’ve tested the display driver on several games and it worked pretty well, enjoy.

1 comment:

  1. So this is what you've been doing. : ) Looks cool.

    I'm still a bit sceptical on 3D myself, but it's awesome that you're getting it to work in UDK. I'm curious how this actually looks in action.

    ReplyDelete