16.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 16 – Some Special Rendering Effects.

Slides:



Advertisements
Similar presentations
1 Vorlesung Informatik 2 Algorithmen und Datenstrukturen (Parallel Algorithms) Robin Pomplun.
Advertisements

Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Chapter 1 The Study of Body Function Image PowerPoint
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
UNITED NATIONS Shipment Details Report – January 2006.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Multiplying binomials You will have 20 seconds to answer each of the following multiplication problems. If you get hung up, go to the next problem when.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Polygon Scan Conversion – 11b
1 Discreteness and the Welfare Cost of Labour Supply Tax Distortions Keshab Bhattarai University of Hull and John Whalley Universities of Warwick and Western.
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.
7.1 Vis_04 Data Visualization Lecture 7 3D Scalar Visualization Part 2 : Volume Rendering- Introduction.
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 18 Image-based Rendering Final Review of Rendering What We Did Not Cover Learning More...
GR2 Advanced Computer Graphics AGR
GR2 Advanced Computer Graphics AGR
GR2 Advanced Computer Graphics AGR
15.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 15 – Visible Surfaces and Shadows.
SI23 Introduction to Computer Graphics
SI23 Introduction to Computer Graphics
GR2 Advanced Computer Graphics AGR
7.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 7 Polygon Shading Techniques.
5.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 5 A Simple Reflection Model.
9.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.
SI31 Advanced Computer Graphics AGR
8.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 8 Polygon Rendering.
13.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 13 An Introduction to Ray Tracing.
Excel Functions. Part 1. Introduction 2 An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the.
Solve Multi-step Equations
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
EU market situation for eggs and poultry Management Committee 20 October 2011.
2 |SharePoint Saturday New York City
VOORBLAD.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
Computer Graphics An Introduction. What’s this course all about? 05/10/2014 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
1 05/10/2014 Computer Graphics Lecture 10 Global Illumination 1: Ray Tracing and Radiosity Taku Komura.
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
© 2012 National Heart Foundation of Australia. Slide 2.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Model and Relationships 6 M 1 M M M M M M M M M M M M M M M M
25 seconds left…...
Technische Universität München Fakultät für Informatik Computer Graphics SS 2014 Sampling Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Analyzing Genes and Genomes
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Energy Generation in Mitochondria and Chlorplasts
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 12 Solid Textures Bump Mapping Environment Mapping.
18.1 Si31_2001 SI31 Advanced Computer Graphics AGR Lecture 18 Image-based Rendering Light Maps What We Did Not Cover Learning More...
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Local Illumination and Shading
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
3D Graphics Rendering PPT By Ricardo Veguilla.
So Far We have assumed that we know: The point The surface normal
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

16.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 16 – Some Special Rendering Effects

16.2 Si23_03 Where were we…? n Phong reflection model tells us how light reflects from surfaces…

16.3 Si23_03 Phong Reflection Model light source N L R V eye surface I( ) = K a ( )I a ( ) + ( K d ( )( L. N ) + K s ( R. V ) n ) I*( ) / dist In practice, we evaluate I RED, I GREEN, I BLUE for red, green, blue intensities: I RED = K a RED I a RED + ( K d RED ( L. N ) + K s ( R. V ) n ) I* RED /dist dist = distance attenuation factor

16.4 Si23_03 Interpolated Shading n Polygons can be efficiently shaded using: – Flat shading – Gouraud shading – Phong shading n Visible surfaces are determined using the z-buffer algorithm flat Gouraud Phong

16.5 Si23_03 Flat, Gouraud and Phong Shading

16.6 Si23_03 Phong versus Gouraud Shading n A major advantage of Phong shading over Gouraud is that specular highlights tend to be much more accurate – vertex highlight is much sharper – a highlight can occur within a polygon n Also Mach banding greatly reduced n The cost is a substantial increase in processing time because reflection model applied per pixel n OpenGL only supports Gouraud shading

16.7 Si23_03 Adding Realism Through Texture Effects

16.8 Si23_03 Adding Realism plastic floating in air n Objects rendered using Phong reflection model and Gouraud or Phong interpolated shading often appear rather plastic and floating in air exture n Texture effects can be added to give more realistic looking surface appearance – Simple texture – Bumps – Light maps

16.9 Si23_03 Adding Surface Detail n The most obvious solution is not the best – breaking the scene into smaller and smaller polygonal objects increases the detail –..BUT it is very hard to model and very time-consuming to render n Preferred solution is texture mapping painted – typically a 2D image painted onto objects

16.10 Si23_03 A Simple Example n Suppose we have a 2D image... n.. and a 3D box n.. we can paint the image on a face of the box

16.11 Si23_03 … or a teapot

16.12 Si23_03 Basic Concept n Replace the shading calculation with a look-up into a texture map (ie 2D image) to get the colour of a pixel n May replace shaded value - or modulate it in some way

16.13 Si23_03 Question n We could apply the texture in screen space (ie after projection) n... or we could apply it in object space (ie before projection) n Which is more sensible?

16.14 Si23_03 Texture Mapping - Overview screen space I J object space during scan conversion of each polygon, find corresponding position of pixel on object texture space V U X Y Z paint texture on to object

16.15 Si23_03 Mapping Texture to Polygons n For polygon texture mapping, we explicitly define the (u,v) co- ordinates of the polygon vertices n That is, we pin the texture at the vertices n We interpolate within the triangle at the time of scan converting into screen space X Z Y object texture space V U

16.16 Si23_03 Texture Mapping Triangles (x 1,y 1,z 1 ) (x 2,y 2,z 2 ) (x 3,y 3,z 3 ) (u 1,v 1 ) (u 2,v 2 ) (u 3,v 3 ) (i 1,j 1 ) (i 2,j 2 ) (i 3,j 3 ) Interpolation is done during scan conversion, similar as is done for Gouraud interpolated shading But rather than interpolate to get RGB values, we get (u,v) values which point to elements of texture map.

16.17 Si23_03 Interpolation in Texture Space n The interpolation in texture space has to be done carefully n Equal steps in screen space do not correspond to equal steps in object space (and hence texture space) n Why? U V I J screen texture A line is a line in all 3 spaces X Z Y object

16.18 Si23_03 Interpolation in Texture Space n The rate of change in texture space will depend on the depth of the points from the viewer n Correct approach is to scale by the distance (z P, z Q ) of the points from the viewer U V texture I J screen P Q P Q If Q further away than P, then as we take equal steps from P towards Q, we want to take increasingly large steps in (U,V) space from P to Q.

16.19 Si23_03 Interpolation in Texture Space n Suppose (u P, v P ) and (u Q,v Q ) are texture co-ords at end-points P, Q n Linear interpolation would be: – u = u Q + (1- )u P with increasing from 0 to 1 (similarly for v) n Correct texture interpolation is: u = [ u Q / z Q + (1- )u P / z P ] / D where D = [ / z Q + (1- )/ z P ] U V texture P Q I J screen P Q Note: this is equivalent to a linear interpolation in projective space

16.20 Si23_03 Check for Yourself n Suppose P is one unit from viewer, and Q is two units from viewer n Show that the mid- point in screen space is equivalent to one-third of the distance along the line in texture space

16.21 Si23_03 Summing Up n We have seen how a 2D texture image can be mapped to an object, at the rendering stage – for a polygon, we pin texture to vertices and interpolate (correctly!) at scan conversion time modify n The texture value is used to modify the colour that would otherwise be drawn – options include replacing completely, or modulating (eg by multiplying shaded value with texture value)

16.22 Si23_03 Bump Mapping

16.23 Si23_03 Bump Mapping n This is another texturing technique n Aims to simulate a dimpled or wrinkled surface – for example, surface of an orange trick n Like Gouraud and Phong shading, it is a trick – surface stays the same – but the true normal is perturbed, or jittered, to give the illusion of surface bumps

16.24 Si23_03 Bump Mapping

16.25 Si23_03 How Does It Work? n Looking at it in 1D: original surface P(u) bump map b(u) add b(u) to P(u) in surface normal direction, N(u) new surface normal N(u) for reflection model

16.26 Si23_03 Bump Mapping A Bump Map

16.27 Si23_03 Bump Mapping Resulting Image

16.28 Si23_03 Bump Mapping - Another Example

16.29 Si23_03 Bump Mapping Another Example

16.30 Si23_03 Bump Mapping Procedurally Defined Bump Map

16.31 Si23_03 Another pioneer n Jim Blinn – Creator of bump mapping and many other graphics effects

16.32 Si23_03 Light Maps

16.33 Si23_03 The Problem with Gouraud…. n Gouraud shading is established technique for rendering but has well known limitations – Vertex lighting only works well for small polygons… – … but we dont want lots of polygons!

16.34 Si23_03 Pre-Compute the Lighting n Solution is to pre- compute some canonical light effects as texture maps n For example…

16.35 Si23_03 Rendering using Light Maps n Suppose we want to show effect of a wall light – Create wall as a single polygon – Apply vertex lighting – Apply texture map – In a second rendering pass, apply light map to the wall

16.36 Si23_03 Light Maps n Widely used in games industry n Latest graphics cards will allow multiple texture maps per pixel