Submitted by , posted on 02 March 2001



Image Description, by


This is the result of my first foray into D3D Vertex Shaders. It's the regular D3DXTeapot, rendered with three projective textures. One is a rotating fan-like texture, one a static vent-like texture, the other is a moving texture (the DirectX 'X'). The inspiration for making this was the Doom3 video shown at MacWorld the other day. Code-side I spend some time setting up projection matrices for each of the spot lights, set a few vertex shader constants, and then just render the mesh 3 times with alpha blending. Texture coordinates are generated given the object-space coordinates, they're clamped to the texture boundaries, and the texture is also multiplied by N*L (N=Vertex Normal, L=Light Vector) to get a nice falloff on the edges.

The DX8 binary is here:
http://www.contrib.andrew.cmu.edu/~amperez/projtex.zip

The code for the vertex shader is included. Pretty standard, and probably grossly inefficient in register usage (hey, it's the first assembly code I've written in years). Makes for a purty app tho.

-Cuban



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