Programmable Pixel and Vertex Shaders Print E-mail
Written by Tuan "Solace" Nguyen
Saturday, February 24, 2001
Article Index
Programmable Pixel and Vertex Shaders
Pixel Shading
Vertex Programming
Vertex Programming Benefits
Vertex Programming Benefits

Although there are distinct benefits to vertex programming versus pixel programming, the two technologies aren’t competing technologies. Contrary, the two techniques are designed to complement each other to create ultra realistic and ultra responsive graphics.


"Membrane" - This vertex shader example changes
the color of an object as the surface points
toward or away from the viewer.

Paletted Skinning
Using vertex programming, games can contain characters that move incredibly realistically. Their joints will bend and clothes and armor will crease with each other accordingly. When a character moves its arms, their sleeves will stretch at the elbow and crease at the shoulders. All these effects can now be accomplished in real time.

Besides being able to move characters and objects in a believable manner, we can now have characters that can express emotion. When someone isn’t smiling, certain skin creases may not show. However, when they grin, we see dimples and creases caused by muscle movement underneath. These can now all be done using keyframe animation.


Cartoon style vertex shading is now a possibility


Environmental Mapping and Transforms
Because of vertex programming versatility, it can be applied to virtually any environmental effect that the game requires. You can have low moving fog across a valley or fog elevation in certain areas of a scene. Certain objects can appear or be hidden even in the same fog area because the programmer can program the vertex engine to be selective. Suppose I want only hills or mountains higher than 1000 feet to appear, I can have only those that are higher show up through the clouds and have the other ones stay covered until I come close.

Procedural Geometry Deformations
Using the vertex shader, objects that would otherwise stay still in the game can be brought to life. If you have a flag on a flagpole high up in the sky where it’s window, the wind motions can deform and shape the flag by chaos theory. You can have the flag wave, drop, bend, crease, fly, and swirl in any number of combinations. With dynamic deformations, you can finally really destroy things inside a game. It’s now possible to have realistic damage on objects, or even environments.

Geometry Morphing
Using the same concepts of Procedural Deformation, a game can have realistic organic effects. When a person smiles, a lot of facial changes occur. Certain muscles expand in a direction while others contract all causing other things to occur at the same time. These organic animations can now be performed in real time using keyframe animation again. The programmer can pick a starting point and ending point and have the vertex engine interpolate every frame in-between with ease. The result is a smooth and realistic looking animation.

Irregular Transform
Some of the other less significant effects are lens effects such as those looking through a telescope or a fishbowl. NVIDIA has also implemented some of the effects that were introduced with the Voodoo5 such as Motion Blur. Also, games can now contain custom lighting effects previously not possible before or was possible but with a huge performance hit. An example of this is two-sided lighting. Before, if you had a flat surface and wanted to light up both sides of the surface differently, you’d have to model both sides of the flat surface, doubling triangle count and reducing performance. But now vertex shading allows custom lighting on both sides without having to double-model.


Bad example, but motion blur's benefits are quite obvious...

Accelerated High-order Surfaces


Per-pixel setup for Per-pixel bump mapping


You can think of high-order surfaces as true curved surfaces. If you’re familiar with 2D geometry from school, an example of a linear formula would be y= m*x + b or a straight line. Many straight lines can be used to create an illusion of a curved surface, but you’ll need many, many linear surfaces to accomplish a single curved surface. NVIDIA has improved acceleration of high-order surfaces in the GeForce3. A high-order formula would be y = mx^2 + b where x is raised to a power. X doesn’t have to be raised to the power of 2, but for most common surfaces, 2 would be enough to describe them mathematically.

You’ll be seeing more games this year with curved surfaces. This should help improve the look of characters and environments greatly. It would be impractical to render oranges using straight lines if you’re trying to achieve realistic models.

What it All Comes Down To...

Have you seen the video of Doom 3 running on a GeForce 3 yet? Do yourself a favor and download it. You'll see the benefits of per pixel shading, and programmable vertex/pixel shaders very quickly.

Conclusion


There are a few things I won’t go over in this article because they will likely be covered in GeForce3 articles, which as you can probably tell, are just around the corner.

This article is meant to tell you the benefits of pixel shading and vertex shading. These two technologies, combined with other enhancements are the grounds for NVIDIA’s nfiniteFX engine. Because both of these technologies can be configured to a programmer’s preference, the engine can generate an infinite number of possibilities. Games can concentrate less on having proprietary engines that do different things in software and give more attention to other things, such as physics.

Both of these technologies, when combined, help to create unparalleled detail on surfaces -- whether they are flat or curved. More detail can simulate high polygon count, but doesn't entirely replace the need for more polygons. As technology progresses, we’ll be seeing more detail, more effects, and more realism. 
Comments (0)Add Comment

Write comment

busy