Title: Graphics Pipeline
1Fac. of Comp., Eng. Tech. Staffordshire
University
3D Computer Graphics
Graphics Pipeline
Dr. Claude C. Chibelushi
2Outline
- Introduction
- Typical Pipelines
- Gouraud shading
- Phong shading
- Ray tracing
- Graphics API Pipeline
- Rendering Hardware
- Performance requirements
- Acceleration methods
- Sample architecture PlayStation 2
- Summary
3Introduction
- Graphics pipeline
- sequence of processes for generating 2D display
of 3D scene - processes can be implemented in hardware or
software - main processes
- geometric transformations
- e.g. translations, rotations, projection (see
viewing pipeline) - application of shading to visible surfaces
4Introduction
- Processing sequence for 3D graphics
- primarily dictated by efficiency considerations
- minimisation of amount of computations and number
of polygons processed - discard invisible elements from pipeline as early
as possible - culling (object / back faces), polygon clipping
- display at appropriate level of detail
- polygonal simplification applied to far objects
- no single pipeline is efficient for all
applications - designer should find right (combination /
sequence of) techniques for optimum performance
5Typical Graphics Pipelines
Material processing colour, texture,
transparency,
Geometry models
Viewpoint
Viewport
Lights materials
- Shapes
- World pos., orient., sizes
- Pos., orient.
- Field of view
- Projection type
- Pos., orient. of display area
- Light pos., orient.
- Optical char.
Typical graphics pipeline
6Typical Graphics Pipelines
- Gouraud- or Phong-shaded polygonal worlds
- 1. Model loading / generation
- loading / generation of graphics primitives
(lines, polygons, ), and context information
(colour, transformation matrices, surface
normals, ) - 2. Modelling transformation
- graphics primitives (and possibly surface
normals) transformed from object coordinates to
world coordinates
7Typical Graphics Pipelines
- Gouraud- or Phong-shaded polygonal worlds (ctd.)
- 3. Trivial accept/reject classification
- back-face culling
- accept/reject test
- accept (reject) primitives that lie wholly inside
(outside) view volume - mark (for clipping) all primitives neither
accepted nor rejected (i.e. intersect view volume
boundary)
8Typical Graphics Pipelines
- Gouraud- or Phong-shaded polygonal worlds (ctd.)
- 4. Vertex or pixel lighting
- apply illumination model (ambient / diffuse /
specular) to polygon vertices or pixels - model applied once per vertex (Gouraud shading)
- model applied once per pixel (Phong shading)
- hence (for Phong shading) illumination model best
applied during scan conversion (see 9)
9Typical Graphics Pipelines
- Gouraud- or Phong-shaded polygonal worlds (ctd.)
- 5. Viewing transformation
- world coordinates transformed into viewing
coordinates - 6. Clipping
- primitives marked in step (3) clipped to view
volume
10Typical Graphics Pipelines
- Gouraud- or Phong-shaded polygonal worlds (ctd.)
- 7. Projection
- 3D viewing coordinates transformed into 2D
coordinates - 8. Viewport transformation
- projected coordinates transformed into device
coordinates - 9. Rasterisation includes
- scan conversion, pixel-based hidden-surface
removal, and shading (and sometimes, mapping
surface details texture, bumps, )
11Typical Graphics Pipelines
3D Models
Possible 3D graphics pipeline (z-buffer algorithm
and Gouraud shading)
12Typical Graphics Pipelines
3D Models
Possible 3D graphics pipeline (z-buffer algorithm
and Phong shading)
13Typical Graphics Pipelines
3D Models
Possible 3D graphics pipeline (BSP algorithm and
Phong shading)
14Typical Graphics Pipelines
3D Models
Possible 3D graphics pipeline (ray tracing)
15Graphics API Pipeline
- DirectX 8
- graphics pipeline
16Graphics API Pipeline
- DirectX 9 graphics pipeline
17Rendering Hardware
- Layered architecture of graphics system
DirectX Graphics
18Rendering Hardware
- Performance requirements
- 3D computer graphics requires substantial
computational power and high bandwidth - computation
- geometric manipulations (vertex transformations,
polygon clipping) and illumination - typically require floating-point calculations
- rasterisation requires colour / coordinate
interpolation, depth testing - can use integer or fixed-point calculations
19Rendering Hardware
- Performance requirements
- data transfer rate (bandwidth)
- rasterisation requires memory access for depth
testing, and clearing buffers between frames - display requires memory (frame buffer) access and
data transfer to VDU - Mapping of surface characteristics (bumps,
textures, ...) increases requirements
20Rendering Hardware
- Acceleration methods
- Computational throughput increased through
- concurrent execution (pipelining or parallel
processing) of rendering processes - Bandwidth increased through use of
- special memory devices dual-ported video RAM
(VRAM), synchronous DRAM (SDRAM), - high-bandwidth data paths (e.g. Intels
Accelerated Graphics Port (AGP))
21Rendering Hardware
- Acceleration methods
- Pipelining sequentially-connected multiple
modules perform tasks concurrently, e.g. - stages of graphics pipeline can run concurrently
- e.g. clipping and lighting vertices of current
polygon while previous polygon is undergoing
rasterisation
22Rendering Hardware
- Acceleration methods
- Parallel processing independent multiple modules
perform task(s) in parallel, e.g. - matrix multiplication
- simultaneous calculation of row-to-column
sum-of-products - rasterisation
- colour and occlusion information for each pixel
computed independently from other pixels of same
polygon
23Rendering Hardware
- Illustrative architecture
Pixel processor
24Rendering Hardware
- Sample architecture PlayStation2
25Rendering Hardware
- Sample architecture PlayStation2
(sources Oka 1999, Froggatt 2002)
26Rendering Hardware
- Sample architecture PlayStation2 (Emotion Engine)
(source Kunimatsu 2000)
27Rendering Hardware
- Sample architecture PlayStation2 (Emotion
Engine) - Legend
- COP Co-processor
- DMAC DMA Controller
- EFU Elementary Function Unit
- GIF Graphics synthesiser Interface Unit
- VIF Vector Interface Unit
- V(P)U Vector (Processor) Unit
28Rendering Hardware
29Rendering Hardware
- Supported features
- Range of features typically supported
- illumination and shading, z-buffering
- alpha blending (transparency)
- mapping of surface characteristics (2D / 3D
textures, bumps, ...), antialiasing - tesselation or direct processing of curved
primitives - stereo display, ...
30Suggested Reading
- Relevant parts of Ch. 10 15, A. LaMothe, Black
Art of 3D Game Programming, Waite Group Press,
1995. - Relevant parts of Ch. 7, 16, 18, J.D. Foley, A.
Van Dam, et al., Computer Graphics Principles
and Practice, 2nd Ed. in C, Addison-Wesley, 1996. - Z. Soferman, D. Blythe, N.W. John, Advanced
Graphics Behind Medical Virtual Reality
Evolution of Algorithms, Hardware, and Software
Interfaces, Proc. of the IEEE, Vol. 86, No. 3,
pp. 531 - 554, 1998.
31Suggested Reading
- M. Froggatt, The Power to Play, IEE Review, Vol.
48, No. 2, pp. 13 - 19, 2002 - A. Kunimatsu et al., Vector Unit Architecture for
Emotion Synthesis, IEEE Micro, Vol. 20, No. 2,
pp. 40 - 47, 2000 - M. Oka, M. Suzuoki, Designing and Programming the
Emotion Engine, IEEE Micro, Vol. 19, No. 6, pp.
20 - 28, 1999 - M. Macedonia, The Empire Strikes Back... with the
X-Box, IEEE Computer, Vol. 33, No. 6, pp. 104 -
106, 2000.
32Summary
- Graphics pipeline processing sequence that
results in 2D display of synthetic 3D scene - main components
- geometry sub-system transformations, clipping,
- rasterisation sub-system scan conversion,
hidden-surface removal, shading, detail mapping - No single pipeline is best for all applications
- configuration dictated by
- requirements of application, and mix of techniques
33Summary
- 3D computer graphics carries substantial
computational and bandwidth costs - hardware acceleration through
- pipelining or parallel processing
- special memory devices and high-bandwidth data
paths - wide variety of rendering hardware