MIT EECS 6.837, Durand and Cutler Texture Mapping & Other Fun Stuff.

Slides:



Advertisements
Similar presentations
Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler.
Advertisements

Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Cs123 INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © Andries van Dam Texture Mapping Beautification of Surfaces 1/23.
MIT EECS 6.837, Durand and Cutler Sampling, Aliasing, & Mipmaps.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
Computer Graphics Bing-Yu Chen National Taiwan University.
Texture Visual detail without geometry. Texture Mapping desire for heightened realism.
COMPUTER GRAPHICS CS 482 – FALL 2014 OCTOBER 6, 2014 TEXTURE MAPPING TEXTURES BUMP MAPPING ENVIRONMENT MAPPING PROCEDURAL TEXTURING.
MIT EECS 6.837, Durand and Cutler Curves & Surfaces.
MIT EECS 6.837, Durand and Cutler Curves & Surfaces.
Illumination Model & Surface-rendering Method 박 경 와.
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
HCI 530 – Seminar in Advanced Topics 10/8/2004Damian Schofield1 Texturing Based on 3D Rendering, Humphreys, G., University of Virginia, 2004.
Computer Graphics (Spring 2008) COMS 4160, Lecture 19: Texture Mapping Many slides from Greg Humphreys, UVA and Rosalee.
(conventional Cartesian reference system)
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
Texture Mapping April 9, The Limits of Geometric Modeling Although graphics cards can render over 10 million polygons per second, that number.
University of New Mexico
Texture Mapping Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008.
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.
Texture Mapping. 2 The Limits of Geometric Modeling Although graphics cards can render over 10 million polygons per second, that number is insufficient.
Computer Graphics Inf4/MSc Computer Graphics Lecture 7 Texture Mapping, Bump-mapping, Transparency.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Lecture 15Slide Fall 2002 Texture Mapping Why texture map? How to do it How to do it right Spilling the beans A couple tricks Difficulties with.
Today More raytracing stuff –Soft shadows and anti-aliasing More rendering methods –The text book is good on this –I’ll be using images from the CDROM.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Lecture 21Slide Fall 2001 Texture-Mapping Tricks Combining Textures Filtering Textures Textures and Shading Bump Mapping Solid Textures.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
MIT EECS 6.837, Durand and Cutler Real-Time Shadows.
I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam October 30, 2003 Shading 1/35 CIS 736 Computer Graphics Lecture 17 of 42 Illumination.
MIT EECS 6.837, Durand and Cutler Acceleration Data Structures for Ray Tracing.
1 Texture Mapping. 2 Texture Aliasing MIPmaps Environment Mapping Bump Mapping Displacement Mapping Shadow Maps Solid Textures Antialiasing.
Computing & Information Sciences Kansas State University Lecture 10 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations.
Advanced topics Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2006/01/04 with slides by Brian Curless, Zoran Popovic, Mario Costa Sousa.
MIT EECS 6.837, Durand and Cutler Texture Mapping & Other Fun Stuff.
MIT EECS 6.837, Durand and Cutler Acceleration Data Structures for Ray Tracing.
Ray Tracing Optimizations
RENDERING : Global Illumination
Ray Tracing Acceleration (5). Ray Tracing Acceleration Techniques Too Slow! Uniform grids Spatial hierarchies K-D Octtree BSP Hierarchical grids Hierarchical.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Texture Mapping Greg Humphreys University of Virginia CS 445, Fall 2003.
Texturing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.

University of New Mexico
Buffers and texture mapping
Texture Mapping.
Computer Graphics Texture Mapping
CSE 167 [Win 17], Lecture 18: Texture Mapping Ravi Ramamoorthi
Texture Mapping COMP575/COMP770.
So Far We have assumed that we know: The point The surface normal
© University of Wisconsin, CS559 Fall 2004
(c) 2002 University of Wisconsin
CS5500 Computer Graphics May 29, 2006
Texture Mapping Ed Angel Professor Emeritus of Computer Science
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

MIT EECS 6.837, Durand and Cutler Texture Mapping & Other Fun Stuff

MIT EECS 6.837, Durand and Cutler Last Time? Distribution Ray Tracing Bounding Boxes Spatial Acceleration Data Structures –Regular Grid –Adaptive Grids –Hierarchical Bounding Volumes Flattening the Transformation Hierarchy

MIT EECS 6.837, Durand and Cutler Regular Grid Discussion Advantages? –easy to construct –easy to traverse Disadvantages? –may be only sparsely filled –geometry may still be clumped

MIT EECS 6.837, Durand and Cutler Adaptive Grids Nested GridsOctree/(Quadtree) Subdivide until each cell contains no more than n elements, or maximum depth d is reached

MIT EECS 6.837, Durand and Cutler Primitives in an Adaptive Grid Can live at intermediate levels, or be pushed to lowest level of grid Octree/(Quadtree)

MIT EECS 6.837, Durand and Cutler Adaptive Grid Discussion Advantages? –grid complexity matches geometric density Disadvantages? –more expensive to traverse (especially octree)

MIT EECS 6.837, Durand and Cutler Bounding Volume Hierarchy Find bounding box of objects Split objects into two groups Recurse

MIT EECS 6.837, Durand and Cutler Bounding Volume Hierarchy Find bounding box of objects Split objects into two groups Recurse

MIT EECS 6.837, Durand and Cutler Bounding Volume Hierarchy Find bounding box of objects Split objects into two groups Recurse

MIT EECS 6.837, Durand and Cutler Bounding Volume Hierarchy Find bounding box of objects Split objects into two groups Recurse

MIT EECS 6.837, Durand and Cutler Bounding Volume Hierarchy Find bounding box of objects Split objects into two groups Recurse

MIT EECS 6.837, Durand and Cutler Where to split objects? At midpoint OR Sort, and put half of the objects on each side OR Use modeling hierarchy

MIT EECS 6.837, Durand and Cutler Intersection with BVH Check sub-volume with closer intersection first

MIT EECS 6.837, Durand and Cutler Intersection with BVH Don't return intersection immediately if the other subvolume may have a closer intersection

MIT EECS 6.837, Durand and Cutler Bounding Volume Hierarchy Discussion Advantages –easy to construct –easy to traverse –binary Disadvantages –may be difficult to choose a good split for a node –poor split may result in minimal spatial pruning

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Today 2D Texture Mapping –Perspective Correct Interpolation –Specifying Texture Coordinates –Illumination & Reflectance Procedural Solid Textures Other Mapping Techniques Texture Aliasing

MIT EECS 6.837, Durand and Cutler The Problem: We don't want to represent all this detail with geometry

MIT EECS 6.837, Durand and Cutler The Quest for Visual Realism

MIT EECS 6.837, Durand and Cutler Texture Mapping Increase the apparent complexity of simple geometry Like wallpapering or gift-wrapping with stretchy paper Curved surfaces require extra stretching or even cutting

MIT EECS 6.837, Durand and Cutler Photo-textures

MIT EECS 6.837, Durand and Cutler Texture Tiling Specify a texture coordinate (u,v) at each vertex Canonical texture coordinates (0,0) → (1,1) seamless tiling (repeating)tiles with visible seams (0,0)(3,0) (0,3) (0,0)(3,0) (0,3) (0,0) (1,1) (0,0) (1,1)

MIT EECS 6.837, Durand and Cutler Texture Interpolation Specify a texture coordinate (u,v) at each vertex Can we just linearly interpolate the values in screen space? (0,0)(1,0) (0,1)

MIT EECS 6.837, Durand and Cutler Interpolation - What Goes Wrong? texture sourcewhat we getwhat we want Linear interpolation in screen space:

MIT EECS 6.837, Durand and Cutler Specify More Coordinates? We can reduce the perceived artifacts by subdividing the model into smaller triangles. However, sometimes the errors become obvious –At "T" joints –Between levels-of-detail (mipmapping... in a few weeks)

MIT EECS 6.837, Durand and Cutler Subdivision

MIT EECS 6.837, Durand and Cutler Subdivision texture sourcewhat we getwhat we want

MIT EECS 6.837, Durand and Cutler Visualizing the Problem Notice that uniform steps on the image plane do not correspond to uniform steps along the edge.

MIT EECS 6.837, Durand and Cutler Linear Interpolation in Screen Space linear interpolation in screen space interpolation in 3-space

MIT EECS 6.837, Durand and Cutler Perspective Correct Interpolation We need a mapping from t values to s values: Solve for s in terms of t: Unfortunately, at this point in the pipeline (after projection) we no longer have z. However, we do have w 1 = 1/z 1 and w 2 = 1/z 2, so:

MIT EECS 6.837, Durand and Cutler Today 2D Texture Mapping –Perspective Correct Interpolation –Specifying Texture Coordinates –Illumination & Reflectance Procedural Solid Textures Other Mapping Techniques Texture Aliasing

MIT EECS 6.837, Durand and Cutler Texture Mapping Difficulties Tedious to specify texture coordinates Acquiring textures is surprisingly difficult –Photographs have projective distortions –Variations in reflectance and illumination –Tiling problems

MIT EECS 6.837, Durand and Cutler Common Texture Coordinate Mappings Orthogonal Cylindrical Spherical Perspective Projection Texture Chart

MIT EECS 6.837, Durand and Cutler Projective Textures Use the texture like a slide projector No need to specify texture coordinates explicitly A good model for shading variations due to illumination A fair model for reflectance (can use pictures)

MIT EECS 6.837, Durand and Cutler Projective Texture Example Modeling from photographs Using input photos as textures Figure from Debevec, Taylor & Malik

MIT EECS 6.837, Durand and Cutler Texture Mapping & Illumination Texture mapping can be used to alter some or all of the constants in the illumination equation: –pixel color, diffuse color, alter the normal, …. Phong's Illumination Model Constant Diffuse ColorDiffuse Texture Color Texture used as LabelTexture used as Diffuse Color

MIT EECS 6.837, Durand and Cutler Texture Chart Pack triangles into a single image

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Today 2D Texture Mapping Procedural Solid Textures Other Mapping Techniques Texture Aliasing

MIT EECS 6.837, Durand and Cutler Procedural Textures Image by Turner Whitted f (x,y,z) → color

MIT EECS 6.837, Durand and Cutler Advantages: –easy to implement in ray tracer –more compact than texture maps (especially for solid textures) –infinite resolution Disadvantages –non-intuitive –difficult to match existing texture Procedural Textures

MIT EECS 6.837, Durand and Cutler Questions? Ken Perlin Justin Legakis

MIT EECS 6.837, Durand and Cutler Today 2D Texture Mapping Procedural Solid Textures Other Mapping Techniques: –Bump Mapping –Displacement Mapping –Environment Mapping (for Reflections) –Light Maps (for Illumination) Texture Aliasing

MIT EECS 6.837, Durand and Cutler What's Missing? What's the difference between a real brick wall and a photograph of the wall texture-mapped onto a plane? What happens if we change the lighting or the camera position?

MIT EECS 6.837, Durand and Cutler Remember Gouraud Shading? Instead of shading with the normal of the triangle, shade the vertices with the average normal and interpolate the color across each face Illusion of a smooth surface with smoothly varying normals

MIT EECS 6.837, Durand and Cutler Phong Normal Interpolation Interpolate the average vertex normals across the face and compute per-pixel shading (Not Phong Shading) Must be renormalized

MIT EECS 6.837, Durand and Cutler Bump Mapping Use textures to alter the surface normal –Does not change the actual shape of the surface –Just shaded as if it were a different shape Sphere w/Diffuse Texture Swirly Bump MapSphere w/Diffuse Texture & Bump Map

MIT EECS 6.837, Durand and Cutler Bump Mapping Treat the texture as a single-valued height function Compute the normal from the partial derivatives in the texture

MIT EECS 6.837, Durand and Cutler Another Bump Map Example Cylinder w/Diffuse Texture Map Bump Map Cylinder w/Texture Map & Bump Map

MIT EECS 6.837, Durand and Cutler What's Missing? There are no bumps on the silhouette of a bump-mapped object Bump maps don’t allow self-occlusion or self-shadowing

MIT EECS 6.837, Durand and Cutler Displacement Mapping Use the texture map to actually move the surface point The geometry must be displaced before visibility is determined

MIT EECS 6.837, Durand and Cutler Displacement Mapping Image from: Geometry Caching for Ray-Tracing Displacement Maps by Matt Pharr and Pat Hanrahan. note the detailed shadows cast by the stones

MIT EECS 6.837, Durand and Cutler Ken Musgrave Displacement Mapping

MIT EECS 6.837, Durand and Cutler Today 2D Texture Mapping Procedural Solid Textures Other Mapping Techniques: –Projective Shadows and Shadow Maps –Bump Mapping –Displacement Mapping –Environment Mapping (for Reflections) –Light Maps (for Illumination) Texture Aliasing

MIT EECS 6.837, Durand and Cutler Environment Maps We can simulate reflections by using the direction of the reflected ray to index a spherical texture map at "infinity". Assumes that all reflected rays begin from the same point.

MIT EECS 6.837, Durand and Cutler What's the Best Chart?

MIT EECS 6.837, Durand and Cutler Environment Mapping Example Terminator II

MIT EECS 6.837, Durand and Cutler Texture Maps for Illumination Quake Also called "Light Maps"

MIT EECS 6.837, Durand and Cutler Questions? Image by Henrik Wann Jensen Environment map by Paul Debevec

MIT EECS 6.837, Durand and Cutler Today 2D Texture Mapping Procedural Solid Textures Other Mapping Techniques: Texture Aliasing

MIT EECS 6.837, Durand and Cutler Textures can Alias Aliasing is the under-sampling of a signal, and it's especially noticeable during animation nearest neighbor mipmaps & linear interpolation

MIT EECS 6.837, Durand and Cutler Textures can Alias Small details may "pop" in and out of view nearest neighbormipmaps & linear interpolation

MIT EECS 6.837, Durand and Cutler Next Time: Real-Time Shadows