Introduc)on to Computer Graphics 4/11/13
Introduc)on to Computer Graphics
4/11/13
Agenda
• Mo)va)on / Applica)ons • Graphics Pipeline • Shading & Aliasing • Other interes)ng topics • Conclusion
4/11/13 2
Computer Graphics is about anima)on (films)
4/11/13 3
Major driving force now
Games are very important in Computer Graphics
4/11/13 4
Medical Imaging is another driving force
4/11/13 5
Computer Aided Design
4/11/13 6
Scien)fic Visualisa)on
4/11/13 7
To view below and above our visual range
Graphics / Rendering Pipeline • Graphics processes generally execute sequen)ally
• Pipelining the process means dividing it into stages
• Especially when rendering in real-‐)me, different hardware resources are assigned for each stage
4/11/13 8
Graphics / Rendering Pipeline • There are three stages
– Applica)on Stage – Geometry Stage – Rasteriza)on Stage
4/11/13 9
Applica)on stage • En)rely done in soPware by the CPU • Read Data
– the world geometry database, – User’s input by mice, trackballs, trackers, or sensing gloves
• In response to the user’s input, the applica)on stage change the view or scene
4/11/13 10
Geometry Stage
4/11/13 11
Model Transformation
Modeling: shapes
Shading: reflection and lighting
Transformation: viewing
Hidden Surface Elimination Rasterization Stage
An example through the pipeline…
4/11/13 12
The scene we are trying to represent:
Images courtesy of Picture Inc.
Preparing Shape Models
4/11/13 13
Designed by polygons, parametric curves/surfaces, implicit surfaces and etc.
Defined in its own coordinate system
Model Transforma)on
4/11/13 14
l Objects put into the scene by applying translation, scaling and rotation
l Linear transformation called homogeneous transformation is used
l The location of all the vertices are updated by this transformation
Perspec)ve Projec)on
4/11/13 15
l We want to create a picture of the scene viewed from the camera
l We apply a perspective transformation to convert the 3D coordinates to 2D coordinates of the screen
l Objects far away appear smaller, closer objects appear bigger
Hidden Surface Removal
4/11/13 16
l Objects occluded by other objects must not be drawn
Shading
4/11/13 17
l Now we need to decide the colour of each pixels taking into account the object’s colour, lighting condition and the camera position
Object
point light source
Shading : Constant Shading -‐ Ambient
4/11/13 18
l Objects colours by its own colour
Shading – Flat Shading
4/11/13 19
l Objects coloured based on its own colour and the lighting condition
l One colour for one face
Gouraud shading, no specular highlights
4/11/13 20
l Lighting calculation per vertex
Shapes by Polynomial Surfaces
4/11/13 21
Specular highlights added
4/11/13 22
l Light perfectly reflected in a mirror-like way
Phong shading
4/11/13 23
Rasteriza)on Stage
4/11/13 24
Rasterization and Sampling
Texture Mapping
Image Composition
Intensity and Color Quantization
Geometry Stage
Framebuffer/Display
Rasteriza)on • Converts the vertex informa)on output by the geometry pipeline into pixel informa)on needed by the video display
• Aliasing: distor)on ar)facts produced when represen)ng a high-‐resolu)on signal at a lower resolu)on.
• An)-‐aliasing : technique to remove aliasing
4/11/13 25
An)-‐aliasing
4/11/13 26
Aliased polygons (jagged edges) Anti-aliased polygons
4/11/13 27
ü How is anti-aliasing done? Each pixel is subdivided (sub-sampled) in n regions, and each sub-pixel has a color; ü Compute the average color value
Texture mapping
4/11/13 28
Other topics: Reflec)ons, shadows & Bump mapping
4/11/13 29
Other topics: Global Illumina)on
4/11/13 30
Conclusion
• Wide range of applica)ons • Op)mized in hardware • Classic approach gives good results • Open Research Topics
– Photorealism – Constrained devices – Real-‐)me
Ques)ons
?