v. T u. Textures. Perlin, SIGGRAPH85. Werner Purgathofer

Similar documents
Einführung in Visual Computing

CPSC / Texture Mapping

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

3D Rasterization II COS 426

Computer Graphics. - Texturing Methods -

CSE528 Computer Graphics: Theory, Algorithms, and Applications

TEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri

Complex Features on a Surface. CITS4241 Visualisation Lectures 22 & 23. Texture mapping techniques. Texture mapping techniques

Computer Graphics 7 - Texture mapping, bump mapping and antialiasing

Texture Mapping II. Light maps Environment Maps Projective Textures Bump Maps Displacement Maps Solid Textures Mipmaps Shadows 1. 7.

Einführung in Visual Computing

CS 130 Final. Fall 2015

Surface Rendering. Surface Rendering

Announcements. Written Assignment 2 is out see the web page. Computer Graphics

Werner Purgathofer

More Texture Mapping. Texture Mapping 1/46

Texture mapping. Computer Graphics CSE 167 Lecture 9

CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

Texture Mapping and Sampling

lecture 18 - ray tracing - environment mapping - refraction

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

CS 431/636 Advanced Rendering Techniques

+ = To Do. Texture Mapping. Adding Visual Detail. Parameterization. Option: Varieties of projections. Computer Graphics. geometry

CS 428: Fall Introduction to. Texture mapping and filtering. Andrew Nealen, Rutgers, /18/2010 1

+ = To Do. Adding Visual Detail. Texture Mapping. Parameterization. Option: Varieties of projections. Foundations of Computer Graphics (Fall 2012)

Texture-Mapping Tricks. How Bad Does it Look? We've Seen this Sort of Thing Before. Sampling Texture Maps

Texture Mapping. Michael Kazhdan ( /467) HB Ch. 14.8,14.9 FvDFH Ch. 16.3, , 16.6

Textures and normals in ray tracing

CS 5600 Spring

Bump Mapping Which one of these two image has a better visual effect?

Complex Shading Algorithms

- Rasterization. Geometry. Scan Conversion. Rasterization

Texture Mapping. Brian Curless CSE 457 Spring 2016

Textures. Texture coordinates. Introduce one more component to geometry

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

CS 354R: Computer Game Technology

CS 130 Exam I. Fall 2015

Pipeline Operations. CS 4620 Lecture 10

Computer Graphics. Lecture 8 Antialiasing, Texture Mapping

Texturas. Objectives. ! Introduce Mapping Methods. ! Consider two basic strategies. Computação Gráfica

CS 130 Exam I. Fall 2015

Today. Texture mapping in OpenGL. Texture mapping. Basic shaders for texturing. Today. Computergrafik

Texture Mapping. Reading. Implementing texture mapping. Texture mapping. Daniel Leventhal Adapted from Brian Curless CSE 457 Autumn 2011.

Barycentric Coordinates and Parameterization

CS 450: COMPUTER GRAPHICS TEXTURE MAPPING SPRING 2015 DR. MICHAEL J. REALE

Computergrafik. Matthias Zwicker. Herbst 2010

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

CPSC 314 LIGHTING AND SHADING

CS GPU and GPGPU Programming Lecture 11: GPU Texturing 1. Markus Hadwiger, KAUST

AMCS / CS 247 Scientific Visualization Lecture 10: (GPU) Texture Mapping. Markus Hadwiger, KAUST

Texture Mapping. Brian Curless CSE 457 Spring 2015

Graphics and Interaction Rendering pipeline & object modelling

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

CS451Real-time Rendering Pipeline

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2014

Computer Graphics. Illumination Models and Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

Mach band effect. The Mach band effect increases the visual unpleasant representation of curved surface using flat shading.

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

CS 464 Review. Review of Computer Graphics for Final Exam

Overview. Hierarchy. Level of detail hierarchy Texture maps Procedural shading and texturing Texture synthesis and noise.

CIS 536/636 Introduction to Computer Graphics. Kansas State University. CIS 536/636 Introduction to Computer Graphics

CS 4620 Midterm, March 21, 2017

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Rasterization Overview

Pipeline Operations. CS 4620 Lecture 14

Topics and things to know about them:

Introduction to 3D Graphics

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

lecture 19 Shadows - ray tracing - shadow mapping - ambient occlusion Interreflections

Reading. Texture Mapping. Non-parametric texture mapping. Texture mapping. Required. Angel, 8.6, 8.7, 8.9, 8.10,

Perspective Projection and Texture Mapping

Cap. 3 Textures. Mestrado em Engenharia Informática (6931) 1º ano, 1º semestre

x ~ Hemispheric Lighting

Texture. Detail Representation

CSE 167: Introduction to Computer Graphics Lecture #8: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016

Reading. Texture Mapping. Non-parametric texture mapping. Texture mapping. Required. Angel, 8.6, 8.7, 8.9, Recommended

CS 4620 Program 3: Pipeline

CS5620 Intro to Computer Graphics

Displacement Mapping

Reading. 12. Texture Mapping. Texture mapping. Non-parametric texture mapping. Required. w Watt, intro to Chapter 8 and intros to 8.1, 8.4, 8.6, 8.8.

Computer Graphics. - Texturing - Philipp Slusallek

Reading. 18. Projections and Z-buffers. Required: Watt, Section , 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading:

CSE 167: Introduction to Computer Graphics Lecture #7: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015

CS452/552; EE465/505. Intro to Lighting

Ambien Occlusion. Lighting: Ambient Light Sources. Lighting: Ambient Light Sources. Summary

Motivation. towards more realism. + Texture Mapping Texture Mapping

CMSC427 Final Practice v2 Fall 2017

Texture and other Mappings

CHAPTER 1 Graphics Systems and Models 3

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Lecture 12: Advanced Rendering

Chapter 10. Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

Chapter 1 Introduction. Marc Olano

Graphics Hardware and Display Devices

Texture. Texture Maps

Chapter 2 A top-down approach - How to make shaded images?

CS 488. More Shading and Illumination. Luc RENAMBOT

Transcription:

Perlin, SIGGRAPH85 Einführung in Visual Computing 186.822 v Textures T u Werner Purgathofer

Surface Rendering Methods polygon rendering methods ray tracing global illumination environment mapping texture mapping bump mapping Werner Purgathofer 2

Textures in the Rendering Pipeline scene objects in object space object capture/creation ti modeling viewing projection vertex stage ( vertex shader ) transformed vertices in clip space clipping + homogenization scene in normalized device coordinates viewport transformation rasterization ti shading raster image in pixel coordinates 3 pixel stage ( fragment shader )

Environment Mapping Principle reflection mapping defined over surface of an enclosing universe (sphere, cube, cylinder) spherical environment map leighmachin.com objects in scene Werner Purgathofer 4

Environment Mapping Examples Jim Blinn Werner Purgathofer 5 Haeberli/Segal

Environment Mapping Calculation information in the environment map intensity values for light sources sky background objects environment map pixel projected onto surface reflected onto environment map Werner Purgathofer 6 pixel projection onto environment map projection reference point surface pixel

Environment Mapping Calculation information in the environment map intensity values for light sources sky background objects environment map pixel area projected onto surface reflected onto environment map Werner Purgathofer 7 pixel area projection onto environment map projection reference point surface pixel area

Environment Mapping Example Werner Purgathofer 8

Environment Mapping Filtering environment maps may be filtered for not so reflective surfaces Werner Purgathofer 9

Environment Mapping with Cube Map (1) z (1/1) y b x define textures on 6 sides of a cube, each parameterized in (u,v) v (0/0) u direction vector b starts t at (000) (0,0,0) Werner Purgathofer 10

Environment Mapping with Cube Map (2) z (1/1) find (u,v) from top view y b the direction vector b: y x if x xb b > y b and x b > z b x b vv then front face u=(y b +x)/2x b b x b y b 0 u 1 (0/0) u v=(z b +x)/2x b b analogous formulas for the other 5 faces ( x> y x> z, y> x y> z, y> x y> z, z> x z> y, z> x z> y ) Werner Purgathofer 11

Environment Mapping with Cube Map (3) z (1/1) r y n x b b=r v n v vv at a pixel: u viewing direction v (0/0) and normal vector n b + v = (2n v)n b = (2n v)n v Werner Purgathofer 12

Environment Mapping Example Werner Purgathofer 13

Adding Surface Detail most objects do not have smooth surfaces brick walls gravel roads carpets surface texture required D.Molyneaux Werner Purgathofer / Computergraphik 1 14 Stanford Artificial Studios

Adding Surface Detail modeling surface detail with polygons small polygon facets (e.g., checkerboard squares) facets overlaid on surface polygon (parent) parent surface used for visibility calculations facets used for illumination calculations impractical for complicated surface structure Werner Purgathofer 15

Texture Mapping: Principle texture patterns mapped onto surfaces texture pattern: raster image or procedure (modifies surface intensities) Jim Blinn viewing texturet space: texture-surface object space: image space: & projection (u,v) array transformation ti (u*,v*) surface transformation (x,y) pixel coordinates parameters coordinates Werner Purgathofer 16

Texture Mapping: Transformation texture mapping texture scanning (u,v) (x,y) ( ) inverse scanning (x,y) (u,v) viewing texture space: texture-surfacet object space: image space: & projection (u,v) array transformation (u*,v*) surface transformation (x,y) pixel coordinates parameters coordinates M T texture surface transformation M VP u* = u*(u,v) = a u* u + b u* v + c u* v* = v*(u,v) = a v* u + b v* v + c v* Werner Purgathofer 17

Texture Mapping: Inverse Transformation projecting pixel areas to texture space = = inverse scanning (x,y) (u,v) ( ) projected v M 1 M 1 VP pixel area T 1 0 0 1 calculation of M 1 VP u M 1 T anti aliasing with filter operations surface pixel area Werner Purgathofer 18

Texture Mapping: Cylindrical Surface M VP u*, with 0 /2 x² + y² = r² x, y 0 0 z h z v* z with 0 z h x r cos u* * y r sinu* * z v* * h r (u*,v*)* *) y M 1 M 1 VP pixel surface point (x,y,z) x θ (x,y,z) (u*,v*): u* = cos 1 (x/r), v* = z Werner Purgathofer 19

Texture Mapping: Cylindrical Surface M T u* = u π/2, v* = v h v z 1 h r (u*,v*)* *) 0 0 1 u x θ y M 1 T u = 2u*/π, v = v*/h (u* = cos 1 (x/r), v* = z) u = cos 1 (x/r)/π, v = z/h Werner Purgathofer 20

Texture Mapping: Anti aliasing anti aliasing with filter operations project pixel area into texture space and take average texture value back- projected pixel speed ups: mip mapping mapping summed area table method texturet space Werner Purgathofer 21

Perspective Correct Textures on Triangles mapping a texture on a triangle with barycentric coordinates: p(α,β,γ) = α a + β b + γ c color(x,y) = α t + β t + γ t 0 1 2 fails after perspective transform! correct: Werner Purgathofer 22

Perspective Correct Textures on Triangles solution: keep homogeneous weights h,h,h of a, b, c 0 1 2 and correct the barycentric values d=hh 1 h 2 +hβ(h 2 0 h 1 )+hγ(h 1 0 h 2 ) β w =hh 0 h 2 β/d γ w =hh 0 h 1 γ/d α w =1 β w γ w u = α w u 0 + β w u 1 + γ w u 2 v = α w v 0 + β w v 1 + γ w v 2 color(x,y) = t(u,v) instead of u=αu 0 +βu 1 +γu 2 v=αv 0 +βv 1 +γv 2 color(x,y) o = t(u,v) Werner Purgathofer 23

Solid Texturing texture defined in 3D every position in space has a color coherent textures across corners Werner Purgathofer 24

Solid Texturing Examples examples for application of 3D textures on a scull and a face Univ.Swansea Univ.Swansea Werner Purgathofer 25

Procedural Texturing procedural texture definition texture function t(x,y,z) returns intensity avoid M T 2D (surface texturing) or 3D (solid texturing) stochastic variations (noise function) examples wood grains marble foam Alias Wavefront Werner Purgathofer 26

Bump Mapping Principle bumps are visible because of shading modeling of bumps is very costly. trick: insert a detail structure b: v + = Tb Werner Purgathofer 27 u

Bump Mapping Examples Jim Blinn Dave Pape Gamestar Werner Purgathofer 28 Stanford

Reminder: Derivation of a Function f(x) derivation of a function in x one variable is the slope of the function f'(x) f'(x) = df(x)/dx = df/dx x Werner Purgathofer 29

Reminder: Partial Derivation of a Function f(x,y) y f(x,y)/ y = f/ y f(x,y)/ x ( = f/ x x partial derivations of a function in two variables are the slopes of the functions when you keep one of the variables fixed, they are slopes of tangents Werner Purgathofer 30

Bump Mapping Calculation surface roughness simulated perturbation function varies surface normal locally bump map b(u,v) n p(u,v) ( ) surface point v n * = p = * * u p v n n / n surface normal u Perlin p'(u,v) = p(u,v) + b(u,v) n b(u,v) = modified surface point + + n p (u (u,v) Werner Purgathofer 31 p(u,v)

Bump Mapping Calculation p'(u,v) (, ) = p(u,v), ) + b(u,v) n n' =(p u ' p v ' p u ' = p+bn)/ u ) = p u +b u n+bn u p u ' p u +b u n p v ' p v +b v n p u u u because b is very small Alias Wavefront n' = (p u +b u n) (p v +b v n) n' = p u p v +b v (p u n)+b u (n p v )+b u b v (n n) n n=0 n' = n * +b v (p u n)+b u (n p v ) Werner Purgathofer 32

Bump Mapping Representation bump map b(u,v) defined as raster image b u, b v : approximated with finite differences Alias Wavefront Werner Purgathofer 33

Bump Mapping Problems sources of error distortions at grazing angles wrong silhouette (geometry is not changed!) wrong shadows hd missing bump shadows light effects on back side Werner Purgathofer 34 Copyright Alias Wavefront

Bump Mapping: Grazing Angles red buttons appear too flat, although they are shaded in 3D Werner Purgathofer 35

Bump Mapping Problems sources of error distortions at grazing angles wrong silhouette (geometry is not changed!) wrong shadows hd missing bump shadows light effects on back side Werner Purgathofer 36 Copyright Alias Wavefront

Bump Mapping: Wrong Silhouette bump mapping correct geometry Lifeng Wang Lifeng Wang Werner Purgathofer 37 Copyright Alias Wavefront

Bump Mapping Problems sources of error distortions at grazing angles wrong silhouette (geometry is not changed!) wrong shadows hd missing bump shadows light effects on back side Werner Purgathofer 38 Copyright Alias Wavefront

Bump Mapping: Missing Bump Shadows bump mapping correct shadows Lifeng Wang Lifeng Wang Werner Purgathofer 39 Copyright Alias Wavefront

Bump Mapping Problems sources of error distortions at grazing angles wrong silhouette (geometry is not changed!) wrong shadows hd missing bump shadows light effects on back side Werner Purgathofer 40 Copyright Alias Wavefront

Bump Mapping: Back Side Light Effects Werner Purgathofer 41 Copyright Alias Wavefront

Bump Mapping Problems sources of error distortions at grazing angles wrong silhouette (geometry is not changed!) wrong shadows hd missing bump shadows light effects on back side there exist special algorithms to repair each error Werner Purgathofer 42 Copyright Alias Wavefront

Displacement Mapping correct version of bump mapping surface points are moved from their original position outline of object changes much harder to implement than bump mapping rare in practice latest hardware blender.org partially supports it Werner Purgathofer 43 Stefan Jeschke

Multitexturing: Combination of Mappings 2 or more textures applied to a surface examples: texture + dirt texture + light map texture + bump map photo + annotations + = Werner Purgathofer 44

Multitexturing: Combination of Mappings bump mapping & environment mapping & texture mapping Werner Purgathofer 45 Marek Mizanin

VRVis Open Lab Day for Students, 9. Juni 2015, 13:00-17:30 VRVis lädt Studentinnen und Studenten zu einem Open Lab Day ein! Lernen Sie das VRVis kennen. Informieren Sie sich über Möglichkeiten für Praktika und Diplomarbeiten. Wo: VRVis Zentrum für Virtual Reality und Visualisierung Forschungs-GmbH TechGate Vienna, 4.Stock, Donau-City-Straße 1, 1220 Wien (U1 Station ti Vienna International ti Center/Kaisermühlen) Rückfragen an: Tel. +43(1)20501 30100, Email: office@vrvis.at www.vrvis.at/openlabday