Michael I. Gold NVIDIA Corporation

Slides:



Advertisements
Similar presentations
Lecture 8 Transparency, Mirroring
Advertisements

Frame Buffer Postprocessing Effects in DOUBLE-S.T.E.A.L (Wreckless)
Topics in Computer Graphics Spring Application.
Exploration of bump, parallax, relief and displacement mapping
Bump Mapping CSE 781 Roger Crawfis.
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
Advanced Effects CMSC 435/634. General Approach Ray Tracing – Shoot more rays Rasterization – Render more images.
9/25/2001CS 638, Fall 2001 Today Shadow Volume Algorithms Vertex and Pixel Shaders.
CS4395: Computer Graphics 1 Bump Mapping Mohan Sridharan Based on slides created by Edward Angel.
CS 468 Cg Texture Mapping Jon Moon Spring 2004 Computer Science Cornell University.
Skin Rendering GPU Graphics Gary J. Katz University of Pennsylvania CIS 665 Adapted from David Gosselin’s Power Point and article, Real-time skin rendering,
Status – Week 277 Victor Moya.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
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.
Computer Graphics Mirror and Shadows
Week 8 - Monday.  What did we talk about last time?  Workday  Before that:  Image texturing ▪ Magnification ▪ Minification  Mipmapping  Summed area.
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.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
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.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Texture Mapping.
Texture Mapping (cont.) Jian Huang, CS 594, updated in Fall’08.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
CS 480/680 Computer Graphics Shader Applications Dr. Frederick C Harris, Jr. Fall 2011.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Eighty-color-channel lighting Zoltán Márton Cecília Sik Lányi University of Pannonia Egyetem u. 10.
Fall 2009 Revised1 Texture Mapping (Intermediate) Jyun-Ming Chen.
Game Programming 06 The Rendering Engine
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Computer Graphics 2 Lecture 7: Texture Mapping Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
CHAPTER 8 Color and Texture Mapping © 2008 Cengage Learning EMEA.
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.
Shader Applications Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Lab: Vertex Shading Chris Wynn Ken Hurley. Objective Hands-On vertex shader programming Start with simple programs … Part 1: Textured-Lit Teapot.
CS 445 / 645: Introductory Computer Graphics Review.
Pixel Shader  Based on nVIDIA’s GF3/4 architecture  Texture shader + register combiner texture unit 0texture program texture unit 1texture program texture.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
Module 05 –Bump mapping Module 05 – Bump mapping Module 05 Advanced mapping techniques: Bump mapping.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Recap Last lecture we looked at local shading models –Diffuse and Phong specular terms –Flat and smooth shading Some things were glossed over –Light source.
Texturing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Computer Graphics Overview
Ying Zhu Georgia State University
Computer Graphics Imaging
Week 7 - Monday CS361.
Programmable Pipelines
How to Bump Map a Skinned Polygonal Model
Bump Mapping -1 Three scales of detail on an object
Introduction to Computer Graphics with WebGL
Chapter 14 Shading Models.
GPU Graphics Gary J. Katz University of Pennsylvania CIS 665
Introduction to Programmable Hardware
Chapter IX Bump Mapping
Introduction to Computer Graphics with WebGL
Chapter XIV Normal Mapping
Last Time Presentation of your game and idea Environment mapping
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Game Programming Algorithms and Techniques
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

Michael I. Gold NVIDIA Corporation Emboss Bump Mapping Michael I. Gold NVIDIA Corporation

Bump Mapping Real bump mapping uses per-pixel lighting Lighting calculation at each pixel based on perturbed normal vectors Computationally expensive For more information see: Blinn, J. Simulation of Wrinkled Surfaces. Computer Graphics. 12, 3 (August 1978), 286-292

Emboss Bump Mapping Emboss bump mapping is a hack Diffuse lighting only, no specular component Under-sampling artifacts Possible on today’s consumer hardware If it looks good, do it!

Diffuse Lighting Calculation C = (L•N)  Dl  Dm L is light vector N is normal vector Dl is light diffuse color Dm is material diffuse color Bump mapping changes N per pixel Emboss bump mapping approximates (L•N)

Approximate diffuse factor L•N Texture map represent height field [0,1] height represents range of bump function First derivative represents slope m m increases/decreases base diffuse factor Fd (Fd+m) approximates (L•N) per pixel

Approximate derivative Embossing approximates derivative Lookup height H0 at point (s,t) Lookup height H1 at point slightly perturbed toward light source (s+s, t+t) subtract original height H0 from perturbed height H1 difference represents instantaneous slope m=H1-H0

Compute the Bump Original bump (H0) Original bump (H0) overlaid with second bump (H1) perturbed toward light source brightens image darkens image Subtract original bump from second (H1-H0)

Compute the Lighting Evaluate fragment color Cf Cf = (L•N)  Dl  Dm (L•N)  (Fd + (H1-H0)) Dm  Dl encoded in surface texture color Ct Could control Dl seperately if you’re clever Cf = (Fd + (H1-H0))  Ct

Is that all? Its so easy! We’re not quite done yet. We still must Build a texture Calculate texture coordinate offsets s, t Calculate diffuse factor Fd Both are derived from normal N and light vector L Now we have to do some math

Building a Texture Conserve Textures! Current multitexture hardware only supports two textures Bump map in ALPHA channel Maximum bump = 1.0 Level ground = 0.5 Maximum depression = 0.0 Surface color in RGB channels Set internalformat to RGBA8 !!

Calculate Texture Offsets Rotate light vector into normal space Need Normal coordinate system Derive coordinate system from normal and “up” vector Normal is z-axis Cross product is x-axis Throw away up vector, derive y-axis as cross product of x- and z-axes Build 3x3 matrix from axes Transform light vector into Normal space

Calc Texture Offsets (cont’d) Use normal-space light vector for offsets L’ = Mn  L Use L’x, L’y for s, t Use L’z for diffuse factor! If light vector is near normal, L’x, L’y are small If light vector is near tangent plane, L’x and L’y are large What is L’z is less than zero? Light is on opposite side from normal Fade contribution toward zero

Implementation on TNT Calculate vectors, texcoords on the host Pass diffuse factor as vertex alpha Could use vertex color for light diffuse color H0 and surface color from texture unit 0 H1 from texture unit 1 (same texture, different coordinates) ARB_multitexture extension Combiners extension (TBD)

Implementation on TNT (cont’d) Combiner 0 alpha setup: (1-T0a) + T1a - 0.5 T1a-T0a maps to [-1,1] but hardware clamps to [0,1] 0.5 bias balances the loss from clamping Could modulate light diffuse color with T0c Combiner 1 rgb setup (T0c*C0a + T0c*Fda - 0.5) * 2 scale by 2 brightens the image