Introduction Real-time rendering is concerned with making images rapidly on the computer. The rate at which images are displayed is measured in frames per second (fps) or Hertz (Hz). Usually between 15 fps and 72 fps. Interactivity, 3D rendering, graphics acceleration hardware. Include applications such as computer games, CAD, 3D animation software (3D Max or Maya), …, etc.
Graphics Rendering Pipeline The main function of the pipeline is to generate, or render, a two-dimensional image, given a virtual camera, 3D objects, light sources, shading equations, textures, and more.
Pipeline Architecture conceptual stages functional stages pipeline stages A pipeline consists of several stages. The speed of the pipeline is determined by the slowest stage, no matter how fast the other stages may be.
GEOMETRY Vertex Shading light Geometry blue red green Rasterizer Materials + Lighting Shading Compute color at vertices Try to mimic how light in nature behaves – Hard to uses empirical models, hacks, and some real theory ApplicationGeometryRasterizer shading equation
GEOMETRY Clipping Square (cube) after projection Clip primitives to square ApplicationGeometryRasterizer
GEOMETRY Screen Mapping Screen mapping, scales and translates square so that it ends up in a rendering window These screen space coordinates together with Z (depth) are sent to the rasterizer stage ApplicationGeometryRasterizer
The RASTERIZER Pixel Shading ApplicationGeometryRasterizer Using the interpolated shading data as input The end result is one or more colors to be passed on to the next stage is executed by programmable GPU cores Texturing is one of the most important techniquies
The RASTERIZER Texturing += One application of texturing is to glue images onto geometrical object Uses and other applications More realism Bump mapping Pseudo reflections Store lighting Almost infinitely many uses ApplicationGeometryRasterizer
The RASTERIZER Merging ApplicationGeometryRasterizer Pixels are stored in color buffer Combine the fragment color with the pixel color Highly configurable Resolving visibility (done with Z-buffer) alpha channel for transparency stencil buffer for masking accumulation buffer for motion blur, depth of field, soft shadows, or antialiasing
The RASTERIZER Z-buffering The graphics hardware is pretty stupid It just draws triangles However, a triangle that is covered by a more closely located triangle should not be visible Assume two equally large tris at different depths Triangle 1Triangle 2Draw 1 then 2 incorrect Draw 2 then 1 correct ApplicationGeometryRasterizer
Double Buffering Front Buffer Back Buffer Copy Back Buffer Front Buffer backfront backfront backfront (vertical retrace)
Flipping Front Buffer Back Buffer back front register A B front back register A B
And, lately… Programmable shading has become a hot topic Vertex shaders Pixel shaders Adds more control and much more possibilities for the programmer Application Geometry Rasterizer HARDWARE Vertex shader program Pixel shader program