Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Jay Ryness , posted on November 12, 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

Image of the Day Gallery


Archive Notice: This content is archived, and commenting is no longer active. It is here for reference purposes. This content was added on an older version of flipcode, before the site closed in 2005.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.