Direct3D (DirectX 8.1) Code Samples - Page 4

First-Person-Shooter View Control
 

Hey, if you want to program a first-person shooter style game like Half-Life or Quake, then this is the sample for you. This code will show you how to create a first-person view, which moves in response to both keyboard and mouse input using DirectInput.

 

Emboss Bump Mapping
 

These samples demonstrate how to perform one-pass and two-pass emboss bump mapping with Direct3D. I've also included code, which demonstrates how to calculate tangent and binormal vectors on a per-vertex basis. These special vectors define the texture space for each vertex, which allows for accurate texture coordinate shifting during the bump mapping process. Check out the OpenGL source code page for the OpenGL equivalent of these samples.

 

Simple Effect Using .fx Files
 

This sample demonstrates how to write and use Effect files (.fx) under DirectX 8.1. The sample Effect is very straightforward. It defines a technique called "TwoPassTextureBlend", which has two separate rendering passes, called "Pass0" and "Pass1". The two passes are then used to basically blend two textures together through the simple addition of the texel data.

 

Simple Vertex Shader (vs.1.1)
 

Demonstrates how to write a vertex shader using the vs.1.0 instruction set defined in DirectX 8.1. Of course, this method of writing shaders for Direct3D will soon be replaced by either DirectX 9.0's HLSL (High-Level Shading Language) or Cg (C for graphics) from nVIDIA. Check out the OpenGL source code page for the OpenGL equivalent of this sample.

 

Simple Vertex Shader (Cg)
 

Demonstrates how to write a simple vertex shader, or vertex program using Cg. Check out the OpenGL source code page for the OpenGL equivalent of this sample.