Vertex Shader Small assembly language program Replaces the Transformation and Lighting Engine Responsible for World and View transformations Is executed once per vertex Has no neighborhood information Prepares data for the Pixel Shader
Pixel Shader Small assembly language program Replaces the Texturing and Lighting Engine Is executed once per pixel Has no neighborhood information Does further calculations on the Vertex Shader ’ s output The output is the color of the pixel
Texture Instructions tex t texbem t texbeml t, s texcoord t texkill t texm3x2pad t, s texm3x2tex t, s texm3x3pad t, s texm3x3tex t, s texm3x3spec t, s0, s1 texm3x3vspec t, s texreg2ar t, s texreg2gb t, s ; normal sample ; bumped env. mapping ; … with Luminance ; sample tex. coords. ; black, if coords < 0 ; Matrix multiplications ; ; … +refl. +env. map. ; ; use s.ar as coords. ; use s.gb as coords.
Sample Texture Instructions tex t texm3x2pad t0, s texm3x2tex t1, s tex t0 texm3x3pad t1, t0 texm3x3pad t2, t0 texm3x3spec t3, t0, c0 mov r0, t3 ; put texture col. into t ; 3x2 matrix multiplication ; get normal vector from t0 ; eye-ray vector from c0 ; cube env. texture from t3 ; do env. mapping ; output color
D3DX Progressive Meshes different levels of detail (LOD) half edge collapse cloning by sharing of vertex buffers streamable save method OptimizeBaseLOD TrimByVertices/TrimByFaces
D3DX Skinned Meshes vertex data, bone data with vertex indices support for.X files export filters for Maya, 3D Studio Max available up to 4 indices per vertex up to 12 indices per face up to 256 bone palettes ConvertToBlendedMesh() reduces to this constraints ConvertToIndexBlendedMesh() same, but less subsets Uses GeForce ’ s restricted skinning support by rendering a prefix in hardware.
Conclusions very flexible tool hardware accelerated low level interface (assembly) vertex shaders theoretically applicable to point-sampled geometry rendering of shadows needs lots of work
What ’ s next? subdivision surfaces in hardware (TruForm technology by ATI) displacement maps
References MSDN (Microsoft Developer Network) NVIDIA Whitepapers –Introduction to Vertex Shaders –Introdction to Pixel Shaders http://msdn.microsoft.com/directx http://partners.nvidia.com/Developer