Shader Basics

As mentioned before, both programmable pixel shaders and programmable vertex shaders are items called for by DirectX 8. You may recall from our GeForce3 Technology article that both items work to change the graphics processor from a fixed function processor to a programmable processor.

This is done by producing pixel shaders and vertex shaders that are able to compile and run low level code, much like a CPU does. Previous generation video processors performed fixed function transform and lighting calculations on vertex information and fixed texturing, filtering, and blending operations on pixel information. Since the operations were fixed, not only did new features have to be implemented in an API in order to be used, video processors had to be hard programed to perform these operations. Programmable pixel and vertex shaders give a new way of modifying vertex and pixel information by allowing a graphics processor to manipulate this data without any loss of speed.

Vertex shaders are essentially tiny programs that modify vertex data as it is received. The key benefits to programmable vertex shaders is that they allow many image enhancing effects, such as procedural deformation, shadow volumes, and many other types of effects including particle systems, lens effects, matrix palette skinning, and keyframe interpolation. Information reguarding common vertex shader effects is given in the table below.

Vertex Shader Effects
Effect
Description
Example
Procedural Deformation Allows for a change in object shape as by performing mathematical calculations. A lifelike animated bubble
Shadow Volumes The vertex shader create transparent volumes that extend behind objects away from light sources, creating realistic shadows A scene with multiple light sources and realistic shadows
Fur Rendering Creates realistic fur by giving vertices thin elongation to simulate fur A fuzzy rabbit
Particle Systems Animates large number of particles by assigning and modifying physical properties such as mass, velocity, acceleration, ect. Creation of fire, sparks, explosions
Lens Effects Distorts an object's shape to give the appearance of being viewed through a lens Viewing an object through a gun scope
Matrix Palette Skinning Allows skeletally animated characters with many bones to move and bend naturally Lifelike animation of characters
Advanced Keyframe Interpolation Animation and morphing effects are created by blending two or more keyframes Animation of complex facial expressions and speech

Like vertex shaders, pixel shaders are also small programs, except in this case the programs modify the attributes of individual pixels as they travel through the rendering pipeline. By altering the appearance of individual pixels, lighting effects are now made much more realistic. The programmability of the pixel shaders gives developers the ability to create customized effects and shading algorithms. As a result of the large number of pixels present in a rendered scene, pixel shader operations have to be more simple than vertex shader operations, since the calculations must be computed many more times in a scene.

Both vertex shaders and pixel shaders are specifications created by and called for by Microsoft's DirectX 8.0 API and it is this specification that NVIDIA's GeForce3 graphics chip is designed around. ATI's new SMARTSHADER technology goes one step further than the competition by including support for Microsoft's newly announced DirectX 8.1 API which ATI promises will provide even more realistic effects.

Index SMARTSHADER

Log in

Don't have an account? Sign up now