Vertex & Pixel Shaders. CPS124 – Computer Graphics. Ferdinand Schober. Shader History I. 1995/1996: 3dfx Voodoo 1 first mass market GPU, hw accelerated rasterization GLIDE API, 16bit buffers, texturing & shading Quake using OpenGL!
CPS124 – Computer Graphics
Geforce FX Demo
ATI Radeon 9800XT Demo
“3D hardware previously used fixed-function pipelines in which, for example, one was stuck with the lighting model chosen by the hardware vendor. Graphics hardware was able to do transformation and lighting (T&L for short) on the card, but it was not flexible. A vertex shader sidesteps the T&L stage in the pipeline and lets the user add on to it.
Pixel shaders operate after the geometry pipeline and before final rasterization. They operate in parallel with multitexturing to produce a final pixel color and z-value for the final, rasterization step in the graphics pipeline (where alpha blending and depth testing occur).”
Nvidia: Cg ATI: HSLS (DirectX 9) OpenGL: GL2
Provide high level language for assembler-based
shading code. Use optimized (JIT) compilers to
transform to highly efficient machine code.
Winner yet undecided.
The program transforms an object-space position for a vertex by a 4x4 matrix containing the concatenation of the modeling, viewing, and projection transforms. The resulting vector is output as the clip-space position of the vertex. The per-vertex color is scaled by a floating-point parameter prior to output. Also, two texture coordinate sets are passed through unperturbed.
mov oT0, v7
mov oT1, v8
dp4 oPos.x, c1, v0
dp4 oPos.y, c2, v0
dp4 oPos.z, c3, v0
dp4 oPos.w, c4, v0
mul oD0, c0.x, v5
More in cutting-edge games lecture…