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

Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)
Tiago Sousa
 
Deferred shading
Deferred shadingDeferred shading
Deferred shading
Frank Chao
 
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
Johan Andersson
 
Lighting Shading by John Hable
Lighting Shading by John HableLighting Shading by John Hable
Lighting Shading by John Hable
Naughty Dog
 
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Johan Andersson
 

What's hot (20)

Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)
 
The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2
 
Introduction to Bidirectional Path Tracing (BDPT) & Implementation using Open...
Introduction to Bidirectional Path Tracing (BDPT) & Implementation using Open...Introduction to Bidirectional Path Tracing (BDPT) & Implementation using Open...
Introduction to Bidirectional Path Tracing (BDPT) & Implementation using Open...
 
Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666
 
Deferred shading
Deferred shadingDeferred shading
Deferred shading
 
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
 
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
 
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time RaytracingCEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
 
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
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics Technology
 
Taking Killzone Shadow Fall Image Quality Into The Next Generation
Taking Killzone Shadow Fall Image Quality Into The Next GenerationTaking Killzone Shadow Fall Image Quality Into The Next Generation
Taking Killzone Shadow Fall Image Quality Into The Next Generation
 
Physically Based and Unified Volumetric Rendering in Frostbite
Physically Based and Unified Volumetric Rendering in FrostbitePhysically Based and Unified Volumetric Rendering in Frostbite
Physically Based and Unified Volumetric Rendering in Frostbite
 
Deferred rendering using compute shader
Deferred rendering using compute shaderDeferred rendering using compute shader
Deferred rendering using compute shader
 
Shaders in Unity
Shaders in UnityShaders in Unity
Shaders in Unity
 
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
 
Relic's FX System
Relic's FX SystemRelic's FX System
Relic's FX System
 
FrameGraph: Extensible Rendering Architecture in Frostbite
FrameGraph: Extensible Rendering Architecture in FrostbiteFrameGraph: Extensible Rendering Architecture in Frostbite
FrameGraph: Extensible Rendering Architecture in Frostbite
 
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
 
Lighting Shading by John Hable
Lighting Shading by John HableLighting Shading by John Hable
Lighting Shading by John Hable
 
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
 

Similar to Advanced Lighting Techniques Dan Baker (Meltdown 2005)

Practical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsPractical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT Methods
Naughty Dog
 
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
stefan_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 (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

Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...
Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...
Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...
lizamodels9
 
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
lizamodels9
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
daisycvs
 
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂EscortCall Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
dlhescort
 
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
amitlee9823
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
Abortion pills in Kuwait Cytotec pills in Kuwait
 
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
amitlee9823
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
dollysharma2066
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 

Recently uploaded (20)

(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
 
Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...
Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...
Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...
 
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
 
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂EscortCall Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
 
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
 
PHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation Final
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
 
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
 
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort ServiceMalegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
 
Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 

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.