9.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.

Slides:



Advertisements
Similar presentations
You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Advertisements

Visible-Surface Detection(identification)
Advanced Piloting Cruise Plot.
Chapter 1 The Study of Body Function Image PowerPoint
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
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.
Addition Facts
Points, Vectors, Lines, Spheres and Matrices
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 17 Radiosity - Conclusion Non-PhotoRealistic Rendering.
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 2 Basic Modelling.
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.
1GR2-00 GR2 Advanced Computer Graphics AGR Ken Brodlie Lecture 1 - Overview.
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
Visualization Techniques -
GR2 Advanced Computer Graphics AGR
15.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 15 – Visible Surfaces and Shadows.
GR2 Advanced Computer Graphics AGR
SI23 Introduction to Computer Graphics
SI23 Introduction to Computer Graphics
SI23 Introduction to Computer Graphics
GR2 Advanced Computer Graphics AGR
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 16 Radiosity - continued.
16.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 16 – Some Special Rendering Effects.
7.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 7 Polygon Shading Techniques.
1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie Lecture 1 - Overview.
SI31 Advanced Computer Graphics AGR
5.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 5 A Simple Reflection Model.
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.
7 Applications of Integration
ABC Technology Project
VOORBLAD.
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.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
Using AVS/Express in an Introductory Computer Graphics Course.
Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 4 View Projection Taku Komura.
Lecture 8 Transparency, Mirroring
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
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.
Week 1.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
A SMALL TRUTH TO MAKE LIFE 100%
PSSA Preparation.
Copyright © Cengage Learning. All rights reserved.
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.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
Computer Graphics Texture Mapping
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
So Far We have assumed that we know: The point The surface normal
GR2 Advanced Computer Graphics AGR
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics Material Colours and Lighting
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

9.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture

9.2si31_2001 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 plant n Addition of shadows (Lect 8) helps to plant the objects on a ground surface texture n In this lecture we look at how texture effects can be added to give more realistic looking surface appearance

9.3si31_2001 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

9.4si31_2001 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

9.5si31_2001 … or a teapot

9.6si31_2001 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

9.7si31_2001 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?

9.8si31_2001 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

9.9si31_2001 Texture Mapping : Mapping Textures to Objects n We need to establish a mapping from object space (x,y,z) to texture space (u,v) – mapping functions u=f u (x,y,z) and v=f v (x,y,z) – given a point (x,y,z) on object, these functions give us a position (u,v) in texture space object space texture space V U X Y Z paint texture on to object

9.10si31_2001 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

9.11si31_2001 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.

9.12si31_2001 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

9.13si31_2001 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.

9.14si31_2001 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

9.15si31_2001 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

9.16si31_2001 Texture Mapping to an Object n How do we map to an entire object - rather than a polygon? n That is, how do we sensibly assign the texture co-ordinates to the polygon vertices? object space texture space V U X Y Z paint texture on to object

9.17si31_2001 Mapping Texture To Object n This is achieved in two stages: simple n first: map texture to a simple bounding shape n second: project from bounding shape onto object itself texture space object space V U X Y Z

9.18si31_2001 Mapping to a Cylinder n A simple bounding object for our bowl is a cylinder n We can wrap the texture around the cylinder as follows: – cylinder radius r, centre origin, has equation x = r cos, y = r sin, z – to wrap texture on to cylinder, we use the mapping functions u = = tan -1 (y/x) v = z

9.19si31_2001 Shrinkwrap n We now need to project from the bounding cylinder to the object shrinkwrapping n A common approach is shrinkwrapping n For an object position (x,y,z), we take the texture of the point (x,y,z) on the bounding cylinder whose normal points at (x,y,z) bounding cylinder 2d cross- section

9.20si31_2001 Intermediate Bounding Surfaces n Other possible intermediate surfaces are: – box, sphere, plane n A simple default action is to calculate bounding box of object, map texture to box, and project from box to object

9.21si31_2001 Texture Mapping n This gives us a way of assigning the texture co-ordinates to the polygon vertices n We can then use the texture interpolation at scan conversion time object space texture space V U X Y Z

9.22si31_2001 Planar Texture Mapping

9.23si31_2001 Cylindrical Texture Mapping

9.24si31_2001 Spherical Texture Mapping

9.25si31_2001 Texture Extent n It is often useful to think of texture space having infinite extent n This can be achieved by replicating the image in texture space V U

9.26si31_2001 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 – assigning texture co-ordinates can be by intermediate mapping 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)

9.27si31_2001 Acknowledgements n Thanks to Alan Watt for the images again