See what's going on with flipcode!




 


Submitted by , posted on 16 April 2002



Image Description, by


These screenshots are taken from a small project I undertook about a month ago to integrate ODE, DirectX and stencil shadowing into a single demo.

ODE is the Open Dynamics Engine - an open source rigid-body physics simulator, written by Russ Smith. This demo uses version 0.03. The stencil shadowing is performed using the standard "Carmack's reverse" method on convex bodies. The basic algorithm for each light is:
  • Project the body onto the plane normal to the light direction
  • Compute the convex hull on the plane
  • Extrude this hull into a shadow volume, being careful to cap before the far clip plane
  • Using the shadow volumes, additively render the scene into the frame buffer
This works fine for the directional lights used in the demo, and could easily be extended to more useful point and spotlights.

The end result is what I hope is a fun demo. The player controls a buggy in a simple world containing plenty of dynamic objects to smash into and ramps to drive off. Many thanks to the population of #flipcode on ETG for their invaluable comments, suggestions and artwork. :) The demo uses vertex shaders for geometry processing, so unless you own a card with hardware shaders (e.g. GeForce3) you will need at least a 800MHz CPU to get a decent framerate. The demo requires Windows 2000/XP with DirectX 8.1 installed.

The demo binaries (which include the textures) and the full project source code are avaiable here:
  • iotd-04-16-2002-buggydemo-binary.zip (389k)
  • iotd-04-16-2002-buggydemo-source.zip (50k)
  • The source is all C++ (with a bit of vertex shader assembler) in a Visual Studio .NET project.

    Si Brown



    [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.