Texture mapping in computer graphics ppt

how to make a 3d texture and interactive computer graphics ppt
Dr.ShaneMatts Profile Pic
Dr.ShaneMatts,United States,Teacher
Published Date:23-07-2017
Your Website URL(Optional)
Comment
Texture Mapping & Shaders © Remedy Enterainment. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. MIT EECS 6.837 Computer Graphics 1 MIT EECS 6.837 – Matusik BRDF in Matrix II & III © ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 2 Spatial Variation • All materials seen so far are the same everywhere – In other words, we are assuming the BRDF is independent of the surface point x – No real reason to make that assumption Courtesy of Fredo Durand. Used with permission. © source unknown. All rights reserved. © ACM. All rights reserved. This content is excluded This content is excluded from our Creative from our Creative Commons license. For more Commons license. For more information, information, see http://ocw.mit.edu/help/faq-fair-use/. see http://ocw.mit.edu/help/faq-fair-use/. 3 Spatial Variation • We will allow BRDF parameters to vary over space – This will give us much more complex surface appearance – e.g. diffuse color k vary with x d – Other parameters/info can vary too: k , exponent, normal s © ACM. All rights reserved. This content is excluded © source unknown. All rights reserved. Courtesy of Fredo Durand. Used with permission. from our Creative Commons license. For more This content is excluded from our Creative information, see http://ocw.mit.edu/help/faq-fair-use/. Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 4 Two Approaches • From data : texture mapping – read color and other information from 2D images © ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. • Procedural : shader – write little programs that compute color/info as a function of location © Ken Perlin. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 5 Effect of Textures Courtesy of Jeremy Birn. 6 Texture Mapping Image of a cartoon of a man applying wall paper has been removed due to copyright restrictions. 7 Texture Mapping 3D model Texture mapped model ? © ACM. All rights reserved. This content is excluded from our Creative Commons © Oscar Meruvia-Pastor, Daniel Rypl. All rights reserved. This license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Image: Praun et al. 8 Texture Mapping Image: Praun et al. Texture We need a function mapped model that associates each surface point with a 2D coordinate in the texture map Texture map (2D image) © ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. © Oscar Meruvia-Pastor, Daniel Rypl. All rights reserved. This © ACM. All rights reserved. This content is excluded from content is excluded from our Creative Commons license. For our Creative Commons license. For more information, see more information, see http://ocw.mit.edu/help/faq-fair-use/. http://ocw.mit.edu/help/faq-fair-use/. 9 Texture Mapping Image: Praun et al. Texture For each point mapped model rendered, look up color in texture map Texture map (2D image) © ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. © ACM. All rights reserved. This content is excluded from © Oscar Meruvia-Pastor, Daniel Rypl. All rights reserved. This our Creative Commons license. For more information, see content is excluded from our Creative Commons license. For http://ocw.mit.edu/help/faq-fair-use/. 10 more information, see http://ocw.mit.edu/help/faq-fair-use/.UV Coordinates • Each vertex P stores 2D (u, v) “texture coordinates” – UVs determine the 2D location in the texture for the vertex – We will see how to specify them later • Then we interpolate using barycentrics (u , v ) 0 0 (αu +βu +γu , 0 1 2 αv +βv +γv ) v 0 1 2 u (u , v ) 2 2 (u , v ) 1 1 11 UV Coordinates • Each vertex P stores 2D (u, v) “texture coordinates” – UVs determine the 2D location in the texture for the vertex – We will see how to specify them later • Then we interpolate using barycentrics (u , v ) 0 0 v u (u , v ) 2 2 (u , v ) 1 1 ✔ 12 Pseudocode – Ray Casting • Ray cast pixel (x, y), get visible point and α, β, γ • Get texture coordinates (u, v) at that point – Interpolate from vertices using barycentrics • Look up texture color using UV coordinates Scene Texture map Leonard McMillan, Computer Science at the University of North Carolina in Chapel Hill. 13 UV Coordinates? • Per-vertex (u, v) “texture coordinates” are specified: – Manually, provided by user (tedious) – Automatically using parameterization optimization – Mathematical mapping (independent of vertices) (u , v ) 0 0 v u (u , v ) 2 2 (u , v ) 1 1 ✔ 14 Texture UV Optimization • Goal : “flatten” 3D object onto 2D UV coordinates • For each vertex, find coordinates U,V such that distortion is minimized – distances in UV correspond to distances on mesh – angle of 3D triangle same as angle of triangle in UV plane • Cuts are usually required (discontinuities) © ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 15 To Learn More • For this course, assume UV given per vertex • Mesh Parameterization: Theory and Practice” – Kai Hormann, Bruno Lévy and Alla Sheffer ACM SIGGRAPH Course Notes, 2007 • http://alice.loria.fr/index.php/publications.html?redir ect=0&Paper=SigCourseParam2007&Author=Lev y 16 Slide from Epic Games 3D Model UV Mapping © Epic Games Inc. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 17 3D Model • Information we need: • Per vertex – 3D coordinates – Normal – 2D UV coordinates • Other information – BRDF (often same for the whole object, but could vary) – 2D Image for the texture map 18 Questions? © ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 19 Mathematical Mapping • What of non-triangular geometry? – Spheres, etc. • No vertices, cannot specify UVs that way • Solution: Parametric Texturing – Deduce (u, v) from (x, y, z) – Various mappings are possible.... 20

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.