Fall 2009 Revised1 Texture Mapping (Intermediate) Jyun-Ming Chen.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Michael I. Gold NVIDIA Corporation
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
Computer Graphics In4/MSc Computer Graphics Lecture Notes #15 Illumination III View Independent Rendering.
The Art and Technology Behind Bioshock’s Special Effects
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.
Projective Texture Mapping
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
3D Graphics Rendering and Terrain Modeling
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
OpenGL Texturing. Content Texture target Texture environment Texture coordinate Texture parameter (filters, wrap) Texture object Texture transformation.
(conventional Cartesian reference system)
Texture Mapping from Watt, Ch. 8 Jonathan Han. Topics Discussed Texture Map to Models Bump Maps, Light Maps Environment (Reflection) Mapping 3D Textures.
High-Quality Video View Interpolation
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Paper by Alexander Keller
Post-rendering Cel Shading & Bloom Effect
Computer Graphics Shadows
9/20/2001CS 638, Fall 2001 Today Finishing Up Reflections More Multi-Pass Algorithms Shadows.
Input: Original intensity image. Target intensity image (i.e. a value sketch). Using Value Images to Adjust Intensity in 3D Renderings and Photographs.
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
1 Texture. 2 Overview Introduction Painted textures Bump mapping Environment mapping Three-dimensional textures Functional textures Antialiasing textures.
Queensland University of Technology CRICOS No J INB382/INN382 Real-Time Rendering Techniques Lecture 13: Revision Ross Brown.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
Modelling and Simulation Types of Texture Mapping.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
 Bitmap: A bitmap is a rectangular array of 0s and 1s that serves as a drawing mask for a corresponding rectangular portion of the window.  Applications:
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Textures.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
ECSE-4750 Computer Graphics Fall 2004 Prof. Michael Wozny TA. Abhishek Gattani TA. Stephen
Geometric Transformations
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Lumo: Illumination for Cel Animation Scott F. Johnston.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
INT 840E Computer graphics Introduction & Graphic’s Architecture.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Orientable Textures for Image- Based Pen-And-Ink Illustration Michael P. Salisbury Michael T. Wong John F. Hughes David A. Salesin SIGGRAPH 1997 Andrea.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
1 Perception and VR MONT 104S, Fall 2008 Lecture 20 Computer Graphics and VR.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
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.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Module 05 –Bump mapping Module 05 – Bump mapping Module 05 Advanced mapping techniques: Bump mapping.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Applications and Rendering pipeline
Chapter 5. Lighting Computer Graphics (spring, 2009) School of Computer Science University of Seoul.
Ying Zhu Georgia State University
Computer Graphics Imaging
Deferred Lighting.
3D Graphics Rendering PPT By Ricardo Veguilla.
Introduction to Computer Graphics with WebGL
Computer Animation Texture Mapping.
Presentation transcript:

Fall 2009 Revised1 Texture Mapping (Intermediate) Jyun-Ming Chen

Fall 2009 Revised2 Texture Suite highlight bubble

Fall 2009 Revised3 Texture Suite warp underwater

Fall 2009 Revised4 Outline Dynamic sub texture image 1D and 3D textures Render to texture Environment mapping Cubemap Spheremap Bump map Light map Projective texture Q coord

Fall 2009 Revised5 Dynamic Texture CopyTexSubImage2D Replace a rectangular portion of 2D texture with pixels from the current READ_BUFFER This involves a read- back from GPU to CPU. Can you think of a way to move the dynamic texture around?! A better way of doing it: Render-to-texture (RTT) with framebuffer object (FBO)

Fall 2009 Revised6 glTexSubImage2D Replace part of the original image as new subimage Width and size of image need not be 2 n E.g., dynamic texture glTexSubImage2D (target, level, xoffset, yoffset, width, height, format, type, pixels)

Fall 2009 Revised7 Other Related Functions void glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); defines a two-dimensional texture image with pixels from the current GL_READ_BUFFER. void glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); docdoc replaces a rectangular portion of a two- dimensional texture image with pixels from the current GL_READ_BUFFER (rather than from main memory, as is the case for glTexSubImage2D). Similar to glCopyPixel s

Fall 2009 Revised8 3D Textures

Fall 2009 Revised9 Render-to-Texture (RTT) Generate a snapshot every  degrees Total 360/  shots The shots are stored as a single texture Width and height must be 2 n E.g., 128x128x8,  =45

Fall 2009 Revised10 RTT Implementation First determine a viewing range such that all views are rendered well. The snapshots are taken from slightly elevated positions. At each position, pre-render to some 2^n resolution, copy the image to buffer When the panorama is done, set all pixels with background color to zero alpha values. Bind it to a texture object.

Fall 2009 Revised11 RTT The image version of the model will be set on a (cylindrical) billboard The texture can be chosen as follows:  If you tank is symmetric, you can use even fewer images

Fall 2009 Revised12 RTT (symmetric tank) 180°  8 images: (180/7  26)° apart port side starboard side Reverse the port-side image  

Fall 2009 Revised13 Perlin Noise 3D Texture Noise as texture

Fall 2009 Revised14 Light Map By Michael Gold (ref)ref NVIDIA

Fall 2009 Revised15 Light Maps Quake ( 雷神之錘, id software) was the first computer game to use light map

Fall 2009 Revised16

Fall 2009 Revised17 Lightmaps Cached Lighting Results Reuse lighting calculations  Multiple local lights (same type)  Static portion of scene ’ s light field  Sample region with texture instead of tessellating

Fall 2009 Revised18 Lightmaps Getting the most from the Lightmap Maximize lightmap re-use, minimize lightmap size Texture size versus sampling level  Full surface texture with built-in lighting  Small surface texture, small low-resolution lightmap Adjust texture matrix to re-use lightmap  Dynamic lighting: track moving lights

Fall 2009 Revised19 Lightmaps Segmenting Scene Lighting Static vs. dynamic light fields Global vs. local lighting Similar light shape

Fall 2009 Revised20 Lightmaps Segmenting the lightfields Dominant Lighting Local lighting

Fall 2009 Revised21 Lightmaps Moving Local Lights Recreate the texture; simple but slow Manipulate the lightmap  Translate to move relative to the surface  Scale to change spot size  Change base polygon color to adjust intensity Projective textures ideal for spotlights

Fall 2009 Revised22 Lightmaps Moving Local Lights Translate Texture Scale Texture Change Base Polygon Intensity

Fall 2009 Revised23 Lightmaps Creating a lightmap Light white, tesselated surface with local light Render, capture image as texture Texture contains ambient and diffuse lighting Texture can also be computed analytically

Fall 2009 Revised24 Lightmaps Creating a lightmap Render surface lit by local light Create a Texture Map from Image

Fall 2009 Revised25 Lightmaps Lightmap building tips Minimize texture resolution to match required sampling Edges of texture should have uniform intensity Light intensity change should be negligible at edges Don ’ t forget borders if you clamp the lightmap  Fill in border to match edge and corner  Or use border color

Fall 2009 Revised26 Lightmaps Lightmap building tips Boundary should have constant value Intensity changes from light should be minimal near edge of lightmap

Fall 2009 Revised27 Lightmaps Lighting with a Lightmap Local light is affected by surface color and texture Two step process adds local light contribution:  Modulate textured, unlit surfaces with lightmap  Add locally lit image to scene Can mix OpenGL, lightmap lighting in same scene

Fall 2009 Revised28 Lightmaps Creating local contribution Unlit Scene Lightmap Intensity Local Light Contribution Lightmap

Fall 2009 Revised29 Lightmaps Using Lightmaps Move lightmaps using texture matrix Distance from surface simulated by scaling texture and changing intensity Texgen maps lightmap to surfaces, overrides local texture coordinates  Can avoid changing model ’ s texture coordinates

Fall 2009 Revised30 Projective Texture Mapping Light source as slide projector Also generate shadows

Fall 2009 Revised31 Projective Texture Mapping

Fall 2009 Revised32 Implementation Tricks The projected texture need to be padded with black boundary pixels so that the clamped texture appears Ok Some natural faults (more than one layer of surface got textured): no way to resolve this!?

Fall 2009 Revised33 Q coord See Sampcode/qcoord

Fall 2009 Revised34 Code Samples Cutout texture Render-to-texture (RTT) Whirlpool cubemap lightmap billboarding