SlideShare a Scribd company logo
1 of 90
 
Advanced Lighting Techniques Dan Baker Software Design Engineer Microsoft Corporation
Review The BRDF ,[object Object],[object Object],ω e dω i ω i
The BRDF ,[object Object],N ω e ω i T θ i θ e φ i φ e
The BRDF ,[object Object],N ω e ω i θ i θ e φ
The Reflection Equation
The Reflection Equation
The BRDF ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How Do We Evaluate a Lighting Model? ,[object Object],[object Object],[object Object]
A Modern Real Time Graphics System Vertex Buffer Input Assembler Vertex Shader Setup Rasterizer Output Merger Pixel Shader Index Buffer Texture Render Target Depth Stencil Texture Memory memory programmable fixed Sampler Sampler Constant Constant
Tomorrows Graphic’s System Vertex Buffer Input Assembler Vertex Shader Setup Rasterizer Output Merger Pixel Shader Geometry Shader Index Buffer Texture Texture Render Target Depth Stencil Texture Stream Buffer Stream out Memory memory programmable fixed Sampler Sampler Sampler Constant Constant Constant Memory
Where We Have Control ,[object Object],[object Object],[object Object],[object Object],[object Object]
Frequency of Evaluation ,[object Object],[object Object],[object Object],[object Object]
An Example BRDF ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Gamma Space ,[object Object],[object Object],[object Object]
Gamma Correcting ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dynamic Range ,[object Object],[object Object],[object Object]
Blooming/Tone Mapping ,[object Object],[object Object],[object Object],[object Object]
How Do We Evaluate a BRDF? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How Do We Represent Material Variation? ,[object Object],[object Object],[object Object]
Which Reflectance Model to Use ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
BRDF Costs, Minimal Surface Variation 10 + 5 *n 0 Lafortune Direct 35 0 Cook-Torrance 10 4 Ashikhmin/Shirley factored 40 0 Ashikhmin/Shirley 5 1 Banks Factored 12 0 Banks Direct 2 1 Blinn-Phong factored 7 0 Blinn-Phong Direct ALU costs Texture costs Model
BRDF Costs With Surface Variation 30 + 5*Lobes 2 Lafortune Direct 40 1 Cook-Torrance 30  6 Ashikhmin/Shirley factored 50 (60)* 2 Ashikhmin/Shirley 18 2 Banks Factored 25 1 Banks Direct 10 2 Blinn-Phong factored 15 1 Blinn-Phong Direct ALU costs Texture costs Model
Accuracy of Blinn-Phong chart courtesy of Addy Ngan, Fr é do Durand, and Wojciech Matusik
Accuracy of Ashikhmin Shirley chart courtesy of Addy Ngan, Fr é do Durand, and Wojciech Matusik
Getting Variation ,[object Object],[object Object],[object Object],[object Object]
Bump Mapping
Pixel Level Evaluation
Pixel Level Evaluation, Shift
Shifting Samples ,[object Object],[object Object],[object Object],[object Object]
But… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What Does a Sample Point Mean? What happens when this pixel is evaluated? Given a set of parameters interpolated from the triangles 3 vertices, how do we go about generating a color?
Texture Filtering Review A (1-A) B (1-B) Sample Color  = A*B *  + A*(1-B) *  + (1-A)*B *  + (1-A)*(1-B)*  +
Texture swimming
What about lower resolutions?
A common hack: Level of Detail MIP Level By lowering the amplitude Of the displacement,  effectively decreasing to a less complex model as the model moves further away. This will prevent aliasing, but isn’t accurate
Scale independent lighting ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],Scale independent lighting
MIP Mapping r t
Mip mapping for diffuse ,[object Object],[object Object]
Non Linear Lighting models Blinn-Phong isn’t Linear!
Texture Space Lighting ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Texture Space Lighting Rasterize triangles using texture coordinates as positions, the left image is the normal sampled at each point, and the right image is the computed lighting
Texture Space lighting We paste the texture onto the object
TSL: A case study ,[object Object],[object Object],[object Object]
A roadway, snapshots We can see Moiré patterns on any filtered non linear functions. Additionally, temporal aliasing becomes problematic.
Using TSL The artifacts are largely mitigated if we render the non linear function and MIP reduce. We can also see more high frequency detail.
How this demo works ,[object Object],[object Object],[object Object],[object Object],[object Object]
The Shader void  lightPositional(  …) { // norm, light and half are in tangent space // power, Kd, Ks and norm come from textures … //normalized blinn phong float  fS =  pow ( saturate ( dot (norm, half)), power)) * power; float  fD =  saturate ( dot (norm, light)) *  diffuseIntensity; vColorOut.xyz = fS * Ks + fD * Kd; vColorOut.a = 1; //put us in gamma space for the direct rendering only if  (bTextureView) vColorOut =  sqrt (vColorOut);  }
Pasting the texture on the Scene void  light_from_texture(  float2  vTexCoord: TEXCOORD0,   out float4  vColorOut: COLOR0 ) { // this is done with full anisotropy turned on // with SRGBTexture set to true vColorOut =  tex2D (LightMapSampler, vTexCoord); //for atlased objects, we do not want to blend in // unrendered pixels if ( vColorOut.a > 1e-5 ) vColorOut.xyz /= vColorOut.a; //put us in gamma space vColorOut =  sqrt (vColorOut); }
Drawing polygons on the backside [ emittype  [ triangle  MyVType ]] [ maxvertexcount  [3]] void  ClipGeometryShader( triangle  MyVType TextureTri[3]) { float2  coord1 = project(TextureTri[0]); float2  coord2 = project(TextureTri[1]); float2  coord3 = project(TextureTri[2]); float3  Vec1 =  float3 (coord3 – coord1, 0); float3  Vec2 =  float3 (coord3 – coord2, 0); float  Sign =  cross (Vec1, Vec2).z; if  (Sign > -EPSILON) { emit (TextureTri[0]); emit (TextureTri[1]); emit (TextureTri[2]); cut ; } }
Problems with TSL ,[object Object],[object Object],[object Object],[object Object]
MIP-Mapping Reflectance Models
MIP-Mapping Reflectance Models ,[object Object],[object Object],[object Object],[object Object]
A little bit of microfacet Theory ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Microfacet Theory ,[object Object],[object Object],ω i ω e ω i ω i ω i ω i ω i ω i ω e ω e ω e ω e ω e ω e ω h ω h ω h ω h ω h ω h ω h
Microfacet Theory ,[object Object],[object Object],[object Object],ω i ω i ω i ω e ω i ω i ω i ω i ω e ω e ω e ω e ω e ω e ω h ω h ω h ω h ω h ω h ω h
So what does a MIP map mean anyway? ,[object Object],[object Object],[object Object],[object Object]
A simple non linear function The Blinn-Phong lighting model is one of the most common half angle based lighting functions. The above is a normalized  version , that is the total emitted energy is close to constant for any power. This model is parameterized by N, Kd, Ks, and p. Changing these values changes the properties of the underlying surface
A common approach The image on the left is lit with MIP maps fading to flat, while the image on the right is what the image would look like if rendered at a higher resolution and scaled down. The objects do not physically look the same.
A more correct MIP map The images in the middle were rendered directly to the screen using a BRDF approximating MIP map. The more we zoom out, the larger the difference between the correct and incorrect approaches
Examining a mip level – simple 32 32 32 32 32 Next MIP Level – same thing
Examining a mip level 8 45 16 25 25 Next MIP Level, Average Power?
Examining a MIP level 32 32 32 32 32 Next MIP Level, Average power, normal?
What about a larger patch and a lower mip? 5
Setting up the problem ,[object Object],[object Object],[object Object]
A simple BRDF ,[object Object],[object Object],[object Object],[object Object]
Reflectance at a single texel Ks = .02, P = 30 Ks = .02, P = 30 Ks = .02, P = 24 Ks = .01, P =30 Ks = ???, P = ??? (?,?,?) For a given light and view direction, how do we pick a Ks, a Power and Normal so that we get the same final color? MIP Level 0 MIP Level 1
Solving for a single patch of texels For a given patch of texels w wide and h tall: Where,
We care about all pairs of L and V Creating an error function for a single pair of L and V: Need to find the minimum error across all possible V and L
Creating a MIP filter ,[object Object],[object Object],[object Object]
Non Linear fitting ,[object Object],[object Object],[object Object],[object Object]
Giving a good first guess ,[object Object],[object Object],[object Object]
Non linear with Blinn Phong With the Blinn-Phong BRDF, the error plot shows that the function is mostly smooth. As long as we take a guess in the dark region, we should be fine. Graph is log(1 + error) power Ks
Speeding it up ,[object Object],[object Object],[object Object],[object Object],[object Object]
Speeding it up But, we must use Half Angle Distribution
Results ,[object Object],[object Object],[object Object],[object Object]
Dealing with Anisotropy ,[object Object],[object Object],[object Object],[object Object]
Why Ashikhmin-Shirley ? ,[object Object],[object Object],[object Object],[object Object]
Anisotropy ,[object Object]
A side note: ,[object Object],[object Object],[object Object]
Solution for high quality rendering ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
System considerations ,[object Object],[object Object]
Final thoughts on fitting ,[object Object],[object Object],[object Object]
More thoughts ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],References - Background
References - Techniques ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Acknowledgements ,[object Object],[object Object],[object Object]
© 2005 Microsoft Corporation.  All rights reserved.  Microsoft, is a registered trademark of Microsoft Corporation in the United States and/or other countries.  The names of actual companies and products mentioned herein may be the trademarks of their respective owners.
© 2005 Microsoft Corporation.  All rights reserved.  Microsoft, is a registered trademark of Microsoft Corporation in the United States and/or other countries.  The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

More Related Content

What's hot

Screen Space Reflections in The Surge
Screen Space Reflections in The SurgeScreen Space Reflections in The Surge
Screen Space Reflections in The SurgeMichele Giacalone
 
Rendering Techniques in Deus Ex: Mankind Divided
Rendering Techniques in Deus Ex: Mankind DividedRendering Techniques in Deus Ex: Mankind Divided
Rendering Techniques in Deus Ex: Mankind DividedEidos-Montréal
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunElectronic Arts / DICE
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologyTiago Sousa
 
Computer graphics - colour crt and flat-panel displays
Computer graphics - colour crt and flat-panel displaysComputer graphics - colour crt and flat-panel displays
Computer graphics - colour crt and flat-panel displaysVishnupriya T H
 
Image Restoration for 3D Computer Vision
Image Restoration for 3D Computer VisionImage Restoration for 3D Computer Vision
Image Restoration for 3D Computer VisionPetteriTeikariPhD
 
Moving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingMoving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingElectronic Arts / DICE
 
Introduction to Apache Spark Ecosystem
Introduction to Apache Spark EcosystemIntroduction to Apache Spark Ecosystem
Introduction to Apache Spark EcosystemBojan Babic
 
Lighting Shading by John Hable
Lighting Shading by John HableLighting Shading by John Hable
Lighting Shading by John HableNaughty Dog
 
Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Tiago Sousa
 
Precomputed Voxelized-Shadows for Large-scale Scene and Many lights
Precomputed Voxelized-Shadows for Large-scale Scene and Many lightsPrecomputed Voxelized-Shadows for Large-scale Scene and Many lights
Precomputed Voxelized-Shadows for Large-scale Scene and Many lightsSeongdae Kim
 
Superpixel algorithms (whatershed, mean-shift, SLIC, BSLIC), Foolad
Superpixel algorithms (whatershed, mean-shift, SLIC, BSLIC), FooladSuperpixel algorithms (whatershed, mean-shift, SLIC, BSLIC), Foolad
Superpixel algorithms (whatershed, mean-shift, SLIC, BSLIC), FooladShima Foolad
 
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in FrostbitePhysically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in FrostbiteElectronic Arts / DICE
 
Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Graham Wihlidal
 
The motion estimation
The motion estimationThe motion estimation
The motion estimationsakshij91
 
Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)Johan Andersson
 
Screen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarineScreen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarinePope Kim
 

What's hot (20)

Screen Space Reflections in The Surge
Screen Space Reflections in The SurgeScreen Space Reflections in The Surge
Screen Space Reflections in The Surge
 
Shiny PC Graphics in Battlefield 3
Shiny PC Graphics in Battlefield 3Shiny PC Graphics in Battlefield 3
Shiny PC Graphics in Battlefield 3
 
Rendering Techniques in Deus Ex: Mankind Divided
Rendering Techniques in Deus Ex: Mankind DividedRendering Techniques in Deus Ex: Mankind Divided
Rendering Techniques in Deus Ex: Mankind Divided
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics Technology
 
Computer graphics - colour crt and flat-panel displays
Computer graphics - colour crt and flat-panel displaysComputer graphics - colour crt and flat-panel displays
Computer graphics - colour crt and flat-panel displays
 
Image Restoration for 3D Computer Vision
Image Restoration for 3D Computer VisionImage Restoration for 3D Computer Vision
Image Restoration for 3D Computer Vision
 
Moving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingMoving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based Rendering
 
Introduction to Apache Spark Ecosystem
Introduction to Apache Spark EcosystemIntroduction to Apache Spark Ecosystem
Introduction to Apache Spark Ecosystem
 
Ray Tracing.pdf
Ray Tracing.pdfRay Tracing.pdf
Ray Tracing.pdf
 
Lighting Shading by John Hable
Lighting Shading by John HableLighting Shading by John Hable
Lighting Shading by John Hable
 
Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)
 
Masked Occlusion Culling
Masked Occlusion CullingMasked Occlusion Culling
Masked Occlusion Culling
 
Precomputed Voxelized-Shadows for Large-scale Scene and Many lights
Precomputed Voxelized-Shadows for Large-scale Scene and Many lightsPrecomputed Voxelized-Shadows for Large-scale Scene and Many lights
Precomputed Voxelized-Shadows for Large-scale Scene and Many lights
 
Superpixel algorithms (whatershed, mean-shift, SLIC, BSLIC), Foolad
Superpixel algorithms (whatershed, mean-shift, SLIC, BSLIC), FooladSuperpixel algorithms (whatershed, mean-shift, SLIC, BSLIC), Foolad
Superpixel algorithms (whatershed, mean-shift, SLIC, BSLIC), Foolad
 
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in FrostbitePhysically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
 
Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016
 
The motion estimation
The motion estimationThe motion estimation
The motion estimation
 
Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)
 
Screen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarineScreen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space Marine
 

Similar to Advanced Lighting Techniques Dan Baker (Meltdown 2005)

Practical spherical harmonics based PRT methods.ppsx
Practical spherical harmonics based PRT methods.ppsxPractical spherical harmonics based PRT methods.ppsx
Practical spherical harmonics based PRT methods.ppsxMannyK4
 
Practical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsPractical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsNaughty Dog
 
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdfPapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdfAdam Hill
 
Computer Graphics Part1
Computer Graphics Part1Computer Graphics Part1
Computer Graphics Part1qpqpqp
 
Digital image processing
Digital image processingDigital image processing
Digital image processingABIRAMI M
 
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)Mark Kilgard
 
Rendering basics
Rendering basicsRendering basics
Rendering basicsicedmaster
 
Calibrating Lighting and Materials in Far Cry 3
Calibrating Lighting and Materials in Far Cry 3Calibrating Lighting and Materials in Far Cry 3
Calibrating Lighting and Materials in Far Cry 3stevemcauley
 
Rendering AAA-Quality Characters of Project A1
Rendering AAA-Quality Characters of Project A1Rendering AAA-Quality Characters of Project A1
Rendering AAA-Quality Characters of Project A1Ki Hyunwoo
 
Advanced Lighting for Interactive Applications
Advanced Lighting for Interactive ApplicationsAdvanced Lighting for Interactive Applications
Advanced Lighting for Interactive Applicationsstefan_b
 
Digital image processing - Image Enhancement (MATERIAL)
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)Mathankumar S
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image EnhancementMathankumar S
 
Interactive Refractions And Caustics Using Image Space Techniques
Interactive Refractions And Caustics Using Image Space TechniquesInteractive Refractions And Caustics Using Image Space Techniques
Interactive Refractions And Caustics Using Image Space Techniquescodevania
 
Digital image processing
Digital image processingDigital image processing
Digital image processingChetan Hulsure
 
Lec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdfLec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdfnagwaAboElenein
 
Shadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive ApplicationsShadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive Applicationsstefan_b
 

Similar to Advanced Lighting Techniques Dan Baker (Meltdown 2005) (20)

Practical spherical harmonics based PRT methods.ppsx
Practical spherical harmonics based PRT methods.ppsxPractical spherical harmonics based PRT methods.ppsx
Practical spherical harmonics based PRT methods.ppsx
 
Practical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsPractical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT Methods
 
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdfPapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
 
M.sc. m hassan
M.sc. m hassanM.sc. m hassan
M.sc. m hassan
 
Computer Graphics Part1
Computer Graphics Part1Computer Graphics Part1
Computer Graphics Part1
 
Digital image processing
Digital image processingDigital image processing
Digital image processing
 
TransNeRF
TransNeRFTransNeRF
TransNeRF
 
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
 
Rendering basics
Rendering basicsRendering basics
Rendering basics
 
Calibrating Lighting and Materials in Far Cry 3
Calibrating Lighting and Materials in Far Cry 3Calibrating Lighting and Materials in Far Cry 3
Calibrating Lighting and Materials in Far Cry 3
 
Rendering AAA-Quality Characters of Project A1
Rendering AAA-Quality Characters of Project A1Rendering AAA-Quality Characters of Project A1
Rendering AAA-Quality Characters of Project A1
 
Advanced Lighting for Interactive Applications
Advanced Lighting for Interactive ApplicationsAdvanced Lighting for Interactive Applications
Advanced Lighting for Interactive Applications
 
Digital image processing - Image Enhancement (MATERIAL)
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image Enhancement
 
Interactive Refractions And Caustics Using Image Space Techniques
Interactive Refractions And Caustics Using Image Space TechniquesInteractive Refractions And Caustics Using Image Space Techniques
Interactive Refractions And Caustics Using Image Space Techniques
 
Global illumination
Global illuminationGlobal illumination
Global illumination
 
Digital image processing
Digital image processingDigital image processing
Digital image processing
 
Lec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdfLec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdf
 
4 image enhancement in spatial domain
4 image enhancement in spatial domain4 image enhancement in spatial domain
4 image enhancement in spatial domain
 
Shadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive ApplicationsShadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive Applications
 

More from mobius.cn

Lec4 Clustering
Lec4 ClusteringLec4 Clustering
Lec4 Clusteringmobius.cn
 
Lec5 Pagerank
Lec5 PagerankLec5 Pagerank
Lec5 Pagerankmobius.cn
 
Parallel Programming Primer 1
Parallel Programming Primer 1Parallel Programming Primer 1
Parallel Programming Primer 1mobius.cn
 
Influence map
Influence mapInfluence map
Influence mapmobius.cn
 

More from mobius.cn (7)

Lec4 Clustering
Lec4 ClusteringLec4 Clustering
Lec4 Clustering
 
Lec3 Dfs
Lec3 DfsLec3 Dfs
Lec3 Dfs
 
Lec5 Pagerank
Lec5 PagerankLec5 Pagerank
Lec5 Pagerank
 
Lec2 Mapred
Lec2 MapredLec2 Mapred
Lec2 Mapred
 
Parallel Programming Primer 1
Parallel Programming Primer 1Parallel Programming Primer 1
Parallel Programming Primer 1
 
Lec1 Intro
Lec1 IntroLec1 Intro
Lec1 Intro
 
Influence map
Influence mapInfluence map
Influence map
 

Recently uploaded

Progress Report - Oracle Database Analyst Summit
Progress  Report - Oracle Database Analyst SummitProgress  Report - Oracle Database Analyst Summit
Progress Report - Oracle Database Analyst SummitHolger Mueller
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesDipal Arora
 
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptxB.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptxpriyanshujha201
 
Event mailer assignment progress report .pdf
Event mailer assignment progress report .pdfEvent mailer assignment progress report .pdf
Event mailer assignment progress report .pdftbatkhuu1
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMRavindra Nath Shukla
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communicationskarancommunications
 
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...Suhani Kapoor
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLSeo
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...lizamodels9
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfPaul Menig
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒anilsa9823
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Dave Litwiller
 
Understanding the Pakistan Budgeting Process: Basics and Key Insights
Understanding the Pakistan Budgeting Process: Basics and Key InsightsUnderstanding the Pakistan Budgeting Process: Basics and Key Insights
Understanding the Pakistan Budgeting Process: Basics and Key Insightsseri bangash
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Centuryrwgiffor
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Servicediscovermytutordmt
 

Recently uploaded (20)

Progress Report - Oracle Database Analyst Summit
Progress  Report - Oracle Database Analyst SummitProgress  Report - Oracle Database Analyst Summit
Progress Report - Oracle Database Analyst Summit
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptxB.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
 
Event mailer assignment progress report .pdf
Event mailer assignment progress report .pdfEvent mailer assignment progress report .pdf
Event mailer assignment progress report .pdf
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSM
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors Data
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communications
 
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdf
 
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
 
Understanding the Pakistan Budgeting Process: Basics and Key Insights
Understanding the Pakistan Budgeting Process: Basics and Key InsightsUnderstanding the Pakistan Budgeting Process: Basics and Key Insights
Understanding the Pakistan Budgeting Process: Basics and Key Insights
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Century
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Service
 

Advanced Lighting Techniques Dan Baker (Meltdown 2005)

  • 1.  
  • 2. Advanced Lighting Techniques Dan Baker Software Design Engineer Microsoft Corporation
  • 3.
  • 4.
  • 5.
  • 8.
  • 9.
  • 10. A Modern Real Time Graphics System Vertex Buffer Input Assembler Vertex Shader Setup Rasterizer Output Merger Pixel Shader Index Buffer Texture Render Target Depth Stencil Texture Memory memory programmable fixed Sampler Sampler Constant Constant
  • 11. Tomorrows Graphic’s System Vertex Buffer Input Assembler Vertex Shader Setup Rasterizer Output Merger Pixel Shader Geometry Shader Index Buffer Texture Texture Render Target Depth Stencil Texture Stream Buffer Stream out Memory memory programmable fixed Sampler Sampler Sampler Constant Constant Constant Memory
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. BRDF Costs, Minimal Surface Variation 10 + 5 *n 0 Lafortune Direct 35 0 Cook-Torrance 10 4 Ashikhmin/Shirley factored 40 0 Ashikhmin/Shirley 5 1 Banks Factored 12 0 Banks Direct 2 1 Blinn-Phong factored 7 0 Blinn-Phong Direct ALU costs Texture costs Model
  • 23. BRDF Costs With Surface Variation 30 + 5*Lobes 2 Lafortune Direct 40 1 Cook-Torrance 30 6 Ashikhmin/Shirley factored 50 (60)* 2 Ashikhmin/Shirley 18 2 Banks Factored 25 1 Banks Direct 10 2 Blinn-Phong factored 15 1 Blinn-Phong Direct ALU costs Texture costs Model
  • 24. Accuracy of Blinn-Phong chart courtesy of Addy Ngan, Fr é do Durand, and Wojciech Matusik
  • 25. Accuracy of Ashikhmin Shirley chart courtesy of Addy Ngan, Fr é do Durand, and Wojciech Matusik
  • 26.
  • 30.
  • 31.
  • 32. What Does a Sample Point Mean? What happens when this pixel is evaluated? Given a set of parameters interpolated from the triangles 3 vertices, how do we go about generating a color?
  • 33. Texture Filtering Review A (1-A) B (1-B) Sample Color = A*B * + A*(1-B) * + (1-A)*B * + (1-A)*(1-B)* +
  • 35. What about lower resolutions?
  • 36. A common hack: Level of Detail MIP Level By lowering the amplitude Of the displacement, effectively decreasing to a less complex model as the model moves further away. This will prevent aliasing, but isn’t accurate
  • 37.
  • 38.
  • 40.
  • 41. Non Linear Lighting models Blinn-Phong isn’t Linear!
  • 42.
  • 43. Texture Space Lighting Rasterize triangles using texture coordinates as positions, the left image is the normal sampled at each point, and the right image is the computed lighting
  • 44. Texture Space lighting We paste the texture onto the object
  • 45.
  • 46. A roadway, snapshots We can see Moiré patterns on any filtered non linear functions. Additionally, temporal aliasing becomes problematic.
  • 47. Using TSL The artifacts are largely mitigated if we render the non linear function and MIP reduce. We can also see more high frequency detail.
  • 48.
  • 49. The Shader void lightPositional( …) { // norm, light and half are in tangent space // power, Kd, Ks and norm come from textures … //normalized blinn phong float fS = pow ( saturate ( dot (norm, half)), power)) * power; float fD = saturate ( dot (norm, light)) * diffuseIntensity; vColorOut.xyz = fS * Ks + fD * Kd; vColorOut.a = 1; //put us in gamma space for the direct rendering only if (bTextureView) vColorOut = sqrt (vColorOut); }
  • 50. Pasting the texture on the Scene void light_from_texture( float2 vTexCoord: TEXCOORD0, out float4 vColorOut: COLOR0 ) { // this is done with full anisotropy turned on // with SRGBTexture set to true vColorOut = tex2D (LightMapSampler, vTexCoord); //for atlased objects, we do not want to blend in // unrendered pixels if ( vColorOut.a > 1e-5 ) vColorOut.xyz /= vColorOut.a; //put us in gamma space vColorOut = sqrt (vColorOut); }
  • 51. Drawing polygons on the backside [ emittype [ triangle MyVType ]] [ maxvertexcount [3]] void ClipGeometryShader( triangle MyVType TextureTri[3]) { float2 coord1 = project(TextureTri[0]); float2 coord2 = project(TextureTri[1]); float2 coord3 = project(TextureTri[2]); float3 Vec1 = float3 (coord3 – coord1, 0); float3 Vec2 = float3 (coord3 – coord2, 0); float Sign = cross (Vec1, Vec2).z; if (Sign > -EPSILON) { emit (TextureTri[0]); emit (TextureTri[1]); emit (TextureTri[2]); cut ; } }
  • 52.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59. A simple non linear function The Blinn-Phong lighting model is one of the most common half angle based lighting functions. The above is a normalized version , that is the total emitted energy is close to constant for any power. This model is parameterized by N, Kd, Ks, and p. Changing these values changes the properties of the underlying surface
  • 60. A common approach The image on the left is lit with MIP maps fading to flat, while the image on the right is what the image would look like if rendered at a higher resolution and scaled down. The objects do not physically look the same.
  • 61. A more correct MIP map The images in the middle were rendered directly to the screen using a BRDF approximating MIP map. The more we zoom out, the larger the difference between the correct and incorrect approaches
  • 62. Examining a mip level – simple 32 32 32 32 32 Next MIP Level – same thing
  • 63. Examining a mip level 8 45 16 25 25 Next MIP Level, Average Power?
  • 64. Examining a MIP level 32 32 32 32 32 Next MIP Level, Average power, normal?
  • 65. What about a larger patch and a lower mip? 5
  • 66.
  • 67.
  • 68. Reflectance at a single texel Ks = .02, P = 30 Ks = .02, P = 30 Ks = .02, P = 24 Ks = .01, P =30 Ks = ???, P = ??? (?,?,?) For a given light and view direction, how do we pick a Ks, a Power and Normal so that we get the same final color? MIP Level 0 MIP Level 1
  • 69. Solving for a single patch of texels For a given patch of texels w wide and h tall: Where,
  • 70. We care about all pairs of L and V Creating an error function for a single pair of L and V: Need to find the minimum error across all possible V and L
  • 71.
  • 72.
  • 73.
  • 74. Non linear with Blinn Phong With the Blinn-Phong BRDF, the error plot shows that the function is mostly smooth. As long as we take a guess in the dark region, we should be fine. Graph is log(1 + error) power Ks
  • 75.
  • 76. Speeding it up But, we must use Half Angle Distribution
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89. © 2005 Microsoft Corporation. All rights reserved. Microsoft, is a registered trademark of Microsoft Corporation in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners.
  • 90. © 2005 Microsoft Corporation. All rights reserved. Microsoft, is a registered trademark of Microsoft Corporation in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners.