How to Bump Map a Skinned Polygonal Model

Slides:



Advertisements
Similar presentations
16.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 16 – Some Special Rendering Effects.
Advertisements

COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
Normal Map Compression with ATI 3Dc™ Jonathan Zarge ATI Research Inc.
Michael I. Gold NVIDIA Corporation
Topics in Computer Graphics Spring Application.
Exploration of bump, parallax, relief and displacement mapping
Bump Mapping CSE 781 Roger Crawfis.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
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
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.
Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova.
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering Cass Everitt and Mark J. Kilgard Speaker: Alvin Date: 5/28/2003 NVIDIA.
(conventional Cartesian reference system)
Status – Week 277 Victor Moya.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
SET09115 Intro Graphics Programming
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Computer Graphics Inf4/MSc Computer Graphics Lecture 7 Texture Mapping, Bump-mapping, Transparency.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
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.
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.
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.
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.
TERRAIN SET09115 Intro to Graphics Programming. Breakdown  Basics  What do we mean by terrain?  How terrain rendering works  Generating terrain 
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
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.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
CSE 381 – Advanced Game Programming GLSL Lighting.
Game Programming 06 The Rendering Engine
Computing & Information Sciences Kansas State University Lecture 10 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
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.
BUMP-MAPPING SET09115 Intro to Graphics Programming.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
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.
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Ying Zhu Georgia State University
Texture Mapping Fall, 2016.
Computer Graphics Chapter 9 Rendering.
© University of Wisconsin, CS559 Spring 2004
Game Programming (Mapping)
Carl Johan Gribel, PhD student
3D Graphics Rendering PPT By Ricardo Veguilla.
Bump Mapping -1 Three scales of detail on an object
CSC461: Lecture 23 Shading Computation
Vectors, Normals, & Shading
© University of Wisconsin, CS559 Fall 2004
Chapter IX Bump Mapping
UMBC Graphics for Games
Chapter XIV Normal Mapping
CS5500 Computer Graphics May 29, 2006
CS-378: Game Technology Lecture #4: Texture and Other Maps
Last Time Presentation of your game and idea Environment mapping
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

How to Bump Map a Skinned Polygonal Model Stanford Shading Group presentation May 8, 2000 (updated) How to Bump Map a Skinned Polygonal Model

Mark J. Kilgard Graphics Software Engineer NVIDIA Corporation

Real Bump Mapping is Practical and Robust Today NVIDIA GPU bump mapping is fast and good Better than “pseudo” bump mapping techniques such as embossing and DX6 BumpEnv See whitepaper “A Practical and Robust Bump-mapping Technique for Today’s GPUs” in Advanced OpenGL Game Development course notes On NVIDIA’s web site, www.nvidia.com/Developer I fully expect other hardware vendors to expose similar techniques based on the same basic math

The NVIDIA GPU Bump Mapping Technique Technique Details Requires NVIDIA GPU features of GeForce/Quadro NV_register_combiners EXT_texture_cube_map ARB_multitexture Tangent space formulation Ambient, diffuse, and specular contributions Robust filtering, self-shadowing, local viewer and light Three passes for full effect with texture decal

The “bumpdemo” Torus Example A nice shiny bump mapped torus

Anatomy of the technique Three passes (or just two if no specular)  + diffuse specular decal

The Big Issue Can I bump map more than a torus? The torus has the advantage of having a nice parametric representation for orienting tangent space partial derivatives in terms of parametric variables exist Games tend to use ad hoc polygonal models no explicit parametric basis available but game models do have textured decal “skins” Insight: infer an ad hoc tangent space from the model’s mapping between vertices and skin texture coordinates!

Skinned Polygonal Models Example: Quake 2 models in the “.md2” format Decal skin texture, typically 128x128 linear filtered Shared vertex list each vertex has (s,t) texture coordinate into the skin A set of key frames each triangle is three vertex indices each frame vertex is (x,y,z) and a quantized normal Low polygon count, usually 400-800 polygons per model

Quake 2 Models Piece by Piece Model Key Frames Quake 2 interpolates between key frames

Quake 2 Models Piece by Piece Knight model’s decal skin Texture coordinates map triangles to skin. Note clever packing of decal skin. Only half face because triangles “mirror” the face.

Standard Quake 2 Model Rendering Texture key-frame with decal skin + Key-frame model geometry Decal skin Result

GPU Bump-mapped Quake 2 Model Rendering! Bump-map model with bump, gloss, & decal skin Bump skin + Key-frame model geometry WOW! Result Gloss skin Decal skin

Quake 2 Bump Mapping Rendering Passes   ( ) + ( ) = Diffuse Decal Specular Gloss Final result!

More Bump-mapped Knight Examples Different light positions and key-frames All lighting including specular is computed per-fragment!

Bump Mapping Models Viva la difference

What is tangent space? Very important concept It is a coordinate space that varies over a rendered object Assumes the (unperturbed) surface normal is always (0, 0, 1) but that’s not enough to define a coordinate system needs a tangent vector in the plane of the surface to orient the coordinate system Tangent space is very convenient for lighting with a perturbed normal very good for bump mapping

More about tangent space Normals, tangents, and binormals Say the surface is defined by a bivariate vector parametric equation, (x, y, z) = F(u, v) The tangent is the normalized vector (x/ u, y/ u, z/ u) The normal is the cross product of the tangent vector and the normalized vector (x/ v, y/ v, z/ v) The binormal is the cross product of the tangent and normal The tangent, binormal, and normal form an orthonormal basis in English, that’s a coordinate system

Parametric Approach to Tangent Space Forming tangent space It is easy with an explicit parametric representation such as a torus Just compute the vectors from the previous slide from the parametric representation To be practical, we just compute a tangent space basis at vertices assumes reasonable tessellation around curvature

Tangent Space Basis is a Gateway for Vectors Object-space vector to tangent-space Ltx Lty Ltz = Lox Loy Loz Tx Ty Tz Bx By Bz Nx Ny Nz How to transform a light vector in object space to tangent space

Skinned Polygonal Models Each vertex consists of (x, y, z) object-space position corresponding (s, t) on the skin texture And each triangle in the model has three such vertices Insight! Per polygon, compute the following plane equations A0 x + B0 s + C0 t + D0 = 0 A1 y + B1 s + C1 t + D1 = 0 A2 z + B2 s + C2 t + D2 = 0

Compute Partial Derivatives form Polygon Plane Equations Make a per-polygon tangent and binormal tangent is normalization of (x/ s, y/ s, z/ s) or normalization of ( -B0/A0, -B1/A1, -B2/A1 ) binormal is normalization of (x/ t, y/ t, z/ t) or normalization of ( -C0/A0, -C1/A1, -C2/A1 ) normal is the cross product of the tangent and binormal important! you need to invert the sign if the area of the triangle in texture space is opposite of the area of the triangle in object space

Apply the GPU Bump Map Technique The approach Compute tangent space on a polygon-by-polygon basis To match the per-vertex lighting on flat surface resize the normal, binormal, and tangent vectors to match the model’s per-vertex normal in tangent space Use this 3x3 matrix to transform object-space light and half- angle vectors into object space Perform the GPU bump map technique

Bump skin height-field Painting the Bump Skin Example for the knight Same topology as decal skin, easy-to-author Bump skin height-field Decal skin

Warning about Pre-lit Decal Skins Most Quake 2 decal skins are “pre-lit” Skins for bump mapping should encode materials, not colors because bump mapping supplies the per-pixel lighting! so eliminate pre-lighting from decal skins otherwise, you get double lighting

Decal Skin Comparison Pre-lit skins versus non-pre-lit skins Original pre-lit knight decal skin Modified “un-lit” knight decal skin for bump mapping

Gloss Map Modulates Per-fragment Specular Alpha channel of decal hides “free” gloss map Per-fragment modulation of specular pass Used on knight to avoid shiny face, belt, and cloth Same skin topology as other maps Decal skin Gloss skin

Assumptions Things that should be approximately true The normal and binormal are not guaranteed to be orthogonal but hopefully will be close since artists would otherwise be working on contorted skins (so ok assumption) Model is reasonably tessellated, particularly in regions of high curvature change (usually ok assumption) Good continuity of light and half-angle tangent-space vectors across polygons (poor assumption)

Tangent Space Vector Continuity Visualizing this assumption, not that good tangent space light vector tangent space half-angle vector

Worst-case Tangent Vector Discontinuities Change across polygons A B A B polygons in object space polygons in skin texture space arrows indicate increasing t texture coordinate

Tangent Continuity Solutions Reorient and repack all polygons in skin textures

Bump-mapped Skinned Polygonal Models More examples

Credits Where credit is due Sim Dietrich and Doug Rogers invented the idea of creating an ad-hoc tangent space from skinned polygonal models Cass Everitt developed the bump skin re-packing technique Quake 2 .md2 models designed by faerie model, Brian Collins alien model, RichB Boba Fett model, Dan Bickell Perelith Knight model, James Green