CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.

Slides:



Advertisements
Similar presentations
Hank Childs, University of Oregon Nov. 25th, 2014 CIS 441/541: Introduction to Computer Graphics Lecture 15: animation, transparency.
Advertisements

OpenGL Fragment Operations
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Advanced Effects CMSC 435/634. General Approach Ray Tracing – Shoot more rays Rasterization – Render more images.
Compositing and Blending Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Blending MAE152 Computer Graphics for Engineers and Scientists Fall 03.
Compositing and Blending - Chapter 8 modified by Ray Wisman Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
COMP Advanced Graphics Advanced Graphics - Part 6 The big picture: –Still working on advanced polygonal techniques with a special focus on OpenGL.
Image Compositing Angel 8.11 Angel: Interactive Computer Graphics5E © Addison-Wesley
Objectives Introduce OpenGL buffers and read/write Introduce OpenGL buffers and read/write Introduce texture mapping Introduce texture mapping Introduce.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
Computer Graphics (Spring 2008) COMS 4160, Lecture 19: Texture Mapping Many slides from Greg Humphreys, UVA and Rosalee.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping.
Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges Tomas Akenine-Möller Ulf Assarsson Department of Computer Engineering, Chalmers University.
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
7/2/2006Based on: Angel (4th Edition) & Akeine-Möller & Haines (2nd Edition)1 CSC345: Advanced Graphics & Virtual Environments Lecture 4: Visual Appearance.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008.
Computer Graphics Shadows
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
9/20/2001CS 638, Fall 2001 Today Finishing Up Reflections More Multi-Pass Algorithms Shadows.
Erdem Alpay Ala Nawaiseh. Why Shadows? Real world has shadows More control of the game’s feel  dramatic effects  spooky effects Without shadows the.
Computer Graphics Mirror and Shadows
CS 480/680 Computer Graphics Course Overview Dr. Frederick C Harris, Jr. Fall 2012.
Advanced Computer Graphics March 06, Grading Programming assignments Paper study and reports (flipped classroom) Final project No written exams.
Interactive Rendering of Meso-structure Surface Details using Semi-transparent 3D Textures Vision, Modeling, Visualization Erlangen, Germany November 16-18,
Sebastian Enrique Columbia University Real-Time Rendering Using CUReT BRDF Materials with Zernike Polynomials CS Topics.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
MIT EECS 6.837, Durand and Cutler Real-Time Shadows.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
Lecture 27: Texture Mapping Li Zhang Spring 2008
Real-time Shadow Mapping. Shadow Mapping Shadow mapping uses two-pass rendering - render depth texture from the light ’ s point-of-view - render from.
Multi-pass Rendering. © 2002 James K. Hahn, N.H. Baek2 Multi-pass Rendering Repeat: image  Rendering pass  result imageRepeat: image  Rendering pass.
DREAM PLAN IDEA IMPLEMENTATION Introduction to Computer Graphics Dr. Kourosh Kiani
Computer Graphics 2 Lecture 7: Texture Mapping Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Particle Systems (Motion Machines of 2D Objects with Textures) Matthew K. Bowles Advanced Computer Graphics Spring 2004.
CS559: Computer Graphics Lecture 9: Rasterization Li Zhang Spring 2008.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Compositing and Blending
Computer Graphics Blending CO2409 Computer Graphics Week 14.
CS559: Computer Graphics Lecture 22: Texture mapping Li Zhang Spring 2010 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
CS559: Computer Graphics Lecture 20: Project 2 Review and Texture mapping Li Zhang Spring 2010 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys,
UniS CS297 Graphics with Java and OpenGL Blending.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
CS559: Computer Graphics Lecture 21: Subdivision, Bspline, and Texture mapping Li Zhang Spring 2008.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
CS559: Computer Graphics Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation Li Zhang Spring 2008 Many slides from James Kuffner’s graphics class.
Compositing and Blending Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Computer Graphics I, Fall 2008 Compositing and Blending.
CS559: Computer Graphics Lecture 24: Shape Modeling Li Zhang Spring 2010.
Spring 2006 G5BAGR – Advanced Computer Graphics
Discrete Techniques.
CSE 167 [Win 17], Lecture 18: Texture Mapping Ravi Ramamoorthi
Week 7 - Monday CS361.
Introduction to Computer Graphics with WebGL
Photorealistic Rendering vs. Interactive 3D Graphics
The Graphics Rendering Pipeline
Making the Applications Interesting
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Real-time Rendering Shadow Maps
blending blending textures reflection fog
UMBC Graphics for Games
Introduction to Computer Graphics
Visibility (hidden surface removal)
blending blending textures reflection fog
Presentation transcript:

CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee Wolfe, DePaul tutorial teaching texture mapping visually, Jingyi Yu, U Kentucky.

Today Finish Texture mapping, continue on Blending and Shape Modeling Reading – Redbook: Ch 9, Ch 6 (Blending only) – (highly recommended) Moller and Haines: Real-Time Rendering, 3e, Ch 6 Linux: /p/course/cs559- lizhang/public/readings/6_texture.pdf Windows: P:\course\cs559- lizhang\public\readings\6_texture.pdf – (optional) Shirley: Ch 11.4 – 11.8

Shadow map Cast shadow on curved/non planar surfaces Lance Williams, “Casting Curved Shadows on Curved Surfaces,” SIGGRAPH 78

Shadow map Point light source Let’s consider this scene: Q: Is hack shadow enough?

Shadow map With shadow Without shadow

Shadow map Scene from the light’s viewpoint

Shadow map Depth map from the light’s viewpoint

Shadow map Point light source In rasterization, check light visibility using the depth map with respect to the light. Depth Texture

Shadow map glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);

Shadow map glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);

Shadow Map Depth testing from the light’s point-of-view A Two pass algorithm: First, render depth buffer from the light’s point- of-view – the result is a “depth map” or “shadow map” essentially a 2D function indicating the depth of the closest pixels to the light – This depth map is used in the second pass

Shadow Map Shadow determination with the depth map Second, render scene from the eye’s point-of- view – For each rasterized fragment determine fragment’s XYZ position relative to the light compare the depth value for XYZ and the depth value in the buffer computed in the first pass, relative to the light. More details, see Red book v2.1. pp Free Version 1.1 does not have this feature. Also see a tutorial

Project 3 Technical Challenge 1: sky box/sky dome – Render the environment within a box or hemisphere with sky texture – Google “sky box texture”, you can get many images for this.

Project 3 Technical Challenge: sky box/sky dome – Render the environment within a box or hemisphere with sky texture – Google “sky box texture”, you can get many images for this.

Cross-tree using alpha Side view Top View glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0.05);

Recap on Texture mapping Computing Perspective Correct Texture Coord Sampling Texture Values (Mipmap, …) OpenGL single texture mapping Projector Texture Mapping Bump Map Displacement Map 3D Texture Environment Map Multi-texturing Shadow map

Blending Billboard

Blending in OpenGL Destination --- Current Frame buffer color: (Rd, Gd, Bd, Ad) Source --- In coming fragment color: (Rs, Gs, Bs, As) Modulate Source color by (Sr, Sg, Sb, Sa) * + Modulate Destination color by (Dr, Dg, Db, Da) * Final Color: ( ?, ?, ?, ?) Example: glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); Example: glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Blending in OpenGL Destination --- Current Frame buffer color: (Rd, Gd, Bd, Ad) Source --- In coming fragment color: (Rs, Gs, Bs, As) Modulate Source color by (Sr, Sg, Sb, Sa) * + Modulate Destination color by (Dr, Dg, Db, Da) * Final Color: ( ?, ?, ?, ?) Example: glEnable(GL_BLEND); glBlendColor(0.3,0.4,0.5,0.6); glBlendFunc(GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR); Example: glEnable(GL_BLEND); glBlendColor(0.3,0.4,0.5,0.6); glBlendFunc(GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR);

Other choices Red Book ch 6

Blending depends on Order In 3D, the problem is tricky – If an opaque obj is in front of a translucent obj Draw opaque – If a translucent obj is in front of an opaque Blend

Blending depends on Order Solution – A-buffer – BSP tree

Blending depends on Order Hack – Draw opaque ones first – Freeze depth map, glDepthMask(GL_FALSE); – Draw transparent ones If behind the depth map, hide If in front of depth map, blend When will it introduce artifacts?