cs 184 computer graphics
play

CS-184: Computer Graphics Lecture #11: Texture and Other Maps - PowerPoint PPT Presentation

1 CS-184: Computer Graphics Lecture #11: Texture and Other Maps Prof. James OBrien University of California, Berkeley V2015-S-11-1.0 2 Today Texture Mapping 2D 3D Procedural Bump and Displacement Maps Environment


  1. 1 CS-184: Computer Graphics Lecture #11: Texture and Other Maps Prof. James O’Brien University of California, Berkeley V2015-S-11-1.0 2 Today • Texture Mapping • 2D • 3D • Procedural • Bump and Displacement Maps • Environment Maps • Shadow Maps 2

  2. 3 Surface Detail • Representing all detail in an image with polygons would be cumbersome Specific details Structured noise Pattern w/ randomness Section through volume Bumps 3 4 2D Texture Mapping of Images • Use a 2D image and map it to the surface of an object Color Specular Bump 4

  3. 5 2D Texture Mapping of Images 5 6 2D Texture Mapping of Images 6

  4. 7 2D Texture Mapping of Images 7 8 2D Texture Mapping of Images 8

  5. 9 2D Texture Mapping of Images • Example of texture distortion 9 10 Texture Coordinates • Assign coordinates to each vertex • Within each triangle use linear interpolation • Correct for distortion! t s 10

  6. 11 MIP Map • Pre-compute filtered versions of the texture • A given UV rate is some level of the texture • Tri-linear filtering UV × map level 11 12 Procedural Textures • Generate texture based on some function • Well suited for “random” textures • Often modulate some noise function [Foley et al. / Perlin] 12

  7. 13 Assigning Texture Coordinates • Map a simple shape onto object by projection • Sphere, cylinder, plane, cube • Assign by hand • Use some optimization procedure 13 14 Repeating Textures • Image Tiles allow repeating textures • Images must be manipulated to allow tilling • Often result in visible artifacts • There are methods to get around artifacts.... 14

  8. 15 Repeating Textures • Image Tiles allow repeating textures • Images must be manipulated to allow tilling • Often result in visible artifacts • Artifacts not an issue for artificial textures 15 16 Non-Color Textures Color Specular Bump 16

  9. 17 Bump Mapping No bump mapping With bump mapping Images by Paul Baker www.paulsprojects.net 17 18 Bump Mapping • Add offset to normal • Offset is in texture coordinates S,T,N • Store normal offsets in RGB image components • Should use correctly orthonormal coordinate system • Normal offsets from gradient of a grayscale image b ( u , v ) = [ s , t , n ]( u , v ) = ∇ i ( u , v )  ∂ � T ∂ u , ∂ ∇ = ∂ v 18

  10. 19 Bump Map Example Catherine Bendebury and Jonathan Michaels CS 184 Spring 2005 19 20 Displacement Maps • Actually move geometry based on texture map • Expensive and difficult to implement in many rendering systems • Note silhouette Bump Displacement 20

  11. 21 Normals Maps [Paolo Cignoni] 21 22 Texture Coordinate Assignment [Wolfe / SG97 Slide set] 22

  12. 23 Texture Coordinate Assignment • Planar projection u Marschner, 2014 v 23 24 Texture Coordinate Assignment • Spherical Coordinates Marschner, 2014 24

  13. 25 Texture Coordinate Assignment • Spherical Projection Marschner, 2014 25 26 Texture Coordinate Assignment • Cylindrical Projection spherical cylindrical Marschner, 2014 26

  14. 27 Texture Coordinate Assignment • Multiple Projections [Tito Pagan] 27 28 Texture Coordinate Assignment • 3D Textures [Wolfe / SG97 Slide set] 28

  15. 29 Environment Maps • Environment maps allow crude reflections • Treat object as infinitesimal • Reflection only based on surface normal • Errors hard to notice for non-flat objects 29 30 Environment Maps 30

  16. 31 Environment Maps (u,v) = (1,1) z x = y= z u = y + x y 2 x x right face has x > |y|, x > |z| v v = z + x u 2 x (u,v) = (0,0) x = -y= -z 31 32 Environment Maps • Sphere based parameterization • Wide angle image or • Photo of a silver ball Images by Paul Haeberli 32

  17. 33 Environment Maps [Dror, Willsky, & Adelson 2004] (a) (b) Figure 2. (a). A shiny sphere rendered under photographically acquired real-world illumination. (b). The same sphere rendered under illumination by a point light source. 33 34 Environment Maps • Used in 1985 in movie Interface • Effect by group from the New York Institute of Technology Note errors 34

  18. 35 Environment Maps • Used in 1985 in movie Interface • Effect by group from the New York Institute of Technology 35 36 Shadow Maps • Pre-render scene from perspective of light source • Only render Z-Buffer (the shadow buffer) • Render scene from camera perspective • Compare with shadow buffer • If nearer light, if further shadow 36

  19. 37 Shadow Maps Shadow Buffer Image w/ Shadows From Stamminger and Drettakis SIGGRAPH 2002 Note: These images don’t really go together, see the paper... 37 38 Deep Shadow Maps • Some objects only partially occlude light • A single shadow value will not work • Similar to transparency in Z-Buffer From Lokovic and Veach SIGGRAPH 2000 38

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend