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

Similar documents
Lecture 11of 41. Surface Detail 2 of 5: Textures OpenGL Shading

Lecture 13 of 41. Surface Detail 4 of 5: Pixel & Vertex Shaders Lab 2b: Shading in Direct3D

Lecture 16 of 41. Transparency, Painter s Algorithm, & Z-Buffer Lab 3a: Shading & Transparency

Lecture 6 of 41. Scan Conversion 1 of 2: Midpoint Algorithm for Lines and Ellipses

Lecture 6 of 41. Scan Conversion 1 of 2: Midpoint Algorithm for Lines and Ellipses

Texture. Texture Maps

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

Texture. Detail Representation

Multiple Importance Sampling

CS 431/636 Advanced Rendering Techniques

Lecture 0 of 41: Part B Course Content. Advanced Computer Graphics: Course Organization and Survey

Lecture 15 of 41. Scene Graphs: State Videos 1: CGA Shorts, Demos

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

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Computer Graphics. - Texturing Methods -

CS 354R: Computer Game Technology

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Lecture 18 of 41. Scene Graphs: Rendering Lab 3b: Shader

Chapter 9- Ray-Tracing

LEVEL 1 ANIMATION ACADEMY2010

Introduction to Visualization and Computer Graphics

Ray Tracing: Special Topics CSCI 4239/5239 Advanced Computer Graphics Spring 2018

COM337 COMPUTER GRAPHICS Other Topics

Real-Time Shadows. Last Time? Textures can Alias. Schedule. Questions? Quiz 1: Tuesday October 26 th, in class (1 week from today!

CS 325 Computer Graphics

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Texture and other Mappings

Textures. Texture coordinates. Introduce one more component to geometry

ART 268 3D Computer Graphics Texture Mapping and Rendering. Texture Mapping

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

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

Homework #2. Shading, Ray Tracing, and Texture Mapping

Programmable GPUS. Last Time? Reading for Today. Homework 4. Planar Shadows Projective Texture Shadows Shadow Maps Shadow Volumes

FLAMINGO CHEAT SHEET FOR ES 305 CLASS 5 Pages of Fresh Flamingo Goodness

Complex Shading Algorithms

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

Lecture 32 of 41. Lab 6: Ray Tracing with ACM SIGGRAPH Demo & POV-Ray

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

Lecture 7 of 41. Viewing 4 of 4: Culling and Clipping Lab 1b: Flash Intro

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Texture Mapping and Special Effects

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

CPSC / Texture Mapping

Render methods, Compositing, Post-process and NPR in NX Render

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Chapter 17: The Truth about Normals

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

Shading / Light. Thanks to Srinivas Narasimhan, Langer-Zucker, Henrik Wann Jensen, Ravi Ramamoorthi, Hanrahan, Preetham

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Lecture 21 of 41. Animation Basics Lab 4: Modeling & Rigging in Maya

diffuse diffuse reflection refraction diffuse mapping diffuse reflection reflection filter mapping mapping reflection

Shading. Flat shading Gouraud shading Phong shading

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Texture mapping. Computer Graphics CSE 167 Lecture 9

Computergrafik. Matthias Zwicker. Herbst 2010

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Image-based Lighting

TEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri

Buffers, Textures, Compositing, and Blending. Overview. Buffers. David Carr Virtual Environments, Fundamentals Spring 2005 Based on Slides by E.

CS559 Computer Graphics Fall 2015

CS 130 Final. Fall 2015

Pipeline Operations. CS 4620 Lecture 14

Classic Rendering Pipeline

Spring 2012 Final. CS184 - Foundations of Computer Graphics. University of California at Berkeley

More Texture Mapping. Texture Mapping 1/46

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

frame buffer depth buffer stencil buffer

COMP 175 COMPUTER GRAPHICS. Lecture 11: Recursive Ray Tracer. COMP 175: Computer Graphics April 9, Erik Anderson 11 Recursive Ray Tracer

Computer Graphics. CS52 Fall computer graphics introduction 2006 fabio pellacini 1

Advanced Shading and Texturing

Computer Graphics. CS52 Winter computer graphics introduction 2008 fabio pellacini 1. introduction

Einführung in Visual Computing

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

The Rasterization Pipeline

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

The Bricks2D texture has axial projection methods available such as spherical, cubic, planar, front, cylindrical and UV.

Raycast Rendering Maya 2013

Texture Mapping and Sampling

Rendering and Radiosity. Introduction to Design Media Lecture 4 John Lee

Discrete Techniques. 11 th Week, Define a buffer by its spatial resolution (n m) and its depth (or precision) k, the number of

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

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

Chapter 4- Materials and Textures

For Intuition about Scene Lighting. Today. Limitations of Planar Shadows. Cast Shadows on Planar Surfaces. Shadow/View Duality.

CSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Chapter 7 - Light, Materials, Appearance

Mali Demos: Behind the Pixels. Stacy Smith

Lecture 0 of 41: Part A Course Organization. Introduction to Computer Graphics: Course Organization and Survey

Homework 3: Programmable Shaders

Computer Graphics Lecture 11

Interactive Methods in Scientific Visualization

Computer Graphics I Lecture 11

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

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

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

Image-Based Lighting. Inserting Synthetic Objects

Computer Graphics Disciplines. Grading. Textbooks. Course Overview. Assignment Policies. Computer Graphics Goals I

Recall: Indexing into Cube Map

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

COMP environment mapping Mar. 12, r = 2n(n v) v

Transcription:

2 Lecture Outline Surface Detail 3 of 5: Mappings OpenGL Textures William H. Hsu Department of Computing and Information Sciences, KSU KSOL course pages: http://bit.ly/hgvxlh / http://bit.ly/evizre Public mirror web site: http://www.kddresearch.org/courses/cis636 Instructor home page: http://www.cis.ksu.edu/~bhsu Readings: Today: Sections 20.5 20.13, Eberly 2 e see http://bit.ly/ieuq45 Next class: Section 3.1, Eberly 2 e Brown CS123 slides on Polygons/Texture Mapping http://bit.ly/h2vzn8 Wayback Machine archive of Brown CS123 slides: http://bit.ly/gahjbh Gröller & Jeschke slides on Texturing http://bit.ly/djfyq9 Reading for Last Class: 2.6.3, 20.3 20.4, Eberly 2 e Reading for Today: 20.5 20.13, Eberly 2 e (Many Mappings) Reading for Next Class: 3.1, Eberly 2 e Last Time: Texture Mapping Explained Definitions and design principles Enclosing volumes: cylinder, sphere, box Mapping methods reflected ray bounce ray off object O object normal ray from face normal of object (polygon mesh) object center ray from center of object intermediate surface normal ray from inside of enclosing S Today: Mappings, OpenGL Texturing Shadow, reflection/environment, transparency, bump, displacement Other mappings: gloss, volumetric fog, skins, rainbows, water OpenGL texture mapping how-to 3 Where We Are 4 Review: OpenGL Shading (Overview) Set Up Point Light Sources Set Up Materials, Turn Lights On Frank Pfenning Professor of Computer Science School of Computer Science Carnegie Mellon University http://www.cs.cmu.edu/~fp/ See also: OpenGL: A Primer, 3 e (Angel) http://bit.ly/hvcvwn Start Drawing (glbegin glend) 2003 F. Pfenning, Carnegie Mellon University http://bit.ly/g1j2nj 5 Acknowledgements: Many Mappings 6 Overview of Mappings: Eberly 2 e Chapter 20 Sections Stefan Jeschke Research Assistant http://bit.ly/huum94 Eduard Gröller Associate Professor Director, Visualization Working Group http://bit.ly/huum94 Institute of Computer Graphics and Algorithms Technical University of Vienna Texturing material from slides 2002 E. Gröller & S. Jeschke, Vienna University of Technology http://bit.ly/djfyq9 Pat Hanrahan CANON USA Professor Director, Computer Graphics Laboratory Computer Science and Electrical Engineering Departments Stanford University http://graphics.stanford.edu/~hanrahan/ Mapping material from slides 1995 2009 P. Hanrahan, Stanford University http://bit.ly/hzfsjz (CS 348B, Computer Graphics: Image Synthesis ) Fine Surface Detail: Bump ( 20.5 Eberly 2 e ) Material Effects: Gloss ( 20.6) Enclosing Volumes Sphere ( 20.7) Cube ( 20.8) Light Refraction for Transparency ( 20.9) Reflection aka Environment ( 20.10) Shadow Shadow Maps ( 20.11, 20.13) Projective Textures ( 20.12) More Special Effects (SFX) Fog ( 20.14) Skinning ( 20.15) Iridescence ( 20.16), Water ( 20.17) Babylon 5 1993 1998 Warner Brothers Entertainment, Inc.

7 Shadow Mapping [1]: 8 Shadow Mapping [2]: Process for Adding Shadows in 3-D CG Compatible with Local Illumination Global method: shadow rays Ways to Handle Shadows Projected planar shadows: works well on flat surfaces only Shadow stencil buffer: powerful, excellent results possible; hard! Not needed here as in raytracing Instead, use decaling Decals Paste surface detail onto model Semi-transparent: alpha blending Can simulate many attributes Shadow Stencil Buffer Shadow Mapping 2007 XVR Wiki http://wiki.vrmedia.it/index.php?title=shadow_mapping Shadow Mapping 2005 Wikipedia OpenGL Shadow Mapping Tutorials Beginner/Intermediate (Baker, 2003): http://bit.ly/e1la2n Advanced (Octavian et al., 2000): http://bit.ly/f1iryb (old NeHe #27) Without shadow map With shadow map http://en.wikipedia.org/wiki/shadow_mapping Adapted from Shadow Mapping 2001 C. Everitt, nvidia http://developer.nvidia.com/object/shadow_mapping.html 9 Shadow Mapping [3]: 10 Reflection/Environment Mapping [1]: Shadow Mattes (Hanrahan) Reflection Maps (Special Type) ~ Environment Maps (General Case) For a given viewing direction For each normal direction For each incoming direction (hemispherical integral) Evaluate reflection equation Idea: Take Picture of Scene Faced by Object, Apply as Map to Object Requirements: Need to Take Account of Projective Distortions Can Be Layered (See Maya 2011 Tutorial by Maciek Gryka) 2010 M. Gryka http://bit.ly/hjlfps 1995 2009 P. Hanrahan, Stanford University 1995 2009 P. Hanrahan, Stanford University 11 Reflection/Environment Mapping [2]: 12 Reflection/Environment Mapping [3]: Gazing Ball (Mirrorball) Photo 2009 K. Turkowski Reflection Functions Diffuse: irradiance map Glossy: radiance map Anisotropic: for each tangent direction Mirror: reflection map (related to environment map) Illumination Functions: Environment Map or Procedural Light Sources How To Create Direction Maps Latitude-Longitude (Map Projections) - paint Gazing Ball - photograph reflective sphere Fisheye Lens - standard (wide-angle) camera lens Cubical Environment Map - rendering program or photography Easy to produce "Uniform" resolution Simple texture coordinates calculation Old NeHe OpenGL Mapping Tutorials (2000) #6 (texture map onto cube) Beginner (Molofee): http://bit.ly/gkj2nb #23 (sphere) Intermediate (Schmick & Molofee): http://bit.ly/e3zb8h nvidia Tutorial: OpenGL Cube Map (1999): http://bit.ly/ejedam Issues: Non-Linear Mapping, Area Distortion, Converting Between Maps 1995 2009 P. Hanrahan, Stanford University 1995 2009 P. Hanrahan, Stanford University

13 Transparency Mapping [1]: 14 Transparency Mapping [2]: Transparency: One Term for Many Alpha Compositing aka Alpha Blending Combine colors of transparent foreground, opaque background Uses alpha channel A of (R, G, B, A) think % transparency Wikipedia: http://bit.ly/eppwoh (see also RGBA, http://bit.ly/eppwoh) Goal: See Through Objects (Could Be Real Decals) Ideas: Render Background Object, Then Foreground Object or Material Blend in color of (semi-)transparent/translucent foreground object Simulate little holes in foreground material ( screen door) 1995 2009 P. Hanrahan, Stanford University Alpha blending: Lim (2010), http://bit.ly/6tsjrb Goon Creative, Maya Transparency Tutorial Screen door: Viola et al. (2004), http://bit.ly/dvea7l Technical University of Vienna, IEEE Vis 2004 Screen Door Transparency Simulate little holes in foreground material (screen door) Result: visual effect of being able to see through foreground 15 Transparency Mapping [3]: 16 Bump Mapping [1]: OpenGL Transparency How-To at OpenGL.org: http://bit.ly/hraqgk Goal: Create Illusion of Textured Surface Screen Door Transparency Use glpolygonstipple(), glenable(gl_polygon_stipple) See http://bit.ly/g1hqpj Glass-Like Transparency using Alpha Blending Use glenable(gl_blend), glblendfunc( ) + = See http://bit.ly/hs82za Bump Mapping 2010 Wikipedia http://en.wikipedia.org/wiki/bump_mapping Idea Start with regular smooth object Make height map (by hand and/or using program, i.e., procedurally) Use map to perturb surface normals Plug new normals into illumination equation Viola et al. (2004), http://bit.ly/dvea7l Technical University of Vienna, IEEE Vis 2004 Will This Look Realistic? Why/Why Not? 17 Bump Mapping [2]: 18 Bump Mapping [3]: Bump Mapping Tutorial for OpenGL (Baker, 2003): http://bit.ly/fun4a5 Hey, wait a minute! what s wrong with the one on the left? 1995 2009 P. Hanrahan, Stanford University Right Ball (Displacement Mapped) Casts Rough Shadow Left Ball (Bump Mapped) Casts Smooth Shadow Why? Bump Mapping Only Perturbs Normals (Surface Only!)

19 Displacement Mapping [1]: 20 Displacement Mapping [2]: Remember What We Did to Perform Bump Mapping? Displacement Map: Similar to Bump Map Contains Delta Values Displacement Mapping: For Real! Q: Can We Make This Permanent? How? A: Sure! Let Perturbed Normals Define New Surface; Save Out Vertices 1995 2009 P. Hanrahan, Stanford University Displacement Mapping 2005 Wikipedia http://en.wikipedia.org/wiki/displacement_mapping Displacement Mapping: Uses Open GL Shading Language (GLSL) Tutorial using GLSL (Guinot, 2006): http://bit.ly/dwxnya 21 Displacement Mapping [3]: 22 Acknowledgements: Texture Mapping Slides When To Consider Using Displacement Mapping Very deep texture effect: veins, ridges, etc. Shadows expected Andy van Dam T. J. Watson University Professor of Technology and Education & Professor of Computer Science Brown University http://www.cs.brown.edu/~avd/ The Imp 2008 K. Scott, id Software Bjorn3D, http://bit.ly/i78sip Like Many Mappings and Other Effects, Wanted In Hardware! 1997 2010 van Dam et al., Brown University 23 Texture Mapping Technique [1] 24 Texture Mapping Technique [2]

25 Texture Mapping Technique [3] 26 Interpolation Trick: Barycentric Coordinates 27 Applying Barycentric Coordinates 28 Texture Mapping Technique [4]: Map Point to Object on (u, v) Square 1999 2011 Wolfram Research http://bit.ly/dggdlc 29 Texture Mapping Technique [5] 30 Texture Mapping Technique [6]

31 Texture Mapping Technique [7] 32 Texture Mapping Technique [8] 33 Texture Mapping Style [1]: Tiling 34 Texture Mapping Style [2]: Stretching 35 Texture Mapping Complex Geometry [1] 36 Texture Mapping Complex Geometry [2]

37 Texture Mapping Complex Geometry [3] 38 Texture Mapping Complex Geometry [4] 39 OpenGL Texturing [1]: Steps 40 OpenGL Texturing [2]: Specify 2-D Texture Object 41 OpenGL Texturing [3]: Specify How Texture Is Applied 42 OpenGL Texturing [4]: Enable Texture and Draw

43 OpenGL Texturing [5]: Create Texture Object 44 OpenGL Texturing [6]: Putting It All Together 45 Preview: Texturing with Blocks 46 Preview: Mipmapping 1999 2007 van Dam, A., Brown University 47 Summary 48 Terminology Last Time: Texture Mapping Explained Definitions and design principles Enclosing volumes: cylinder, sphere, box Mapping methods reflected ray object normal object center intermediate surface normal The Lord of the Rings: The Fellowship of the Ring Today: Mappings, OpenGL Texturing 2001 New Line Cinema Idea: define texture to simulate surface detail Shadow, reflection/environment, transparency, bump, displacement Other mappings: gloss, volumetric fog, skins, rainbows, water OpenGL texture mapping how-to Texture Mapping - Adding Detail, Raster Image, Color, etc. to CG Model Planar projection: apply flat texture to flat surface(s) Enclosing volumes: cylinder, sphere, box Mapping methods reflected ray bounce ray off object O object normal ray from face normal of object (polygon mesh) object center ray from center of object intermediate surface normal ray from inside of enclosing S Mappings: Apply Image or Simulated Surface Detail to Object Shadow: cast planar projective shadows or calculate volume Reflection/environment : take picture of scene from inside object Transparency: take picture of scene behind object; refract Bump: perturb color based on height map Displacement: perturb face normals, recalculate lighting