190 likes | 334 Views
Real-Time Shaders. Pilgrimage 2003 Thant Tessman. Talk Outline. Fixed-Function Graphics Pipeline Vertex and Fragment Program Extensions Cg/HLSL. http://developer.nvidia.com. Fixed-Function Graphics Pipeline. Geometry Ultimately Specified as Primitives Triangles Lines Points
E N D
Real-Time Shaders Pilgrimage 2003 Thant Tessman
Talk Outline • Fixed-Function Graphics Pipeline • Vertex and Fragment Program Extensions • Cg/HLSL http://developer.nvidia.com
Fixed-Function Graphics Pipeline • Geometry Ultimately Specified as Primitives • Triangles • Lines • Points • Which are in Turn Specified as Vertices • Primitives Rasterized to Fragments
Vertex Properties • Position • Normal • Color(s) • Texture Coordinate(s)
Vertex Properties • Position • Transformed by MODELVIEW Matrix • Normal • Color(s) • Texture Coordinate(s)
Vertex Properties • Position • Normal • Transformed by Inverse Transpose of MODELVIEW Matrix • Optionally Renormalized • Color(s) • Texture Coordinate(s)
Vertex Properties • Position • Normal • Color(s) • Specified Directly or • Generated from Transformed Per-Vertex Normals and Current Lights and Material • Texture Coordinate(s)
Vertex Properties • Position • Normal • Color(s) • Texture Coordinate(s) • Specified Directly or • Generated from Transformed Vertex and Normal • Transformed by TEXTURE Matrix
Resulting Vertex Properties • Homogenous Clip-Space Position (x,y,z,w) • Color(s) • Texture Coordinate(s)
Primitive Assembly • Optionally Clipped by User-Specified Planes • Transformed by Projection Matrix • Clipped by Viewing Frustum • Perspective Division by w • Viewport & Depthrange Transformations • Polygons Optionally Culled • Rasterization to Fragments
Lights, Material, Matrices, etc… Vertex State OpenGL Extensions Program Parameters Vertex Attributes DP3, RSQ, MUL, MAD, MAX, DP4, EXP, etc… Vertex Programs
Vertex Program Results • Homogenous Coordinate • Color • Texture Coordinates
Vertex Programs OpenGL Extensions are Your Problem Now
Fragment Attributes • Window Coordinate • Colors • Texture Coordinates
Fragment Program Output • Color • Depth
Cg/HLSL Compiles to Vertex/Fragment Programs
Real-Time Shaders The New 3D Graphics Programming Paradigm