See what's going on with flipcode!




 


Submitted by Jay Ryness , posted on 12 November 2003



Image Description, by Jay Ryness


Yet another terrain-related IOTD. Sorry. However, this isn't a terrain engine. For example, there is no dynamic LOD.

The main feature on display here is deferred shading. In one pass, the scene geometry is rendered into 4 render targets (currently 32 bits each) as normals, diffuse colors, specular colors, emission and gloss values, and depth. D3D9's multiple render targets are used for this. Then, one by one, the lights are rendered to the screen, using these render targets as source textures. The result is per-pixel lighting that doesn't "care" about geometric complexity. Cost is proportional only to the total screen area covered by the lights' spheres of influence.

The terrain itself is a simple implementation of restricted quadtree triangulation (RQT). The neatest thing here is that it generates a single (very long) triangle strip. Starting in one corner, the triangle stripper steps from triangle to adjacent triangle and visits each only once, finally ending right next to where it started. It's quite amazing to watch.

The heightfield and textures are derived from a picture of my kids, which is somewhat discernable in the bottom-right corner image (although please note that in real life their eyes and teeth don't glow in the dark).

Thanks for looking.

Jay Ryness



[prev]
Image of the Day Gallery
www.flipcode.com

[next]


 


Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
Please read our Terms, Conditions, and Privacy information.