Advanced Texture and Lighting

Slides:



Advertisements
Similar presentations
Lecture 8 Transparency, Mirroring
Advertisements

Exploration of bump, parallax, relief and displacement mapping
Bump Mapping CSE 781 Roger Crawfis.
Graphics Pipeline.
03/16/2009Dinesh Manocha, COMP770 Texturing Surface’s texture: its look & feel Graphics: a process that takes a surface and modifies its appearance using.
Environment Mapping CSE 781 – Roger Crawfis
3D Graphics Rendering and Terrain Modeling
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
Computer Graphics Bing-Yu Chen National Taiwan University.
 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures II Week 8, Wed.
(conventional Cartesian reference system)
Status – Week 277 Victor Moya.
7M836 Animation & Rendering
CS 395: Adv. Computer Graphics Overview Surface Detail Maps Watt: Chapter 8 + readings Due Date Reminders: Feb 4 - project proposal, or Feb 4 - reference.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
1 Texturing. 2 What is Texturing? 3 Texture Mapping Definition: mapping a function onto a surface; function can be:  1, 2, or 3D  sampled (image) or.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
1 Texture. 2 Overview Introduction Painted textures Bump mapping Environment mapping Three-dimensional textures Functional textures Antialiasing textures.
Computer Graphics Inf4/MSc Computer Graphics Lecture 7 Texture Mapping, Bump-mapping, Transparency.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CS 638, Fall 2001 Admin Grad student TAs may have had their accounts disabled –Please check and the lab if there is a problem If you plan on graduating.
Environment Mapping. Examples Fall Motivation Silver candlestick No appropriate texture for it “ environment ” map Simulates the results of ray-tracing.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
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.
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
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.
Game Programming (Mapping) Spring.
CS 638, Fall 2001 Today Project Stage 0.5 Environment mapping Light Mapping.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
CS 445 / 645: Introductory Computer Graphics Light.
CS-378: Game Technology Lecture #4: Texture and Other Maps Prof. Okan Arikan University of Texas, Austin V Lecture #4: Texture and Other Maps.
1 Texture Mapping. 2 Texture Aliasing MIPmaps Environment Mapping Bump Mapping Displacement Mapping Shadow Maps Solid Textures Antialiasing.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Computing & Information Sciences Kansas State University Lecture 10 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
Computer Graphics 2 Lecture 7: Texture Mapping Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
Real-Time Relief Mapping on Arbitrary Polygonal Surfaces Fabio Policarpo Manuel M. Oliveira Joao L. D. Comba.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
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.
Module 06 –environment mapping Module 06 – environment mapping Module 06 Advanced mapping techniques: Environment mapping.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
Module 05 –Bump mapping Module 05 – Bump mapping Module 05 Advanced mapping techniques: Bump mapping.
CSc4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Texture Mapping.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Texturing CMSC 435/ What is Texturing? 2 Texture Mapping Definition: mapping a function onto a surface; function can be: – 1, 2, or 3D – sampled.
Discrete Techniques.
ATEC Procedural Animation
3D Graphics Rendering PPT By Ricardo Veguilla.
So Far We have assumed that we know: The point The surface normal
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
UMBC Graphics for Games
Procedural Animation Lecture 6: Mapping
CS-378: Game Technology Lecture #4: Texture and Other Maps
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Environment Mapping.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Texture Mapping Jung Lee.
Presentation transcript:

Advanced Texture and Lighting Bump Mapping Displacement Mapping Environment Mapping Light Mapping Shadow Mapping

Bump Mapping Specify vertex/pixel normals of polygon You have to calculate each vertex or pixel normal according to the specification.

Normal Map Use texel values to modify vertex/pixel normals of polygon Texel values correspond to normals (or heights) modifying the current normals RGB = (n+1)/2 n = 2*RGB – 1

Bump Mapping The light source direction L and pixel normal N are represented in the global coord x, y, z the bump map normal n is in its local coordinates, which is called tangent space or texture space We create a local coordinates TNB T, B are in the texture N is perpendicular to the texture T, N, B are three perpendicular vectors in x,y,z coordinates The bump map normal n is represented in the TNB coordinates. Therefore, each pixel has a TNB

Bump Mapping (cont.) The tangent space can be aligned with any orientation as long as they are perpendicular to the normal N, and they do not rotate around N from point to point. The tangent space coordinates TNB: T = NxS; B = TxN L’ = (TL, NL, BL) T, N, B as vectors should be the same across the polygon. So they are calculated at vertex level.

Displacement Mapping Bump mapping Displacement Mapping can be at pixel level has no geometry/shape change Displacement Mapping Actually modify the surface geometry (vertices) re-calculate the normals Can include bump mapping

Displacement Mapping Bump mapped normals are inconsistent with actual geometry. No shadow. Displacement mapping affects the surface geometry

Environment Mapping

Environment Mapping Used to show the reflected colors in shiny objects a ray A and a normalized normal n, the reflected ray B = 2n(n•A) - A.

Environment Mapping a simplified method uses the surface normal as an index for the texel on the cube surface

Cube Environment Mapping

Ent mapping with GL_REFLECTION_MAP & GL_TEXTURE_CUBE_MAP gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X, cubeMap[0]);    gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X, cubeMap[1]);    gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y, cubeMap[2]);    gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, cubeMap[3]);    gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Z, cubeMap[4]);    gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, cubeMap[5]);    gl.glEnable(GL.GL_TEXTURE_CUBE_MAP); //GL_REFLECTION_MAP for s,t,r texture coordinates    gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_REFLECTION_MAP);    gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_REFLECTION_MAP);    gl.glTexGeni(GL.GL_R, GL.GL_TEXTURE_GEN_MODE, GL.GL_REFLECTION_MAP);    gl.glEnable(GL.GL_TEXTURE_GEN_S);    gl.glEnable(GL.GL_TEXTURE_GEN_T);    gl.glEnable(GL.GL_TEXTURE_GEN_R);    //Draw shape to aply reflection on it …

Spherical Environ. Mapping More Efficient than cube maps image of perfect sphere reflector seen from infinity (orthographic)

Indexing Sphere Maps Implemented in hardware Problems: //Texture use for automatic coordinate generation   gl.glBindTexture(GL.GL_TEXTURE_2D, texture);   gl.glEnable(GL.GL_TEXTURE_2D);   //Sphere mapping and enable s & t texture generation   gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_SPHERE_MAP);   gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_SPHERE_MAP);   gl.glEnable(GL.GL_TEXTURE_GEN_S);   gl.glEnable(GL.GL_TEXTURE_GEN_T);   //Draw the shapes to apply the texture   ... Problems: Highly non-uniform sampling Highly non-linear mapping

Non-uniform Sampling

Non-linear Mapping Linear interpolation of texture coordinates picks up the wrong texture pixels Use small polygons! Correct Linear

Example

Light Mapping Pre-render special lighting effects ‘Multi-texturing’ idea: arbitrary texel-by-texel shading calc’d from multiple texture maps Reflectance Texture  Light Map (Illumination Texture) = Display texture

Shadow Mapping Render scene from light’s point of view Store depth of each pixel

Shadow Mapping Render scene from light’s point of view Store depth of each pixel From light’s point of view, any pixel blocked is in the shadow. When shading a surface: Transform surface pixel into light coordinates Compare current surface depth to stored depth. If depth > stored depth, the pixel is in shadow; otherwise the pixel is lit Very expensive

Aliasing Williams, Siggraph ‘78 render scene from light source shadowing by depth comparison prone to aliasing when zooming into shadow boundaries single shadow map pixel