SlideShare a Scribd company logo
A Practical and Robust Bump-mapping Technique for Today’s GPUs Stanford Shading Group presentation May 8, 2000
Mark J. Kilgard Graphics Software Engineer NVIDIA Corporation
“Hardware Bump Mapping” mostly hype so far Previous techniques Prone to aliasing artifacts Do not correctly handle surface self-shadowing Cut too many corners, i.e. fail to renormalize, etc. Too expensive: many passes (OIM), needs accumulation buffer or glCopyPixels Only handle infinite, non-attenuated, non-spotlight lights Assume local viewer Correct only for essentially flat surfaces Difficult to implement and author
Example
Overview of the Technique Uses new NVIDIA GPU features Cube maps - for per-pixel normalization EXT_texture_cube_map extension Register combiners - for per-pixel dot products and additional math NV_register_combiners And dual-textured - for normalization cube map and 2D normal map ARB_multitexture
Features of the technique Correctly handles Surface self-shadowing for both diffuse and specular contributions Diffuse minification so that bumped objects in the distance look dimmer than equivalent smooth distant objects Mipmap filtering of normal maps minimizes aliasing Local, attenuated, and/or spot-light light sources with local viewer Ambient and surface decals
Anatomy of the technique Three passes (or just two if no specular)  + diffuse decal specular
High-level view Tangent space per-pixel lighting [Peercy 97] CPU supplies tangent space light vector or half-angle vector as (s,t,r) texture coordinates linearly interpolated normalized by an RGB8 cube map texture Normal map is RGBA8 2D texture RGB contains “compressed” normalized perturbed normal Alpha contains averaged normal shortening But no hard-wired per-pixel “lighting engine”!
Per-pixel lighting building blocks Cube maps enable per-pixel vector normalization Cube map normalizes interpolated (s,t,r) into RGB (s,t,r) is interpolated per-vertex light  or half-angle vector Combiners  expand RGB from [0,1] range to [-1,1] range expansion done by register combiners Optimization :  If infinite viewer or infinite light used, half-angle can be computed within the cube map! 32x32x6 RGB8 cube map texture is sufficient
Per-pixel lighting building blocks Register combiners perform per-pixel math Signed math for dot products L dot N’ for diffuse, H dot N’ for Blinn specular L and H properly normalized by cube map Pre-normalized N’ supplied by normal map Uses tangent space L z  for geometric surface self-shadowing Constant color for adding in ambient contribution Successive squaring for specular exponent
Surface self-shadowing Two kinds of self-shadowing max(0, L dot N’) based on the perturbed normal Also should clamp when L dot N goes negative! L N N’ L N’ N Surface  should self-shadow due to perturbed normal, I.e., L dot N’<0 Surface  should self-shadow due to unperturbed normal, I.e., L dot N<0
Surface self-shadowing Self-shadowing computation Technique supports bumped self-shadowing by computing   min(8*max(0,Lz), 1) * max(0, L dot N’) Also stashes this self-shadowing term in destination alpha   min(8*max(0,Lz), 1)  Specular pass blends with DST_ALPHA,ONE computing   min(8*max(0,Lz), 1)  * max(0, H dot N’)^8 Illumination does not appear on geometric “back side” Steep ramp avoids winking and popping at self-shadow boundary
Complete lighting model More per-pixel math than you might think! Ambient = constant Diffuse = min(8*max(0,Lz), 1) * max(0, L dot N’) Specular = min(8*max(0,Lz), 1)  * max(0, H dot N’)^8 Final = (Diffuse + Ambient) * Decal + Specular Attenuation and/or spotlight Final = (Attenuate*Diffuse + Ambient) * Decal + Attenuate*Specular
Self-shadowing example Light leaks onto torus “back side” due to bad geometric self-shadowing Proper geometric self-shadowing!
Some CPU work required Per-vertex work Model requires per-vertex tangent space basis any bump mapping scheme needs surface normals (N), tangents (T), and binormals (B) If light or viewer (in the specular case) changes relative to the object, CPU re-compute tangent space light and half-angle Transform object-space vector by [ T B N ] 3x3 matrix Nice split:  CPU does per-vertex work, GPU does transform and per-pixel work
Normal Map Filtering Issues Normal map filtering is important Consider two objects in the distance chalk golf ball (diffuse, bumpy) smooth chalk ball (diffuse, but not bumpy) bumpy ball should look dimmer How to properly account for this? Corresponds to heavy minification of the normal map would imply sub-fragment lighting
Sub-fragment diffuse lighting If expense was inconsequential Light every normal in fragment’s normal map footprint filter the result too expensive, so make an approximation
Examining the Approximation Works in important cases true if no L  N terms are clamped true if all L  N terms are clamped inaccurate when mixture of self-shadowing and not worst case: highly distributed normals case, often rare
Diffuse Normal Map Filtering Simpler than you think Simply average normals in the normal map minified normals are often denormalized do NOT renormalize Better than hyper-tessellation and per-vertex lighting hyper-tessellation cannot simulate sub-pixel lighting without sub-pixel rendering Issue: mipmap bleeding possible solution: borders and LOD clamping
Sub-fragment Specular Lighting Again, if expense was inconsequential Light every normal in fragment’s normal map footprint filter the result too expensive, but what approximation?
Attempting a Specular Approximation Why specular approximation is hard specular exponent cannot be factored out specular exponent needs H    N to be 1.0 when H and N are coincident an issue if N is de-normalized if length of N is too short, specular term never “glints” Known issue, see [Fournier 92] and [Schilling 97] current solutions too expensive for hardware
Specular Filtering Stand-in Same as diffuse filtering, but re-normalize About the best we can do Like [Fournier 92] approximation, just one “surface”
Single Filtered Normal Map Texture Combines diffuse and specular filtering Keep normalized filtered normal in (R,G,B) Use (R,G,B) directly for specular Keep de-normalization factor in A Scale (R,G,B) by A for diffuse Efficient since RGB 24-bit texel format is often padded out to 32-bit RGBA texel format for nice word accesses
Issues Truth in advertising Specular exponent only 8 so not too shiny banding evident in specular highlights, though easy to hide artifacts in surface decal and diffuse contribution Perturbed normal slightly de-normalized by filtering causes very slight dimming, alternative is aliasing most objectionable when magnifying, “grated” look Not “bumped environment mapping” but DX6 bump-env support is a joke Requires GeForce 256, Quadro, or any future NVIDIA GPU
Claim: practical Justification for this claim Real-time frame rates on current generation GPUs tweakable: eliminate specular or decal pass, etc. Mixable with other multi-pass rendering techniques stenciled shadows, multiple lights, fog, etc. Bump map easy to author as an 8-bit gray-scale image examples:
Claim: robust Justification for this claim Animates with minimal temporal aliasing Models both self-shadowing terms, including for specular Diffuse illumination filtered reasonably Light and half-angle vectors renormalized per-pixel Local, attenuated, and spot-light light sources Local viewer Overall, very reasonable fidelity to Blinn’s original formulation
Source available on the web already Bumpdemo source code Go to www.nvidia.com Developer Section http://www.nvidia.com/developer.nsf/htmlmedia/devMainFR_top.html Find and download bumpdemo.zip requires GeForce 256 or Quadro to run Also download “NVIDIA OpenGL Extension Specifications” nvOpenGLspecs.pdf Adobe Acrobat, 197 pages documents OpenGL extensions used by bumpdemo
Other novel uses for cube mapping Stable specular highlights Encode specular & diffuse lighting solution Diffuse cube map using  normal  map texgen Specular cube map using  reflection  map texgen Encode unlimited number of directional lights Result is stable specular highlights Less significant for diffuse lighting Average of dot products    dot product of averages Excepting clamping
Example for stable specular highlights Bright, stable specular highlight, even at low tessellation. Poor per-vertex sampling of the highlight. Wobbles during animation. Cube map lighting Standard per-vertex lighting
Another example of stable specular highlights High tessellation does not completely fix per-vertex artifacts Still bright and stable. Better sampled, but still has streaky artifacts.
Per-pixel specular normal mapping Assumes fancy per-pixel dot product operations! Cube map encodes normalized half-angle  Texgen supplies view vector Cube map generates normalize(V+L) vector Another 2D texture supplies per-pixel surface normals Per-pixel specular lighting  Per-pixel “normalized(V+L) dot N” ! Still more novel uses for cube maps & combiners
One pass per-pixel diffuse & specular example! OpenGL per-vertex lighting with mesh of thousands of vertices (note displacement). Per-pixel specular normal mapping with cube maps (flat, but lighting all there).
Example in wireframe Dense, dense mesh. One polygon!
Object-space per-pixel lighting example
Object-space per-pixel example in wire-frame The detail is per-pixel!
Register combiners overview overrides texture stages/environment, color sum, and fog in current APIs signed math (negative one to positive range) extended range through scaling dot products for lighting and image processing applications designed for specular, diffuse, and ambient per-pixel lighting object space bump map lighting tangent space bump map lighting post-filtering 3x3 color matrix for color space conversions register model supports non-linear data flows superior to linear chain in current APIs effectively, a VLIW instruction set for fragment coloring very efficient hardware implementation
Register combiners operational overview general combiner stages final combiner RGB Portion Alpha Portion initialize registers stage #0 stage #1 (optional) AB+CD, AB, CD AB+CD, AB, CD AB+CD, AB, CD AB+CD, AB, CD AB+(1-A)C+D, EF, G RGBA fragment
General combiners  RGB operation zero primary color secondary color constant color 0 constant color 1 fog spare 1 spare 0 texture 0 texture 1 A B C D input map input map input map not writeable RGB A RGB A input registers computations output registers scale and bias input map not readable zero primary color secondary color constant color 0 constant color 1 fog spare 1 spare 0 texture 0 texture 1 A B + C D A B mux C D -or- A B A    B -or- C    D C D -or-
General combiners Alpha operation zero primary color secondary color constant color 0 constant color 1 fog spare 1 spare 0 texture 0 texture 1 A B C D A B C D input map input map input map not writeable RGB A RGB A input registers computations output registers scale and bias input map not readable zero primary color secondary color constant color 0 constant color 1 fog spare 1 spare 0 texture 0 texture 1 A B + C D A B mux C D -or-
Final combiner operation zero primary color secondary color constant color 0 constant color 1 fog spare 1 spare 0 texture 0 texture 1 A B C D RGB A input registers computations A B + ( 1 - A) C + D E F E F G spare 0 + secondary color input map input map input map input map input map input map input map fragment RGB out fragment Alpha out G

More Related Content

PPT
Shadow Techniques for Real-Time and Interactive Applications
PPT
Shadow Mapping with Today's OpenGL Hardware
PPT
Real-time Shadowing Techniques: Shadow Volumes
PPTX
Robust Stenciled Shadow Volumes
PPTX
565 Alpha Chun-Fu Chao
PPTX
Shiny Pixels and Beyond: Real-Time Raytracing at SEED
PPT
Secrets of CryENGINE 3 Graphics Technology
PDF
Deferred Rendering in Killzone 2
Shadow Techniques for Real-Time and Interactive Applications
Shadow Mapping with Today's OpenGL Hardware
Real-time Shadowing Techniques: Shadow Volumes
Robust Stenciled Shadow Volumes
565 Alpha Chun-Fu Chao
Shiny Pixels and Beyond: Real-Time Raytracing at SEED
Secrets of CryENGINE 3 Graphics Technology
Deferred Rendering in Killzone 2

What's hot (20)

PPTX
Deferred shading
PPTX
Global illumination
PPTX
PPTX
Calibrating Lighting and Materials in Far Cry 3
PPT
The Unique Lighting of Mirror's Edge
PPTX
The Rendering Technology of Killzone 2
PPTX
Physically Based and Unified Volumetric Rendering in Frostbite
PPT
Light prepass
PPTX
Around the World in 80 Shaders
PPT
Bending the Graphics Pipeline
PDF
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering
PDF
Deferred shading
PPT
CS 354 Shadows
PPT
Interactive Refractions And Caustics Using Image Space Techniques
PDF
Authoring of procedural rocks in The Blacksmith realtime short
PPT
Paris Master Class 2011 - 07 Dynamic Global Illumination
PPTX
Photogrammetry and Star Wars Battlefront
PDF
Introduction to Global Illumination by Aryo
PPTX
Lighting you up in Battlefield 3
PPT
Advanced Real-time Post-Processing using GPGPU techniques
Deferred shading
Global illumination
Calibrating Lighting and Materials in Far Cry 3
The Unique Lighting of Mirror's Edge
The Rendering Technology of Killzone 2
Physically Based and Unified Volumetric Rendering in Frostbite
Light prepass
Around the World in 80 Shaders
Bending the Graphics Pipeline
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering
Deferred shading
CS 354 Shadows
Interactive Refractions And Caustics Using Image Space Techniques
Authoring of procedural rocks in The Blacksmith realtime short
Paris Master Class 2011 - 07 Dynamic Global Illumination
Photogrammetry and Star Wars Battlefront
Introduction to Global Illumination by Aryo
Lighting you up in Battlefield 3
Advanced Real-time Post-Processing using GPGPU techniques
Ad

Viewers also liked (9)

PDF
A Practical and Robust Bump-mapping Technique for Today’s GPUs (paper)
PDF
Next-Gen shaders (2008)
PDF
SXSW 2012 - NFC: i'd Bump That
PDF
Smart Bump Presentation
PPTX
BUMP - an Arts & Sciences Exhibit
PPT
Geometry Shader-based Bump Mapping Setup
PPT
Bump mapping Techniques
PDF
ANSYS RedHawk-CPA: New Paradigm for Faster Chip-Package Convergence
PPTX
Slideshare ppt
A Practical and Robust Bump-mapping Technique for Today’s GPUs (paper)
Next-Gen shaders (2008)
SXSW 2012 - NFC: i'd Bump That
Smart Bump Presentation
BUMP - an Arts & Sciences Exhibit
Geometry Shader-based Bump Mapping Setup
Bump mapping Techniques
ANSYS RedHawk-CPA: New Paradigm for Faster Chip-Package Convergence
Slideshare ppt
Ad

Similar to A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides) (20)

PDF
reflective bump environment mappings.pdf
PPT
Advanced Lighting for Interactive Applications
PPTX
Normal Mapping / Computer Graphics - IK
PPT
GRPHICS07 - Textures
PPT
Paris Master Class 2011 - 04 Shadow Maps
PPT
CS 354 Lighting
PPTX
Real-time lightmap baking
PPTX
computergrapgichiddensurfacemethodes.pptx
PPT
Advanced Lighting Techniques Dan Baker (Meltdown 2005)
PPT
Probabilistic Approaches to Shadow Maps Filtering
PDF
Taking Killzone Shadow Fall Image Quality Into The Next Generation
PPT
Praseed Pai
PPT
Extended Light Maps
PPT
Lighting and shading
PDF
Computer Graphics Part1
PPTX
Massive Point Light Soft Shadows
PPTX
Green Custard Friday Talk 17: Ray Tracing
PPT
Topic 6 Graphic Transformation and Viewing.ppt
PPTX
Trident International Graphics Workshop 2014 4/5
PPT
Single Sample Soft Shadows Using Depth Maps
reflective bump environment mappings.pdf
Advanced Lighting for Interactive Applications
Normal Mapping / Computer Graphics - IK
GRPHICS07 - Textures
Paris Master Class 2011 - 04 Shadow Maps
CS 354 Lighting
Real-time lightmap baking
computergrapgichiddensurfacemethodes.pptx
Advanced Lighting Techniques Dan Baker (Meltdown 2005)
Probabilistic Approaches to Shadow Maps Filtering
Taking Killzone Shadow Fall Image Quality Into The Next Generation
Praseed Pai
Extended Light Maps
Lighting and shading
Computer Graphics Part1
Massive Point Light Soft Shadows
Green Custard Friday Talk 17: Ray Tracing
Topic 6 Graphic Transformation and Viewing.ppt
Trident International Graphics Workshop 2014 4/5
Single Sample Soft Shadows Using Depth Maps

More from Mark Kilgard (20)

PDF
D11: a high-performance, protocol-optional, transport-optional, window system...
PPT
Computers, Graphics, Engineering, Math, and Video Games for High School Students
PPT
NVIDIA OpenGL and Vulkan Support for 2017
PPT
NVIDIA OpenGL 4.6 in 2017
PPT
NVIDIA OpenGL in 2016
PPT
Virtual Reality Features of NVIDIA GPUs
PPTX
Migrating from OpenGL to Vulkan
PPT
EXT_window_rectangles
PPT
OpenGL for 2015
PPT
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
PDF
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
PPT
NV_path rendering Functional Improvements
PPTX
OpenGL 4.5 Update for NVIDIA GPUs
PPT
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
PPT
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
PDF
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...
PPT
GPU accelerated path rendering fastforward
PDF
GPU-accelerated Path Rendering
PPT
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
PPT
SIGGRAPH 2012: NVIDIA OpenGL for 2012
D11: a high-performance, protocol-optional, transport-optional, window system...
Computers, Graphics, Engineering, Math, and Video Games for High School Students
NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL in 2016
Virtual Reality Features of NVIDIA GPUs
Migrating from OpenGL to Vulkan
EXT_window_rectangles
OpenGL for 2015
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
NV_path rendering Functional Improvements
OpenGL 4.5 Update for NVIDIA GPUs
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...
GPU accelerated path rendering fastforward
GPU-accelerated Path Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: NVIDIA OpenGL for 2012

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Electronic commerce courselecture one. Pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPT
Teaching material agriculture food technology
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Advanced IT Governance
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
Unlocking AI with Model Context Protocol (MCP)
NewMind AI Monthly Chronicles - July 2025
Electronic commerce courselecture one. Pdf
The AUB Centre for AI in Media Proposal.docx
Machine learning based COVID-19 study performance prediction
Dropbox Q2 2025 Financial Results & Investor Presentation
Spectral efficient network and resource selection model in 5G networks
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Mobile App Security Testing_ A Comprehensive Guide.pdf
Teaching material agriculture food technology
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Advanced IT Governance
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
NewMind AI Weekly Chronicles - August'25 Week I
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced Soft Computing BINUS July 2025.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Chapter 3 Spatial Domain Image Processing.pdf
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Understanding_Digital_Forensics_Presentation.pptx

A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)

  • 1. A Practical and Robust Bump-mapping Technique for Today’s GPUs Stanford Shading Group presentation May 8, 2000
  • 2. Mark J. Kilgard Graphics Software Engineer NVIDIA Corporation
  • 3. “Hardware Bump Mapping” mostly hype so far Previous techniques Prone to aliasing artifacts Do not correctly handle surface self-shadowing Cut too many corners, i.e. fail to renormalize, etc. Too expensive: many passes (OIM), needs accumulation buffer or glCopyPixels Only handle infinite, non-attenuated, non-spotlight lights Assume local viewer Correct only for essentially flat surfaces Difficult to implement and author
  • 5. Overview of the Technique Uses new NVIDIA GPU features Cube maps - for per-pixel normalization EXT_texture_cube_map extension Register combiners - for per-pixel dot products and additional math NV_register_combiners And dual-textured - for normalization cube map and 2D normal map ARB_multitexture
  • 6. Features of the technique Correctly handles Surface self-shadowing for both diffuse and specular contributions Diffuse minification so that bumped objects in the distance look dimmer than equivalent smooth distant objects Mipmap filtering of normal maps minimizes aliasing Local, attenuated, and/or spot-light light sources with local viewer Ambient and surface decals
  • 7. Anatomy of the technique Three passes (or just two if no specular)  + diffuse decal specular
  • 8. High-level view Tangent space per-pixel lighting [Peercy 97] CPU supplies tangent space light vector or half-angle vector as (s,t,r) texture coordinates linearly interpolated normalized by an RGB8 cube map texture Normal map is RGBA8 2D texture RGB contains “compressed” normalized perturbed normal Alpha contains averaged normal shortening But no hard-wired per-pixel “lighting engine”!
  • 9. Per-pixel lighting building blocks Cube maps enable per-pixel vector normalization Cube map normalizes interpolated (s,t,r) into RGB (s,t,r) is interpolated per-vertex light or half-angle vector Combiners expand RGB from [0,1] range to [-1,1] range expansion done by register combiners Optimization : If infinite viewer or infinite light used, half-angle can be computed within the cube map! 32x32x6 RGB8 cube map texture is sufficient
  • 10. Per-pixel lighting building blocks Register combiners perform per-pixel math Signed math for dot products L dot N’ for diffuse, H dot N’ for Blinn specular L and H properly normalized by cube map Pre-normalized N’ supplied by normal map Uses tangent space L z for geometric surface self-shadowing Constant color for adding in ambient contribution Successive squaring for specular exponent
  • 11. Surface self-shadowing Two kinds of self-shadowing max(0, L dot N’) based on the perturbed normal Also should clamp when L dot N goes negative! L N N’ L N’ N Surface should self-shadow due to perturbed normal, I.e., L dot N’<0 Surface should self-shadow due to unperturbed normal, I.e., L dot N<0
  • 12. Surface self-shadowing Self-shadowing computation Technique supports bumped self-shadowing by computing min(8*max(0,Lz), 1) * max(0, L dot N’) Also stashes this self-shadowing term in destination alpha min(8*max(0,Lz), 1) Specular pass blends with DST_ALPHA,ONE computing min(8*max(0,Lz), 1) * max(0, H dot N’)^8 Illumination does not appear on geometric “back side” Steep ramp avoids winking and popping at self-shadow boundary
  • 13. Complete lighting model More per-pixel math than you might think! Ambient = constant Diffuse = min(8*max(0,Lz), 1) * max(0, L dot N’) Specular = min(8*max(0,Lz), 1) * max(0, H dot N’)^8 Final = (Diffuse + Ambient) * Decal + Specular Attenuation and/or spotlight Final = (Attenuate*Diffuse + Ambient) * Decal + Attenuate*Specular
  • 14. Self-shadowing example Light leaks onto torus “back side” due to bad geometric self-shadowing Proper geometric self-shadowing!
  • 15. Some CPU work required Per-vertex work Model requires per-vertex tangent space basis any bump mapping scheme needs surface normals (N), tangents (T), and binormals (B) If light or viewer (in the specular case) changes relative to the object, CPU re-compute tangent space light and half-angle Transform object-space vector by [ T B N ] 3x3 matrix Nice split: CPU does per-vertex work, GPU does transform and per-pixel work
  • 16. Normal Map Filtering Issues Normal map filtering is important Consider two objects in the distance chalk golf ball (diffuse, bumpy) smooth chalk ball (diffuse, but not bumpy) bumpy ball should look dimmer How to properly account for this? Corresponds to heavy minification of the normal map would imply sub-fragment lighting
  • 17. Sub-fragment diffuse lighting If expense was inconsequential Light every normal in fragment’s normal map footprint filter the result too expensive, so make an approximation
  • 18. Examining the Approximation Works in important cases true if no L  N terms are clamped true if all L  N terms are clamped inaccurate when mixture of self-shadowing and not worst case: highly distributed normals case, often rare
  • 19. Diffuse Normal Map Filtering Simpler than you think Simply average normals in the normal map minified normals are often denormalized do NOT renormalize Better than hyper-tessellation and per-vertex lighting hyper-tessellation cannot simulate sub-pixel lighting without sub-pixel rendering Issue: mipmap bleeding possible solution: borders and LOD clamping
  • 20. Sub-fragment Specular Lighting Again, if expense was inconsequential Light every normal in fragment’s normal map footprint filter the result too expensive, but what approximation?
  • 21. Attempting a Specular Approximation Why specular approximation is hard specular exponent cannot be factored out specular exponent needs H  N to be 1.0 when H and N are coincident an issue if N is de-normalized if length of N is too short, specular term never “glints” Known issue, see [Fournier 92] and [Schilling 97] current solutions too expensive for hardware
  • 22. Specular Filtering Stand-in Same as diffuse filtering, but re-normalize About the best we can do Like [Fournier 92] approximation, just one “surface”
  • 23. Single Filtered Normal Map Texture Combines diffuse and specular filtering Keep normalized filtered normal in (R,G,B) Use (R,G,B) directly for specular Keep de-normalization factor in A Scale (R,G,B) by A for diffuse Efficient since RGB 24-bit texel format is often padded out to 32-bit RGBA texel format for nice word accesses
  • 24. Issues Truth in advertising Specular exponent only 8 so not too shiny banding evident in specular highlights, though easy to hide artifacts in surface decal and diffuse contribution Perturbed normal slightly de-normalized by filtering causes very slight dimming, alternative is aliasing most objectionable when magnifying, “grated” look Not “bumped environment mapping” but DX6 bump-env support is a joke Requires GeForce 256, Quadro, or any future NVIDIA GPU
  • 25. Claim: practical Justification for this claim Real-time frame rates on current generation GPUs tweakable: eliminate specular or decal pass, etc. Mixable with other multi-pass rendering techniques stenciled shadows, multiple lights, fog, etc. Bump map easy to author as an 8-bit gray-scale image examples:
  • 26. Claim: robust Justification for this claim Animates with minimal temporal aliasing Models both self-shadowing terms, including for specular Diffuse illumination filtered reasonably Light and half-angle vectors renormalized per-pixel Local, attenuated, and spot-light light sources Local viewer Overall, very reasonable fidelity to Blinn’s original formulation
  • 27. Source available on the web already Bumpdemo source code Go to www.nvidia.com Developer Section http://www.nvidia.com/developer.nsf/htmlmedia/devMainFR_top.html Find and download bumpdemo.zip requires GeForce 256 or Quadro to run Also download “NVIDIA OpenGL Extension Specifications” nvOpenGLspecs.pdf Adobe Acrobat, 197 pages documents OpenGL extensions used by bumpdemo
  • 28. Other novel uses for cube mapping Stable specular highlights Encode specular & diffuse lighting solution Diffuse cube map using normal map texgen Specular cube map using reflection map texgen Encode unlimited number of directional lights Result is stable specular highlights Less significant for diffuse lighting Average of dot products  dot product of averages Excepting clamping
  • 29. Example for stable specular highlights Bright, stable specular highlight, even at low tessellation. Poor per-vertex sampling of the highlight. Wobbles during animation. Cube map lighting Standard per-vertex lighting
  • 30. Another example of stable specular highlights High tessellation does not completely fix per-vertex artifacts Still bright and stable. Better sampled, but still has streaky artifacts.
  • 31. Per-pixel specular normal mapping Assumes fancy per-pixel dot product operations! Cube map encodes normalized half-angle Texgen supplies view vector Cube map generates normalize(V+L) vector Another 2D texture supplies per-pixel surface normals Per-pixel specular lighting Per-pixel “normalized(V+L) dot N” ! Still more novel uses for cube maps & combiners
  • 32. One pass per-pixel diffuse & specular example! OpenGL per-vertex lighting with mesh of thousands of vertices (note displacement). Per-pixel specular normal mapping with cube maps (flat, but lighting all there).
  • 33. Example in wireframe Dense, dense mesh. One polygon!
  • 35. Object-space per-pixel example in wire-frame The detail is per-pixel!
  • 36. Register combiners overview overrides texture stages/environment, color sum, and fog in current APIs signed math (negative one to positive range) extended range through scaling dot products for lighting and image processing applications designed for specular, diffuse, and ambient per-pixel lighting object space bump map lighting tangent space bump map lighting post-filtering 3x3 color matrix for color space conversions register model supports non-linear data flows superior to linear chain in current APIs effectively, a VLIW instruction set for fragment coloring very efficient hardware implementation
  • 37. Register combiners operational overview general combiner stages final combiner RGB Portion Alpha Portion initialize registers stage #0 stage #1 (optional) AB+CD, AB, CD AB+CD, AB, CD AB+CD, AB, CD AB+CD, AB, CD AB+(1-A)C+D, EF, G RGBA fragment
  • 38. General combiners RGB operation zero primary color secondary color constant color 0 constant color 1 fog spare 1 spare 0 texture 0 texture 1 A B C D input map input map input map not writeable RGB A RGB A input registers computations output registers scale and bias input map not readable zero primary color secondary color constant color 0 constant color 1 fog spare 1 spare 0 texture 0 texture 1 A B + C D A B mux C D -or- A B A  B -or- C  D C D -or-
  • 39. General combiners Alpha operation zero primary color secondary color constant color 0 constant color 1 fog spare 1 spare 0 texture 0 texture 1 A B C D A B C D input map input map input map not writeable RGB A RGB A input registers computations output registers scale and bias input map not readable zero primary color secondary color constant color 0 constant color 1 fog spare 1 spare 0 texture 0 texture 1 A B + C D A B mux C D -or-
  • 40. Final combiner operation zero primary color secondary color constant color 0 constant color 1 fog spare 1 spare 0 texture 0 texture 1 A B C D RGB A input registers computations A B + ( 1 - A) C + D E F E F G spare 0 + secondary color input map input map input map input map input map input map input map fragment RGB out fragment Alpha out G