Projective Texture Mapping

Slides:



Advertisements
Similar presentations
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Advertisements

Polygon Rendering Flat Rendering Goraud Rendering Uses Phong Reflectance Phong Rendering.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Graphics Pipeline.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
Projective Texture. Spring Projective Texture Texture projected on a scene as if by a projector Can also be used to generate spot light and shadows.
Course Note Credit: Some of slides are extracted from the course notes of prof. Mathieu Desburn (USC) and prof. Han-Wei Shen (Ohio State University). CSC.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
3D Graphics Rendering and Terrain Modeling
Chapter 6: Vertices to Fragments Part 2 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
Advanced Texture Mapping May 10, Today’s Topics Mip Mapping Projective Texture Shadow Map.
1 Lecture 9 Lighting Light Sources Reflectance Camera Models.
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Sky Rendering The actual physics is very complicated and costly to calculate. Several cheap approaches for very distant skies: –Constant backdrop –Skybox.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
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.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 10/24/ :01 UML Graphics II Shadows Session 4.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
Shadows. Shadows is important in scenes, consolidating spatial relationships “Geometric shadows”: the shape of an area in shadow Early days, just pasted.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Review of OpenGL Basics
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
Image Synthesis Rabie A. Ramadan, PhD 4. 2 Review Questions Q1: What are the two principal tasks required to create an image of a three-dimensional scene?
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 9 Lighting and Texturing.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Lecture 7 Midterm Review. OpenGL Libraries gl: Basic OpenGL library, e.g. primitives. glu: OpenGL Utility library, a set of functions to create texture.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
Mobile & Casual Gaming OpenGL ES Intro. /red/chapter03.html.
Programmable Pipelines
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
3D Graphics Rendering PPT By Ricardo Veguilla.
Models and Architectures
Introduction to Computer Graphics with WebGL
Texture and Shadow Mapping
CS5500 Computer Graphics May 29, 2006
Computer Graphics 4Practical Lesson
Frame Buffer Applications
3D Game Programming Texture Mapping
Presentation transcript:

Projective Texture Mapping

Projective Textures Use to simulate effects: Slide projectors Spotlight illuminations Shadows Reprojection of images

Texture Projection Very similar to projecting the objects to the screen But now we will project the scene to the light source (or the slide projector, for example) The key is to calculate the texture coordinates of the projection receiver Projection geometry image plane Slide projector camera

Calculate the Texture Coordinates Main idea – Project the objects to the “image plane” of the projector and use the projector’s NDC to calculate the texture coordinates projector objects Projection projector objects Projection

Calculate the Texture Coordinates Use OpenGL’s texgen function and set it to GL_OBJECT_LINEAR Construct the texture matrix as a concatenation of (M_t = T * P * M) M: Modelview (set the projector’s view using gluLookAt) P: Projection (set the projector’s “camera” parameters) T: Bias and Scale: transform from projector’s NDC [-1,1] to [0,1] to look up texture

Things to pay attention: Need to make sure that only the objects meant to receive the projected texture will render with the texture (not every object in the scene) Need to use 4D texture coordinates to ensure correct perspective projection

Example Code Note that in this example we are using GL_EYE_LINEAR, but it is okay As long as you remember to transform the eye space back to object space first (next page to continue)

Example Code … //draw the scene …

Spotlight illumination The OpenGL’s spot light feature requires us to tessellate the polygons The main idea – project the texture to the scene from the light as a illumination mask Regular point light source is used

Algorithm Drawing the scene with depth buffering enabled and color buffer write disabled Load and enable the spotlight texture and use GL_MODULATE to map the texture Enable texture coordinate geneartion and load the texture matrix Enable blending and use GL_ONE, GL_ONE for the blending function Disable depth buffer write, set the depth function to GL_EQUAL Draw the scene with the vertex color set to the spot light color Disable the spot light texture, texgen, and texture transformation Set the blend function to GL_DST_COLOR Draw the scene with normal diffuse and specular light

Using textures for contouring Remember the texture coodinates are generated as: s = Ax + By + Cz+ Dw (same for t, r, q if needed), where A, B, C, D are user specified parameters, and x,y,z,w can be either object space or eye space position This can be used to measure the distance to the plane Ax+By+Cz+D when w = 1 If we simply apply a 1D texture from the generated texture coordinate S (below), then you are making the object based on its distance to a particular plane

Examples