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


Submitted by Paul Baker, posted on February 26, 2003




Image Description, by Paul Baker



"The Octagon" is my game engine project on which I have been working for the last 6 months, on and off. It displays Quake 3 bsp maps, Quake 2 md2 and Quake 3 md3 models. All are lit using per-pixel lighting and bump mapping, and all surfaces cast stencil shadows.

There are two classes of light available for use. The first are standard point lights, and the second have projected cube maps. These can be used to emulate spotlights and anisotropic light sources. Gross visibility testing is done using the bsp and frustum culling per sector. This is then refined by testing if each individual face is within the camera frustum. The same procedure is used to see which faces are lit by each light.

Firstly, everything visible is rendered with its decal texture multiplied by a small constant plus its emissive texture, in order to provide the base for adding light. Then, for each light, stencil shadows are cast for each object which the light influences, and then a hardware-specific codepath lights the surface.

After all of the lights have been handled, particles which emit light of their own are added to the framebuffer. Then, we loop through the lights again and draw any non-light-emitting particles (such as steam particles), lit by any lights which influence them.

The demo requires at least OpenGL 1.3 support and is available for download at: http://users.ox.ac.uk/~univ1234

Full source code is supplied with the demo.


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

[next]

 
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.