DirectX 8.0: The Arrival of Pixel and Vertex Shaders
We’ve spent the last few years getting used to the "Fixed-Function Pipeline." You tell the GPU where the vertices are, give it a texture, and it draws it using a set of pre-defined rules. If you wanted a cool effect, you had to trick the hardware using multi-pass rendering or weird texture blending. But with DirectX 8.0, Microsoft has handed the keys to the kingdom to the developers.
Programmability
The big news is the introduction of Vertex Shaders and Pixel Shaders. Instead of relying on the hardware's hard-coded logic, we can now write small programs that run directly on the GPU.
A Vertex Shader lets us manipulate the geometry itself-think realistic water waves or skeletal animation done entirely on the card. A Pixel Shader lets us calculate the color of every single pixel-enabling things like bump mapping and per-pixel lighting that were previously the domain of offline renderers like Pixar’s RenderMan.
Technical Snippet: Assembly Shaders
For now, we’re writing these shaders in a low-level assembly-like language. It’s tight, it’s limited (only a few dozen instructions!), but it’s incredibly powerful.
// A simple DirectX 8 Vertex Shader snippet
vs.1.1
m4x4 oPos, v0, c0 // Transform position by projection matrix
mov oD0, c4 // Set constant color
mov oT0, v7 // Copy texture coordinates
Outlook
We’re moving from "configurable" graphics to "programmable" graphics. The next few years are going to be a wild ride as developers figure out how to use these new tools. I expect we'll see a massive jump in visual fidelity, but also a significant increase in the complexity of game engines. The barrier to entry for graphics programming just got a lot higher, but the ceiling just disappeared.
Aunimeda develops mobile and PC games - from casual hyper-casual titles to mid-core games with complex progression systems.
Contact us to discuss your game project. See also: Game Development, Mobile Game Development