CM0304 Graphics I Graphics Hardware I.1 Graphics Systems
CMT107 Visual Computing
Copyright By PowCoder代写 加微信 powcoder
I.2 Graphics Systems
Xianfang Sun
School of Computer Science & Informatics
Cardiff University
➢Computer Graphics
• Image Formation
• Raster graphics
• Vector graphics
➢Object oriented modelling
• Modelling and Rendering
• Realism vs real-time graphics
➢A typical graphics system
• Display Processor
➢3D Graphics Pipeline
2:59 PM 2CMT107 Visual Computing
Computer Graphics
2:59 PM 3CMT107 Visual Computing
➢ Computer graphics: Creating and manipulating
visual content.
• Modelling
• Rendering
• Animation
Image Formation
2:59 PM 4CMT107 Visual Computing
➢Rendering is about forming (2D) images from 3D models
• Analogous to physical imaging systems
(cameras, microscopes, telescopes, human
visual system)
➢Involved elements:
• Viewer / camera
• Light sources
➢ Images are represented by
➢ Colour is the result of interaction between physical light in the
environment and our visual system
➢ Attributes determine how light interacts with elements
2:59 PM 5CM3114 Graphics
UNC Course notes: Computer Vision
Additive and
2:59 PM 6CM3114 Graphics
➢Additive colour
• Form a colour by adding amounts of three primaries
• (CRTs, projection systems, positive film)
• Primaries are Red (R), Green (G), Blue (B)
• Sometimes alpha (A) value for transparency
➢Subtractive colour
• Form a colour by filtering white light with Cyan (C),
Magenta (M), Yellow (Y) (and Black (K)) filters
(light-material interactions, printing, negative film)
Subtractive
➢ User-oriented colour spaces
➢ More intuitive for interactive
colour picking
➢ Dimensions no longer primaries
• Hue (H): base colour
• Saturation (S): purity of colour
• Lightness / Luminance (L)
Value (V) / Brightness (B)
➢ The lightness of a pure colour is
equal to the lightness of a
medium grey
➢ The brightness of a pure colour
is equal to the brightness of
HSL and HSV/HSB Colour Spaces
2:59 PM 7CM3114 Graphics Ethz Course notes: Visual Computing
Luminance and Colour Images
2:59 PM 8CM3114 Graphics
➢Luminance image
• Monochromatic
• Values are grey levels
• Analogous to black and white
film or television
➢Colour image
• Has perceptional attributes of
hue, saturation, and lightness
(HSL/HSB/HSV colour model)
Raster Graphics
2:59 PM 9CMT107 Visual Computing
➢ An image is a continuous function f on a rectangular
• For each point we have a colour value f(x, y)
➢ A raster image is a discrete function F on a “rectangular
set” of discrete pixels (picture elements)
• For each pixel we have a colour value F(u, v)
➢ Generate a raster image from a continuous image by
setting a proper value F(u, v) for each pixel to represent
the corresponding subset of the image.
Vector Graphics
2:59 PM 10CMT107 Visual Computing
➢ Vector graphics represents images as plotting instructions
using the pen-plotter model
• Like drawing with a pen on a rectangular sheet of paper
• Instructions to specify movement of a pen (in straight
lines, but also circles, polygons, free-form curves, etc.)
• Pen can be on paper or not while moving
• Attributes to fill areas with colours, patterns, and to
specify line drawing styles, colours, etc. may exist
• Continuous (non-raster) shapes and canvas
• Rasterisation etc. is handled by API automatically
➢ Vector graphics APIs are normally used for 2D drawing
• Not easily generalised to 3D
Object Oriented Modelling
2:59 PM 11CMT107 Visual Computing
➢ Basic elements of 3D graphics API:
• Objects: lines, polygons, . . . given by positions, etc.
▪ Material: properties of the material an object is made of, in
particular how light is reflected by the object
• Viewer: virtual camera given by viewing transformations
• Light sources: defined by location, strength, colour, direction
➢ API provides methods to create and modify these
• Need suitable data-structures and algorithms to represent and
process graphical objects
➢ The image is generated from this information
automatically
Modelling and Rendering
2:59 PM 12CMT107 Visual Computing
➢ Separate modelling of a scene from rendering it
➢ Modeller generates a description of the 3D scene
➢ Model objects of the scene on a high abstraction level
• Describe/define properties of 3D scene
• Designer creates and refines model
(a human or program or from measurements)
• E.g. wire-frame model for designer (faster, more
suitable for editing), like a dinosaur
➢ Renderer creates images from it
• Fast real-time rendering of images (e.g. OpenGL)
• Computationally more expensive realistic rendering
of images (e.g. POV-Ray)
src/dino.html
Realism vs Real-Time Graphics
2:59 PM 13CMT107 Visual Computing
➢ Realism:
make images look as real as possible
• Realistic shapes
• Realistic illumination
• Realistic behaviour and movements
➢ Real-time:
display images “fast enough”
• (high number of frames per second)
• Perceive smooth motion
• Interact with the environment
➢ Tension between the two goals
Typical Graphics System
2:59 PM 14CMT107 Visual Computing
➢Simple model of a graphics system
• Mirrors architecture of standard
• Components specialised for graphics
(depending on specific application)
➢ Task of the display processor:
Relieve the host (CPU) from expensive graphics
computations using specialised hardware
➢ Initial versions of display processors:
• Host computes instructions to create image: display lists
• Display processor executes display lists in local memory
repetitively to refresh image
➢ Modern display processors: pipeline architecture
Display Processor
2:59 PM 15CMT107 Visual Computing
Display Processor Pipeline
2:59 PM 16CMT107 Visual Computing
➢ Display processors consist of two sub-systems
• Front-end sub-system to handle geometry
(e.g. pipeline on a stream of primitives)
• Back-end sub-system to handle rasterisation
(e.g. parallel processing on raster)
• Pipelining and/or parallel processing used for both
➢ Special processing unit for individual graphics operations
(vertices given by 4 numbers define geometry and are modified by
linear transformations / matrices, this will become clearer later)
Graphics Pipeline Tasks
2:59 PM 17CMT107 Visual Computing
➢Input of graphics pipeline provided by host / user code:
• 3D models (e.g. triangular meshes)
– Transformations applied to models (e.g. rotations)
– Material properties (e.g. colour)
• Light sources
➢ Output of graphics pipeline:
• 2D pixels in a raster
➢ What operations does the pipeline have to execute?
• Models (vertices) are transformed into pixels by
• The attributes are transformed in the pipeline
Coordinate Systems
2:59 PM 18CMT107 Visual Computing
3D Graphics Pipeline
2:59 PM 19CMT107 Visual Computing
➢ Modelling transformations:
• Convert model coordinates
into world coordinates
➢ Viewing transformations:
• Convert world coordinates
into camera coordinates
➢Multiple transformation matrices
can be combined to single matrix
➢ Parallel realisation allows to
multiply vector with matrix in
one operation
3D Graphics Pipeline
2:59 PM 20CMT107 Visual Computing
➢ Evaluate illumination model
• To determine colour/shades of
primitives
– E.g. compute colour value
for polygon vertices based
on material properties, light
sources, etc.
– Shading of whole primitive
is done during rasterisation
based on these values
3D Graphics Pipeline
2:59 PM 21CMT107 Visual Computing
➢ Clipping selects visible part of
the whole scene for displaying
• 3D clipping selects primitives
inside viewing volume
(cut off objects at planes)
– For perspective projection:
frustum (cut-off pyramid)
– For parallel projection:
rectangular parallelepiped
• May also remove hidden
3D Graphics Pipeline
2:59 PM 22CMT107 Visual Computing
➢ Project 3D primitives onto plane
to give 2D shapes
• Projection matrix specifies
type of projection
• Camera properties specify
projection in detail
3D Graphics Pipeline
2:59 PM 23CMT107 Visual Computing
➢ 2D clipping:
• Cut off (partially or completely)
2D shapes outside a rectangular
• Apply viewport transformation
(project rectangular area onto
• May also remove hidden
3D Graphics Pipeline
2:59 PM 24CMT107 Visual Computing
➢ Convert 2D shapes into pixels
• Scan conversion: draw 2D
polygons, lines, points in frame
• May include shading of lines
and polygons
2:59 PM 25CMT107 Visual Computing
➢ What is computer graphics?
➢ What is rendering? List the elements of rendering.
➢ What are raster graphics and vector graphics? Explain
their major differences.
➢What are the functions of the modeller and renderer?
➢Describe a simple model of a typical graphics system.
➢Describe three major coordinate systems in the graphics
➢What are the major components of a graphics pipeline
and how do they interact?
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com