Graphics - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

Graphics

Description:

First truly 3D capable consoles: Sony Playstation. Sega Saturn ... specialised co-processor (Playstation 2) ... Playstation, Saturn, early PC. per-polygon ... – PowerPoint PPT presentation

Number of Views:62
Avg rating:3.0/5.0
Slides: 33
Provided by: Squ7
Category:

less

Transcript and Presenter's Notes

Title: Graphics


1
Graphics
2
Introduction
  • 1995 began the modern era of gaming graphics
  • First truly 3D capable consoles
  • Sony Playstation
  • Sega Saturn
  • First serious 3D consumer 3D card for PCs
  • 3Dfx Voodoo

3
Introduction
  • Before 1995 console games were 2D affairs
  • with a few exceptions (Star Fox, SNES)
  • There were several 3D PC games
  • Ultima Underworld, Doom, Descent, etc.
  • relied on heavily optimised software renderers
  • content limited to achieve decent frame rate

4
Anatomy of a Renderer
  • Geometry processing
  • vertex transformation
  • lighting, fog
  • view frustum clipping
  • backface culling
  • Rasterisation
  • texture mapping
  • alpha blending
  • depth testing
  • Gouraud shading

5
Geometry Processing
  • Performed on
  • host CPU (e.g. PC/Voodoo 1)
  • graphics sub-system (e.g. PC/G-Force)
  • specialised co-processor (Playstation 2)
  • Flexibility ranges from fully programmable to
    completely fixed in hardware
  • Generally computation-bound
  • in some cases, bandwidth-bound

6
Rasterisation
  • Extremely memory bound
  • e.g. 32 bit trilinear, alpha, z-buffered
  • 8 texture reads
  • 1 frame buffer read
  • 1 frame buffer write
  • 1 z buffer read
  • 1 z buffer write
  • 12 memory ops (48 bytes) per pixel
  • each 1024x768 screen fill uses 37MB bandwidth

7
Comparing Graphics Architectures
  • Speed
  • fill rate
  • triangle rate
  • peak vs. sustained in-game rate
  • Features
  • antialiasing
  • multi-texture
  • stencil buffer
  • Some modern systems are very fast, but relatively
    feature poor

8
Comparative Fill Rates
9
Comparative Triangle Rates
10
Features
  • All modern graphics systems offer
  • triangles
  • Gouraud shading
  • texture mapping
  • hidden-surface removal
  • blending
  • These are the basic tools of a real-time graphics
    programmer
  • Many offline rendering algorithms can be restated
    using the above constructs

11
Gouraud Shading
  • Per-pixel values generated via interpolation of
    vertex components
  • first-order smoothing algorithm for faceted
    objects
  • most people think of colour interpolation
  • hardware also interpolates
  • texture co-ordinates
  • fog
  • alpha
  • depth

12
Gouraud Shading contd
  • Texture co-ordinates are generally perspective
    correct
  • exception Playstation
  • Other components might not be
  • especially colour, fog
  • Watch for artifacts
  • Mach bands
  • warping
  • rotational variance

13
Texture Mapping
  • Invented by Ed Catmul in 1974

14
Multi-texture
15
Artifact Magnification
  • Happens when pixel-to-texel ratio 1
  • Texture becomes blocky
  • Solutions
  • higher resolution
  • bilinear filtering
  • pull camera back

16
Artifact Minification
  • Happens when pixel-to-texel ratio
  • Texture sparkles and swims
  • Solutions
  • lower frequency textures
  • mip-mapping

17
Artifact LOD Banding
  • Occurs at transitions between mip-map levels
  • Noticeable discontinuity between LODs
  • Solution
  • trilinear filtering
  • interpolate between LODs
  • usually incurs a performance penalty

18
Blending
  • Compostion of rendered pixels
  • addition, subtraction, multiplication, etc.
  • Many useful applications
  • transparency
  • glows
  • decals
  • shadows
  • caustics
  • Blending allows for multi-pass techniques

19
OpenGL / D3D Blending Equation
  • C CsFs CdFd
  • C output colour
  • Cs source colour
  • generated from rasterisation
  • Fs source factor
  • zero, one, src, dest, alpha, inverse alpha, etc.
  • Cd destination colour
  • in the frame buffer
  • Fd destination factor
  • zero, one, src, dest, alpha, inverse alpha, etc.

20
Blending Example
  • Additive ? C Cs Cd
  • Cs1 Cd1
  • glBlendFunc(GL_ONE, GL_ONE)
  • Multiplicative ? C Cs Cd
  • CsCd Cd0
  • glBlendFunc(GL_DST_COLOR, GL_ZERO)
  • Transparency ? C Cs? Cd(1-?)
  • glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_
    ALPHA)

21
Hidden Surface Removal
  • Older systems used the painters algorithm
  • Playstation, Saturn, early PC
  • per-polygon
  • unpleasant sorting artifacts
  • Everything now uses a z-buffer
  • per-pixel
  • suffers accuracy problems
  • transparency is difficult to handle properly
  • sometimes consumes frame buffer memory

22
Stencil
  • Used to mask out areas of the frame buffer
  • Many uses
  • shadows
  • mirrors
  • screen wipes

23
Techniques
24
Surface Geometry
25
Lighting
26
Shadows
27
Fog Haze
28
Reflection
29
Refraction
30
Micro-detail
31
Transparency
32
Volumetric Effects
Write a Comment
User Comments (0)
About PowerShow.com