Develop - Issue 83 - May 2008

Page 55

TECH ADVICE | BUILD

courses ID TECHNOLOGY idTech 5 CLIENTS TBA PLATFORMS Mac, PC, PlayStation 3, Xbox 360 INTEGRATION WITH Alienbrain, DevTrack, plus plug-ins for 3ds Max, LightWave 3D and Maya PRICE Available on request CONTACT licensing@idsoftware.com With no announced clients or indevelopment titles, except id’s Rage, not too much is known about idTech 5. One much discussed feature however is the MegaTexture system, a streaming technology which treats

Black Rock Studio

IF YOU’VE EVER DONE any shader programming then at some time you’ve probably experienced a niggling doubt about how tightly coupled the geometry is with the lighting. My first experience of HLSL programming was with an Xbox and I wrote a shader for doing soft-skinning. Well, actually I wrote five shaders, one for no lights, one for one light and so on up to four lights. To any software engineer that kind of cut and paste duplication is just wrong. Deferred shading, on the other hand, feels right. The geometry and the lighting aren’t bound together at all. You render the geometry in the scene without doing any lighting. This makes for great batching with fewer draw calls and state changes. As each pixel gets written into the colour buffer you need to render the information needed for lighting into another, off-screen, render target (called a x-buffer). This information comprises normals, motion blur vectors, specularity, reflectivity etc.

www.idsoftware.com/business environments as one very large texture rather than small tiled components. Another talked-up feature is the collision system which id claims prevents the geometric interpenetrations and collision errors typically seen in games.

TECHNOLOGY Q 2.0 CLIENT TBA HOST PLATFORMS Linux, Mac, PC, PlayStation 3, Wii INTEGRATION WITH Visual Studio 2008 PRICE Q includes animation blending Available on request CONTACT www.qubesoft.com info@qubesoft.com

DEVELOPMAG.COM

by David Jefferies

Tech 5 is id’s fifth engine

QUBESOFT

A lightweight cross-platform plug-in framework, Q is designed to enable you use the provided components or customise and add new ones appropriate to the game or application you’re making.

Deferred Shading

Data streaming, arbitrary scene rendering, n-dimensional animation blending and a real-time 3D editor are just some of the out-of-the-box features. You’ll have to add your own physics and AI, though.

Then, after all the geometry has been rendered, you render a series of screen-space shapes representing each light and, using the info from the gbuffer, perform the lighting calculations. For the sun, for instance, you might want to render a full-screen quad but for a street light it might be a small cone that represents the light-volume. Each visible pixel gets shaded exactly once. You can also use the depth buffer that has been laid down for all sorts of interesting effects from soft particles to screen space ambient occlusion. There are a couple of flies in the ointment. Firstly the g-buffer means that there’s no way of storing alpha so that has to be rendered using a traditional renderer, and hardware anti-aliasing isn’t supported so you’ll need to anti-alias the scene yourself. We started off down the route of the deferred renderer a few years ago and one of my colleagues, Shawn Hargreaves, did a presentation at GDC (Hargreaves 2004), but we abandoned the plans after getting the Xbox 360 specs and seeing the 10Mb EDRAM limit. Not a great thing to have if you’re planning on writing a 12Mb g-buffer! Now, though, we’re resurrecting the deferred renderer partly because our game demands more lights and partly because we require the z-buffer for our lighting effects, but also because the PlayStation 3 seems better suited to the technique – it has no EDRAM for one thing, and is happier with the simpler vertex formats that deferred shading gives you. On the Xbox360 we're just taking the hit of the additional resolves required from EDRAM. Interestingly, at GDC both Microsoft and ATI said the technique was going to become dominant in the future, so an investment made upfront now seems likely to pay off in the long run. MAY 2008 | 57


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.