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

Past, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesPast, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesColin Barré-Brisebois
 
A Bit More Deferred Cry Engine3
A Bit More Deferred   Cry Engine3A Bit More Deferred   Cry Engine3
A Bit More Deferred Cry Engine3guest11b095
 
Lighting Shading by John Hable
Lighting Shading by John HableLighting Shading by John Hable
Lighting Shading by John HableNaughty Dog
 
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 GenerationGuerrilla
 
Triangle Visibility buffer
Triangle Visibility bufferTriangle Visibility buffer
Triangle Visibility bufferWolfgang Engel
 
Destruction Masking in Frostbite 2 using Volume Distance Fields
Destruction Masking in Frostbite 2 using Volume Distance FieldsDestruction Masking in Frostbite 2 using Volume Distance Fields
Destruction Masking in Frostbite 2 using Volume Distance FieldsElectronic Arts / DICE
 
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero DawnThe Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero DawnGuerrilla
 
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 FrostbiteElectronic 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
 
A Scalable Real-Time Many-Shadowed-Light Rendering System
A Scalable Real-Time Many-Shadowed-Light Rendering SystemA Scalable Real-Time Many-Shadowed-Light Rendering System
A Scalable Real-Time Many-Shadowed-Light Rendering SystemBo Li
 
Lighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow FallLighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow FallGuerrilla
 
Screen Space Reflections in The Surge
Screen Space Reflections in The SurgeScreen Space Reflections in The Surge
Screen Space Reflections in The SurgeMichele Giacalone
 
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
 
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
 
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3Electronic Arts / DICE
 
Shadow mapping 정리
Shadow mapping 정리Shadow mapping 정리
Shadow mapping 정리changehee lee
 
Unite2019 HLOD를 활용한 대규모 씬 제작 방법
Unite2019 HLOD를 활용한 대규모 씬 제작 방법Unite2019 HLOD를 활용한 대규모 씬 제작 방법
Unite2019 HLOD를 활용한 대규모 씬 제작 방법장규 서
 
The Technology of Uncharted: Drake’s Fortune
The Technology of Uncharted: Drake’s FortuneThe Technology of Uncharted: Drake’s Fortune
The Technology of Uncharted: Drake’s FortuneNaughty Dog
 

What's hot (20)

Past, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesPast, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in Games
 
A Bit More Deferred Cry Engine3
A Bit More Deferred   Cry Engine3A Bit More Deferred   Cry Engine3
A Bit More Deferred Cry Engine3
 
Lighting Shading by John Hable
Lighting Shading by John HableLighting Shading by John Hable
Lighting Shading by John Hable
 
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
 
Triangle Visibility buffer
Triangle Visibility bufferTriangle Visibility buffer
Triangle Visibility buffer
 
Destruction Masking in Frostbite 2 using Volume Distance Fields
Destruction Masking in Frostbite 2 using Volume Distance FieldsDestruction Masking in Frostbite 2 using Volume Distance Fields
Destruction Masking in Frostbite 2 using Volume Distance Fields
 
D2 Hdr
D2 HdrD2 Hdr
D2 Hdr
 
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero DawnThe Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
 
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
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics Technology
 
Light prepass
Light prepassLight prepass
Light prepass
 
A Scalable Real-Time Many-Shadowed-Light Rendering System
A Scalable Real-Time Many-Shadowed-Light Rendering SystemA Scalable Real-Time Many-Shadowed-Light Rendering System
A Scalable Real-Time Many-Shadowed-Light Rendering System
 
Lighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow FallLighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow Fall
 
Screen Space Reflections in The Surge
Screen Space Reflections in The SurgeScreen Space Reflections in The Surge
Screen Space Reflections in The Surge
 
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
 
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
 
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
 
Shadow mapping 정리
Shadow mapping 정리Shadow mapping 정리
Shadow mapping 정리
 
Unite2019 HLOD를 활용한 대규모 씬 제작 방법
Unite2019 HLOD를 활용한 대규모 씬 제작 방법Unite2019 HLOD를 활용한 대규모 씬 제작 방법
Unite2019 HLOD를 활용한 대규모 씬 제작 방법
 
The Technology of Uncharted: Drake’s Fortune
The Technology of Uncharted: Drake’s FortuneThe Technology of Uncharted: Drake’s Fortune
The Technology of Uncharted: Drake’s Fortune
 

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
 
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
 
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
 
www.ijerd.com
www.ijerd.comwww.ijerd.com
www.ijerd.com
 

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

VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130  Available With RoomVIP Kolkata Call Girl Howrah 👉 8250192130  Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Roomdivyansh0kumar0
 
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
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,noida100girls
 
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc.../:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...lizamodels9
 
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,noida100girls
 
Eni 2024 1Q Results - 24.04.24 business.
Eni 2024 1Q Results - 24.04.24 business.Eni 2024 1Q Results - 24.04.24 business.
Eni 2024 1Q Results - 24.04.24 business.Eni
 
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999Tina Ji
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.Aaiza Hassan
 
Catalogue ONG NUOC PPR DE NHAT .pdf
Catalogue ONG NUOC PPR DE NHAT      .pdfCatalogue ONG NUOC PPR DE NHAT      .pdf
Catalogue ONG NUOC PPR DE NHAT .pdfOrient Homes
 
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...lizamodels9
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Neil Kimberley
 
rishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfrishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfmuskan1121w
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...lizamodels9
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdfRenandantas16
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...lizamodels9
 
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsApsara Of India
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in managementchhavia330
 
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...lizamodels9
 

Recently uploaded (20)

VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130  Available With RoomVIP Kolkata Call Girl Howrah 👉 8250192130  Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Room
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSM
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
 
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc.../:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
 
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
 
Eni 2024 1Q Results - 24.04.24 business.
Eni 2024 1Q Results - 24.04.24 business.Eni 2024 1Q Results - 24.04.24 business.
Eni 2024 1Q Results - 24.04.24 business.
 
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.
 
Catalogue ONG NUOC PPR DE NHAT .pdf
Catalogue ONG NUOC PPR DE NHAT      .pdfCatalogue ONG NUOC PPR DE NHAT      .pdf
Catalogue ONG NUOC PPR DE NHAT .pdf
 
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023
 
rishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfrishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdf
 
KestrelPro Flyer Japan IT Week 2024 (English)
KestrelPro Flyer Japan IT Week 2024 (English)KestrelPro Flyer Japan IT Week 2024 (English)
KestrelPro Flyer Japan IT Week 2024 (English)
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
 
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
 
Best Practices for Implementing an External Recruiting Partnership
Best Practices for Implementing an External Recruiting PartnershipBest Practices for Implementing an External Recruiting Partnership
Best Practices for Implementing an External Recruiting Partnership
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in management
 
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
 

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.