The Graphics Rendering Pipeline 3 D SCENE Collection






















- Slides: 22

The Graphics Rendering Pipeline 3 D SCENE Collection of 3 D primitives IMAGE Array of pixels Primitives: Basic geometric structures (points, lines, triangles, polygons)

3 D Primitives Geometry Stage 2 D Primitives Rasterization Stage Vertex Processing Pixel (Fragment) Processing Coordinate Transformation Primitive Rasterization Lighting Calculation Vertex Attribute Interpolation Texture Mapping Raster Operation (ROP)Test Scissor Alpha Test Stencil Test Depth (Z) Test Color Blending Pixels

Computer Graphics Hardware Architecture Graphics Card Graphics Controller Motherboard CPU Video Memory Primitive Data System Memory Bus (PCI, AGP, PCI Express) Texture Data Frame Buffer Video Controller Video Display Device

The Frame Buffer The frame buffer: Video memory that holds screen pixel values. Resolution: Number of horizontal and vertical pixels on the screen. Color value Pixel value w-1 0 0 x Depth (Z) value Stencil value Frame Buffer (x, y) h-1 Color Buffer Depth (Z) buffer y Stencil Buffer

Double buffer Two color buffers. Front stage for display. Back stage for drawing. Front stage and back stage swapping for animation. Front stage pointer color buffer 1 Back stage pointer color buffer 2 Triple buffer Three color buffers. One front stage and two back stages.

Evolution of Graphics Controller • Pre 1995: 2 D era • 1995 -1998: First generation of 3 D accelerators • 1999 -2000: GPU (Graphics Processing Unit) • 2001: Vertex Shader • 2002: Pixel Shader • 2006: Geometric Shader Unit: Part of graphics hardware that can be programmed Shader Program: Programs that run on shader units • Vertex shader controls vertex processing • Pixel shader controls pixel processing • Geometric shader generates new geometries

1995 -1998: First generation of 3 D accelerators CPU Graphics Controller Graphics Application Rasterization Stage Rasterizer Geometry Stage 2 D Primitives Textures System Memory Bus (PCI) 2 D Primitives Texture Unit ROP Unit Textures Frame Buffer Video Memory

Features: • Primitive rasterization • Texture mapping • Hardware Z-buffer Products: • 3 dfx: Voodoo, Voodoo 2, Voodoo 3, Voodoo 5 • NVidia: Riva 128, Riva TNT 2 • ATI: Rage 128 • Matrox: Mystique • Rendition: Verite • S 3: Savage

1999 -2000: GPU (Graphics Processing Unit) CPU Geometry Stage Graphics Application 3 D Primitives Textures System Memory Transformation And Lighting Unit Bus (AGP) 3 D Primitives Rasterization Stage Rasterizer Multi Texture Unit Texture Combiner Textures Video Memory ROP Unit Frame Buffer

Features: • Hardware transformation and lighting (Tn. L) • Superscalar structure (Multiple vertex and pixel processing units working in parallel) • Hardware Z-buffer and Stencil-buffer Representative products: • NVidia: Geforce 256, Geforce 2 • ATI: Radeon 7500 The demise of 3 dfx (2000) and lessons to be learned: http: //www. firingsquad. com/hardware/3 dfxdemise/

2001: Vertex Shader CPU Geometry Stage Graphics Application 3 D Primitives Textures System Memory Vertex Shader Unit Bus (AGP) 3 D Primitives Rasterization Stage Rasterizer Multi Texture Unit Texture Combiner Textures Video Memory ROP Unit Frame Buffer

2002: Pixel Shader CPU Geometry Stage Graphics Application 3 D Primitives Textures System Memory Vertex Shader Unit Bus (AGP, PCIe) 3 D Primitives Rasterization Stage Rasterizer Multi Texture Unit Textures Video Memory Pixel Shader Unit ROP Unit Frame Buffer

NVidia Shader Model Products ATI Shader Model Products Code 1. x Geforce 3 NV 20 2001 1. x Radeon 8500~9250 R 2001 Geforce 4 NV 25 2002 2. 0 Radeon 9500, 9700, X 300, X 550, X 600 R 300 2002 Radeon 9800, X 700, X 850 R 420 2004 Year 2. 0 Geforce FX NV 30 2002 3. 0 Geforce 6 NV 40 2004 Geforce 7 G 70 2005 Geforce 8 G 80 2006 4. 0 3. 0 Radeon X 1300, X 1600, R 520 2005 X 1650, X 1800 4. 0 Radeon HD 2400, HD 2600, HD 2900 Geometric shader was added in Shader Model 4. 0 Vertex Shader Unit Geometric Shader Unit Code Year Pixel Shader Unit R 600 2007

Computer Graphics Software Architecture CPU Graphics Application Bus Vertex Shader Unit Geometric Shader Unit Pixel Shader Unit Vertex Program Geometric Program Pixel Program Graphics API Graphics Device Driver

Graphics Applications • • 3 D modeling software (3 D Studio, Maya, etc. ) CAD software (Solidedge, Solidworks, Pro/E, etc. ) Medical and business visualization software Computer games Graphics API: Application Programming Interface Low level API • Open. GL • Direct 3 D High level API • Open Inventor • VRML • Java 3 D

Vertex and Pixel Program (Shader) Assembly Language HLSL (High Level Shading Language) Cg (C for Graphics) Direct. X HLSL GLSL (Open. GL Shading Language)

Introduction to Open. GL (Open Graphics Library): API for 3 D graphics rendering. Originally developed on SGI graphics workstation. Became an open standard in 1992. Features: • • • Open standard. Hardware independent. Cross-platform (Unix, Mac OS, Linux, Microsoft Windows). Cross-language (Bindings for C, C++, Fortran, Ada, Java) Extensible through Open. GL extension mechanism Limitations: • No input functions. • No text rendering functions. • No window management functions.

Open. GL versions • 1. 1 (July 1, 1992) Adds texture objects, texture and subtexture copying, vertex array. • 1. 2 (March 16, 1998) Adds 3 D texture, separate specular color, imaging subsets. • 1. 3 (August 14, 2001) Adds compressed texture, cube map texture, multitexture, texture combiner function, multisample antialiasing. • 1. 4 (July 24, 2002) Adds depth texture and shadows, Fog coordinates, Point parameters. • 1. 5 (July 29, 2003) Adds buffer objects. • 2. 0 (September 7, 2004) Adds Open. GL shading language, multiple render targets, non-power-oftwo texture, point sprites, two-sided stencil operation.

Open. GL ARB (Architecture Review Board) Useful websites: • www. opengl. org • nehe. gamedev. net • www. nvidia. com • www. ati. com • www. anandtech. com • www. tomshardware. com 3 DLabs Apple ATI Dell IBM Intel Nvidia SGI Sun Microsystems

History of Direct. X and Direct 3 D Direct. X was designed by Microsoft to be a hardware independent API for game and multimedia programming under Windows. Direct. X Direct. Draw Direct 3 D Direct. Sound Direct. Music Direct. Input Direct. Play Direct. Show Direct. Draw Direct. X Graphics Direct 3 D Direct. Sound Direct. X Audio Direct. Music Direct. Input Direct. Play (Deprecated) Direct. Show (Deprecated) 2 D graphics rendering 3 D graphics rendering Sound input, synthesizing and output Music input, synthesizing and output Keyboard, mouse and gaming devices (joysticks, gamepads) input Multiplayer gaming over local network and the Internet Playback of video and audio multimedia files

Direct. X version history • 1995. 8. Windows 95 was released. But most games were still written for DOS. Microsoft needed a unified API for game programming under Windows 95. • 1995. 9. Direct. X 1. 0 was released for Windows 95. • 1998. Direct. X 6. 0. Added support for Direct 3 D immediate mode. • 2000. Direct. X 7. 0. Added support for hardware transformation and lighting. • 2001. Direct. X 8. 0. Added support for shaders in assembly language. • 2003. Direct. X 9. 0. Added Direct. X HLSL. • 2007. Direct. X 10. 0 for Windows Vista only. Introducing Shader Model 4. 0.

Open. GL and Direct 3 D Comparison Open. GL Direct 3 D Standard Open Microsoft Proprietary Portability Support Multiple platforms Only for Windows including Unix, Linux, Mac OS, Windows, etc. Programming Language Support C, C++, Fortran, Ada, Java, etc. C, C++, Visual Basic, C#, etc. Programming Interface Conventional header and library COM (Component Object Model) Extensibility Open. GL extension mechanics New COM interfaces