|
Programmable Pixel and Vertex Shaders |
|
|
|
Written by Tuan "Solace" Nguyen Saturday, February 24, 2001
|
|
|
|
|
|
Page 3 of 4 Vertex Programming
There’s another new feature that NVIDIA has implemented into the recently announced GeForce3, and it’s called a programmable vertex shader.
With a traditional graphics pipeline, each stage in the pipeline has predefined functions, and those functions are carried out systematically. If the developer wanted to manipulate a stage to do what’s desired, it’s not possible. Here’s a diagram of a traditional graphics pipeline:
It’s also possible that each stage has certain modes of operations, again, also already predefined and hard coded into the GPU itself. This limits the possibilities of generating a custom experimental look. It also makes it more difficult to do special effects on the GPU. Anything that’s not already defined must be done on the system CPU, taking away precious CPU cycles. So how does NVIDIA want to change things? They do it by enabling the ability to dynamically change the pipeline.

This type of technique gives total control to the developer. They can dynamically use assembly code that can be injected straight into the pipeline, reprogram it to the desired settings, and then continue the process. This effectively makes the pipeline unique to a programmer. It’s almost like having a different graphics card for every game, doing what the game needs. Vertex Programming Features / Benefits
Below are some of the features of a programmable vertex shader:
- Complete control of transform and lighting hardware - Complex vertex operations are accelerated in hardware - Per-vertex set up for per-pixel bump mapping - Character morphing and shadow volume projection - Custom vertex lighting - Custom skinning and blending - Custom texture coordinate generation - Custom texture matrix operations - Custom cartoon-style lighting - Custom vertex computations of the programmer’s choice - Offloads vertex computations freeing up the main CPU -- making more physics and simulations possible
Basically, vertex programming allows a programmer to create advanced and sophisticated effects in real time, in hardware and not be limited to a set of predefined functions either.
 The Vertex Programming Process The process goes something like this: You have 3 vertices that form your typical triangle polygon. These vertices are fed into the vertex manipulator. When inside, each vertex can be changed, manipulated and controlled in any manner. Any number of changes can occur while inside the VM. The programmer can choose from his imagination. It’s the sky’s the limit basically. Once the vertices are outputted, they could have been changed coordinately. Their colors could have changed, transparency changed, or locations. What’s really cool about this process though is that the programmer can choose which vertex he wants changed. It can be all or just one, or even none. He can decide that only vertex 1 and 2 needs to be changed, then outputted. The next three vertices that arrive, he can choose to do something different again or nothing at all. Also, every vertex can be changed in the same manner should that be what the programmer chooses.
Changing all these properties will give you limitless special effects for objects. Effects can be applied entirely to an object or just to certain sections of it for subtle details. The possibilities are “nfinite” and limitless.
|
|
|