Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.

Slides:



Advertisements
Similar presentations
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.
Advertisements

16.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 16 – Some Special Rendering Effects.
9.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
03/16/2009Dinesh Manocha, COMP770 Texturing Surface’s texture: its look & feel Graphics: a process that takes a surface and modifies its appearance using.
3D Graphics Rendering and Terrain Modeling
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.
 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Sep 21, Fall 2005ITCS4010/ Computer Graphics Overview Color Displays Drawing Pipeline.
X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that.
Materials in OpenGL A material is defined by ρ a, ρ s, ρ d, and f for each of the R, G, B components. –Fig contains a table of coefficients for various.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping.
Sep 21, Fall 2006IAT 4101 Computer Graphics Overview Color Displays Drawing Pipeline.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
©Larry F. Hodges (modified by Amos Johnson) 1 Shading Models.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Texture Mapping A way of adding surface details Two ways can achieve the goal:  Surface detail polygons: create extra polygons to model object details.
SET09115 Intro Graphics Programming
Fundamentals of Computer Graphics Part 6 Shading prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
CS 445 / 645 Introduction to Computer Graphics Lecture 18 Shading Shading.
COMP 261 Lecture 14 3D Graphics 2 of 2. Doing better than 3x3? Translation, scaling, rotation are different. Awkward to combine them. Use homogeneous.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
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.
19/17/ :25 UML Graphics: Conceptual Model Real Object Human Eye Display Device Graphics System Synthetic Model Synthetic Camera Real Light Synthetic.
ECSE 4750: Computer Graphics Rensselaer Polytechnic Institute Nov 5, 2012 Texture and Texture Mapping.
1 Texture Mapping ©Anthony Steed Overview n Texture mapping Inverse and Forward Mapping Bilinear interpolation Perspective correction n Mipmapping.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Textures Repeated patterns Texture can be uniform or irregular Ex:fabric,soil,brick Surface finish also known as surface texture T = P 1 * V 1 * V c T=
Game Programming 06 The Rendering Engine
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Komputer Grafik 2 (AK045206) Shading 1/17 Realisme : Shading.
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.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
2 3D Viewing Process  3D viewing process MC Model Space Model Transformation Model Transformation WC World Space Viewing Transformation Viewing Transformation.
Schedule Update GP 4 – Tesselation/Cg GDS 4 – Subdiv Surf. GP 5 – Object Modeling Lab: Mini-proj Setup GDS 5 – Maya Modeling MCG 6 – Intersections GP 6.
CS 376 Introduction to Computer Graphics 04 / 13 / 2007 Instructor: Michael Eckmann.
Computer Graphics Overview
Computer Graphics Chapter 9 Rendering.
ATEC Procedural Animation
ATCM 3310 Procedural Animation
3D Graphics Rendering PPT By Ricardo Veguilla.
So Far We have assumed that we know: The point The surface normal
Chapter 14 Shading Models.
CSC461: Lecture 23 Shading Computation
Procedural Animation Lecture 6: Mapping
ATCM 6317 Procedural Animation
Illumination and Shading
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics (Fall 2003)
Chapter 14 Shading Models.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Simple Texture Mapping
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Texture Mapping Jung Lee.
Presentation transcript:

Virtual Realism TEXTURE MAPPING

The Quest for Visual Realism

Why Texture Map? So far we have done flat shading and Gouraud/Phong shading Not good to represent everything in real world What are some of our other options? Represent everything with tiny polygons Geometry would get complicated very quickly Apply textures across the polygons This allows for less geometry but the image looks almost as good

Basic Concept Textures are almost always rectangular array of pixels called texels (texture elements) Pasting an image onto a model An image is mapped onto the 2D domain of a 3D model

Texture Coordinates A texture is usually addressed by two numbers (s, t) s and t takes values in [0,1] A vertex can be associated with a point on the texture by giving it one of these texture coordinates glTexCoord*(s,t); glVertex*(x,y,z); s t [0,0] [1, 0] [0, 1]

Example Texture Map

Types of Textures Bitmap textures Bitmapped representation of images Represented by an array Color3 texture(float s, float t){ Return txtr[(int)(s*c),(int)(t*r)] } Procedural textures Defined by a mathematical function In either case, we have a ‘texture function’ texture(s,t)

Texture Mapping Problem Texture spaceWorld spaceScreen space (sx,sy)=T ws (T tw (s*,t*))

Mapping Textures on Flat Surfaces Associate points on texture with points on the polygonal face –OpenGL uses the function glTexCoord*() sets the current texture coordinates

Rendering Textures on Flat Surfaces Similar to Gouraud shading Consider the current scan line y s For each x s, compute the correct position P on the face From that, obtain the correct texture coordinate (s,t) x right ysys y top y bott x left (s 0,t 0 ) (s 3,t 3 ) (s 1,t 1 ) (s 2,t 2 ) xsxs

Caveat Linear interpolation does not work always! This is because… Equal steps across a projected space do not corresponds to equal steps across the 3D space

Visualizing the Problem Notice that uniform steps on the image plane do not correspond to uniform steps along the edge.

An Example

Proper Interpolation If we move in equal steps across L s on the screen, how should we step across texels along L t in texture space? Texture spaceEye spaceScreen space

Proper Interpolation R(g) = lerp(A,B,g) r(f)=lerp(a,b,f), a = (a1, a2, a3, a4) or ( a1/a4, a2/a4, a3/a4) r1(f) = lerp(a1/a4, b1/b4, f) A B R(g) M a b r(f) R(g) = lerp(A,B,g) In homogenous coordinate [R(g),1] t = [lerp(A,B,g),1] t After perspective transformation M([lerp(A,B,g),1] t ) = lerp( M(A,1) t, M(B,1) t, g ) =[ lerp( a1, b1, g ), lerp( a2, b2, g), lerp(a3, b3, g), lerp( a4, b4, g) ] r1(f ) = lerp(a1,b1,g)/lerp(a4,b4,g)

Proper Interpolation r1(f) = lerp(a1/a4, b1/b4, f) r1(f ) = lerp(a1,b1,g)/lerp(a4,b4,g) g = f / lerp((b4/a4), 1, f) R(g) = A(1-g) + Bg = lerp(A1/a4, B1/b4, f) / lerp( 1/a4, 1/b4, f)

Proper Interpolation a cooresponds to A which maps to texture (Sa, Ta) b corresponds to B which maps to texture ( Sb, Tb) left = lerp(a,b,f) s left(y) =lerp(S A /a4, S B /b4, f) / lerp( 1/a4, 1/b4, f) Similar for t left(y) and right pixel Similar hyperbolic interpolation for intermediate pixels a b a’ b’ y left right

Texture Maps and Visual Realism Three different visual effects: 1. Glowing objects – Intensity is set equal to the texture value: I = texture(s,t) – Object appears to emit light or glow – Color can be added by considering the red, green and blue components separately 2. Modulate reflection coefficients – Make texture appear to be painted on the surface – Change the reflection coefficients at each point by: 3. Bump mapping – Model the roughness of the surface

Bump Mapping

Use texture map to perturb surface normal Use texture array to set a function which perturbs surface normal Apply illumination model using perturbed normal

Bump Mapping The ‘perturbed’ surface becomes: One approximation to new normal m´(u,v) is: where d is:

Bump Mapping The ‘perturbed’ surface becomes: To find the new normal m´(u,v) –Find two vectors tangent to the bumpy surface, then m´(u,v) is their cross product –The two vectors follow from the partial derivatives of the P´(u,v) equation wrt u,v

Wrapping Texture on Curved Surfaces Wrap a label around a cylinder Wrap a label onto a sphere

References Hill – 8.5.3, 8.5.5