SlideShare a Scribd company logo
1 of 22
Download to read offline
ShaderX5
   4.2 Multisampling Extension
    for Gradient Shadow Maps


                     ohyecloudyhttp://ohyecloudy.com
           shader study http://cafe.naver.com/shader.cafe
                                               2010.5.24
Overview of Gradient Shadow Maps
Multisampling and PCF
Merging the Algorithms
Optimizing Texture Look-ups
Conclusion
• Slope-scale depth bias
  – gradient를 depth bias에 사용


• Fuzzy depth comparison
  – 1 or 0이 아니라 0~1 값을 쓴다.


• Linearly filtered depth values
  – point 샘플링이 아니라 보간 해서 사용.
     • 예) bilinear filter
float lightVisibility_GSM(float3 lightCoord)
{
  // get the magnitude of the gradient, by either method
  float gradient = length(getGradientVector(lightCoord));

    // get the difference between stored and interpolated depth
    // (depthMap should have LINEAR filtering enabled)
    float diff = tex2D(depthMap, lightCoord.xy).x – lightCoord.z;

    // replace the less-than operator with a smooth function
    // for diff >= 0 the result is 1
    return saturate(diff/gradient + 1);
}
Overview of Gradient Shadow Maps
Multisampling and PCF
Merging the Algorithms
Optimizing Texture Look-ups
Conclusion
float lightVisibility_PCF(float3 ligthCoord)
{
  float result = 0;

    for (int i = 0; i < n; ++i)
    {
      float3 offCoord = lightCoord + offset[i];
      result +=
        lightCoord.z <
          tex2D(depthMap, offCoord.xy).x;
    }

    return result / n;
}
Overview of Gradient Shadow Maps
Multisampling and PCF
Merging the Algorithms
Optimizing Texture Look-ups
Conclusion
float lightVisibility_PCF_with_GSM(float3 lightCoord)
{
  float result = 0;

    for (int i = 0; i < n; ++i)
    {
      result +=
        lightVisibility_GSM(lightCoord + offset[i]);
    }

    return result / n;
}
incident light             incident light



                 surface                    surface




      shadow volume              shadow volume



  PCF area                   PCF area
float lightVisibility_GSM_modified(float3 lightCoord,
float2 offset)
{
  // get the gradient, by either method
  float2 gradientVector = getGradientVector(lightCoord);
  float gradient = length(gradientVector);

    // calculate an offset coordinate
    // the z coord is moved along with the local gradient
    // (this is equivalent to having a local plane equation)
    float3 offCoord = float3(
      lightCoord.xy + offset,
      lightCoord.z + dot(offset, gradientVector));

    // the rest is straightforward
    float diff = offCoord.z – tex2D(depthMap, offCoord.xy).x;

    return saturate(diff/gradient + 1);
}
Overview of Gradient Shadow Maps
Multisampling and PCF
Merging the Algorithms
Optimizing Texture Look-ups
Conclusion
• depth map에 scalar depth 저장했을 때
 – gradient vector : texture loockup 3번


• 추가로 depth sampling 한번, PCF에서 4번

• 전체 PCF 영역에서 평균 gradient를 근사
 – 최소 제곱 근사값least squares approximation을
   찾기 위한 선형회귀linear regression
z    x 2  xy  1  z x 
 x     i                   i  i

 z   xy  y 2   z y 
   y            i         i  i 

                                    공(共)분산 행렬
                                    covariance matrix

     
z   pi p    i 
                 T 1
                         zi pi
          xy    제거


           zi xi        
 z  
 x               xi2 
  z   zi yi            

 y               yi 
                          2
                            
                           
8 PCF samples
float lightVisibility_unrolled_circluar8(float3 lightCoord)
{
  const float displace = .5 / depthMapResolution;
  const float displaceLong = 1.41421 * displace;
  float depths[8] = {
    tex2D(depthMap, lightCoord.xy + float2(-displaceLong,0)).x,
    tex2D(depthMap, lightCoord.xy + float2(displaceLong,0)).x,
    tex2D(depthMap, lightCoord.xy + float2(0,-displaceLong)).x,
    tex2D(depthMap, lightCoord.xy + float2(0,displaceLong)).x,
    tex2D(depthMap, lightCoord.xy + float2(-displaceLong,-displaceLong)).x,
    tex2D(depthMap, lightCoord.xy + float2(displaceLong,-displaceLong)).x,
    tex2D(depthMap, lightCoord.xy + float2(-displaceLong, displaceLong)).x,
    tex2D(depthMap, lightCoord.xy + float2(displaceLong, displaceLong)).x };

    const float inverseCovariance = 1.   / (1 + 1+ 2);
    float2 gradientVector = float2(
       depths[1] * 1.41421 + depths[5]   +   depths[7]
      -depths[0] * 1.41421 – depths[4]   –   depths[6],
       depths[3] * 1.41421 + depths[6]   +   depths[7]
      -depths[2] * 1.41421 – depths[4]   –   depths[5] ) *
      inverseCovariance;

    // continue with summation over PCF samples
    // using the average gradient
}
Overview of Gradient Shadow Maps
Multisampling and PCF
Merging the Algorithms
Optimizing Texture Look-ups
Conclusion
• ShaderX4에서 봤던 Acne 제거 기술 복습
 – Slope-scale depth bias,
 – Fuzzy depth comparison,
 – Linearly filtered depth values


• 추가로 부드러운 그림자 가장자리(edge)를
  만들기 위한 기술
 – PCF
 – 샘플링 회수를 줄이기 위한 근사
Optimizing Gradient Shadow Maps

More Related Content

What's hot

[shaderx7] 4.1 Practical Cascaded Shadow Maps
[shaderx7] 4.1 Practical Cascaded Shadow Maps[shaderx7] 4.1 Practical Cascaded Shadow Maps
[shaderx7] 4.1 Practical Cascaded Shadow Maps종빈 오
 
rural marketing ppt
rural marketing pptrural marketing ppt
rural marketing pptelaya1984
 
Visible Surface Detection
Visible Surface DetectionVisible Surface Detection
Visible Surface DetectionAmitBiswas99
 
[shaderx5] 3.2 Selective Supersampling
[shaderx5] 3.2 Selective Supersampling[shaderx5] 3.2 Selective Supersampling
[shaderx5] 3.2 Selective Supersampling종빈 오
 
Implementing a modern, RenderMan compliant, REYES renderer
Implementing a modern, RenderMan compliant, REYES rendererImplementing a modern, RenderMan compliant, REYES renderer
Implementing a modern, RenderMan compliant, REYES rendererDavide Pasca
 
Second derivative and graphing
Second derivative and graphingSecond derivative and graphing
Second derivative and graphingmcftay15
 
Robust Stenciled Shadow Volumes
Robust Stenciled Shadow VolumesRobust Stenciled Shadow Volumes
Robust Stenciled Shadow VolumesMark Kilgard
 
A computationally efficient method for sequential MAP-MRF cloud detection
A computationally efficient method for sequential MAP-MRF cloud detectionA computationally efficient method for sequential MAP-MRF cloud detection
A computationally efficient method for sequential MAP-MRF cloud detectionBeniamino Murgante
 
Shadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL HardwareShadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL HardwareMark Kilgard
 
Back face detection
Back face detectionBack face detection
Back face detectionPooja Dixit
 
Paris Master Class 2011 - 04 Shadow Maps
Paris Master Class 2011 - 04 Shadow MapsParis Master Class 2011 - 04 Shadow Maps
Paris Master Class 2011 - 04 Shadow MapsWolfgang Engel
 
SURF - Speeded Up Robust Features
SURF - Speeded Up Robust FeaturesSURF - Speeded Up Robust Features
SURF - Speeded Up Robust FeaturesMarta Lopes
 
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
 
GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)Michael Heron
 

What's hot (20)

[shaderx7] 4.1 Practical Cascaded Shadow Maps
[shaderx7] 4.1 Practical Cascaded Shadow Maps[shaderx7] 4.1 Practical Cascaded Shadow Maps
[shaderx7] 4.1 Practical Cascaded Shadow Maps
 
Hidden Surfaces
Hidden SurfacesHidden Surfaces
Hidden Surfaces
 
Depth Buffer Method
Depth Buffer MethodDepth Buffer Method
Depth Buffer Method
 
visible surface detection
visible surface detectionvisible surface detection
visible surface detection
 
rural marketing ppt
rural marketing pptrural marketing ppt
rural marketing ppt
 
Visible Surface Detection
Visible Surface DetectionVisible Surface Detection
Visible Surface Detection
 
Reyes
ReyesReyes
Reyes
 
[shaderx5] 3.2 Selective Supersampling
[shaderx5] 3.2 Selective Supersampling[shaderx5] 3.2 Selective Supersampling
[shaderx5] 3.2 Selective Supersampling
 
Implementing a modern, RenderMan compliant, REYES renderer
Implementing a modern, RenderMan compliant, REYES rendererImplementing a modern, RenderMan compliant, REYES renderer
Implementing a modern, RenderMan compliant, REYES renderer
 
Second derivative and graphing
Second derivative and graphingSecond derivative and graphing
Second derivative and graphing
 
Robust Stenciled Shadow Volumes
Robust Stenciled Shadow VolumesRobust Stenciled Shadow Volumes
Robust Stenciled Shadow Volumes
 
Projection Matrices
Projection MatricesProjection Matrices
Projection Matrices
 
A computationally efficient method for sequential MAP-MRF cloud detection
A computationally efficient method for sequential MAP-MRF cloud detectionA computationally efficient method for sequential MAP-MRF cloud detection
A computationally efficient method for sequential MAP-MRF cloud detection
 
Shadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL HardwareShadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL Hardware
 
Global illumination
Global illuminationGlobal illumination
Global illumination
 
Back face detection
Back face detectionBack face detection
Back face detection
 
Paris Master Class 2011 - 04 Shadow Maps
Paris Master Class 2011 - 04 Shadow MapsParis Master Class 2011 - 04 Shadow Maps
Paris Master Class 2011 - 04 Shadow Maps
 
SURF - Speeded Up Robust Features
SURF - Speeded Up Robust FeaturesSURF - Speeded Up Robust Features
SURF - Speeded Up Robust Features
 
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
 
GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)
 

Viewers also liked

Shadow mapping 정리
Shadow mapping 정리Shadow mapping 정리
Shadow mapping 정리changehee lee
 
[1023 박민수] 깊이_버퍼_그림자_1
[1023 박민수] 깊이_버퍼_그림자_1[1023 박민수] 깊이_버퍼_그림자_1
[1023 박민수] 깊이_버퍼_그림자_1MoonLightMS
 
CES 2017: NVIDIA Highlights
CES 2017: NVIDIA HighlightsCES 2017: NVIDIA Highlights
CES 2017: NVIDIA HighlightsNVIDIA
 
Beta oxidation & protein catabolism
Beta oxidation & protein catabolismBeta oxidation & protein catabolism
Beta oxidation & protein catabolismobanbrahma
 
Thin layer chromatography
Thin layer chromatographyThin layer chromatography
Thin layer chromatographyGuruprasad Rao
 
BETA-OXIDATION OF FATTY ACIDS
BETA-OXIDATION OF FATTY ACIDSBETA-OXIDATION OF FATTY ACIDS
BETA-OXIDATION OF FATTY ACIDSYESANNA
 
Thin Layer Chroatography
Thin Layer ChroatographyThin Layer Chroatography
Thin Layer ChroatographyAmrutaSambrekar
 
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술Ki Hyunwoo
 
Beta-oxidation of fatty acids
Beta-oxidation of fatty acidsBeta-oxidation of fatty acids
Beta-oxidation of fatty acidsYESANNA
 

Viewers also liked (12)

Shadow mapping 정리
Shadow mapping 정리Shadow mapping 정리
Shadow mapping 정리
 
[1023 박민수] 깊이_버퍼_그림자_1
[1023 박민수] 깊이_버퍼_그림자_1[1023 박민수] 깊이_버퍼_그림자_1
[1023 박민수] 깊이_버퍼_그림자_1
 
CES 2017: NVIDIA Highlights
CES 2017: NVIDIA HighlightsCES 2017: NVIDIA Highlights
CES 2017: NVIDIA Highlights
 
Beta oxidation & protein catabolism
Beta oxidation & protein catabolismBeta oxidation & protein catabolism
Beta oxidation & protein catabolism
 
Thin layer chromatography
Thin layer chromatographyThin layer chromatography
Thin layer chromatography
 
BETA-OXIDATION OF FATTY ACIDS
BETA-OXIDATION OF FATTY ACIDSBETA-OXIDATION OF FATTY ACIDS
BETA-OXIDATION OF FATTY ACIDS
 
Ketogenesis
KetogenesisKetogenesis
Ketogenesis
 
Thin Layer Chroatography
Thin Layer ChroatographyThin Layer Chroatography
Thin Layer Chroatography
 
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
 
Beta-oxidation of fatty acids
Beta-oxidation of fatty acidsBeta-oxidation of fatty acids
Beta-oxidation of fatty acids
 
Iron metabolism
Iron metabolismIron metabolism
Iron metabolism
 
Fatty acid oxidation
Fatty acid oxidationFatty acid oxidation
Fatty acid oxidation
 

Similar to Optimizing Gradient Shadow Maps

Light Propagation Volume.pdf
Light Propagation Volume.pdfLight Propagation Volume.pdf
Light Propagation Volume.pdfBongseok Cho
 
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)Kyuseok Hwang(allosha)
 
short course on Subsurface stochastic modelling and geostatistics
short course on Subsurface stochastic modelling and geostatisticsshort course on Subsurface stochastic modelling and geostatistics
short course on Subsurface stochastic modelling and geostatisticsAmro Elfeki
 
Geometry Shader-based Bump Mapping Setup
Geometry Shader-based Bump Mapping SetupGeometry Shader-based Bump Mapping Setup
Geometry Shader-based Bump Mapping SetupMark Kilgard
 
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeksBeginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeksJinTaek Seo
 
Vector Distance Transform Maps for Autonomous Mobile Robot Navigation
Vector Distance Transform Maps for Autonomous Mobile Robot NavigationVector Distance Transform Maps for Autonomous Mobile Robot Navigation
Vector Distance Transform Maps for Autonomous Mobile Robot NavigationJanindu Arukgoda
 
Fractal Rendering in Developer C++ - 2012-11-06
Fractal Rendering in Developer C++ - 2012-11-06Fractal Rendering in Developer C++ - 2012-11-06
Fractal Rendering in Developer C++ - 2012-11-06Aritra Sarkar
 
Calc224FinalExamReview
Calc224FinalExamReviewCalc224FinalExamReview
Calc224FinalExamReviewTori Peña
 
Z-transform and Its Inverse.ppt
Z-transform and Its Inverse.pptZ-transform and Its Inverse.ppt
Z-transform and Its Inverse.pptNahi20
 
Website designing company in delhi ncr
Website designing company in delhi ncrWebsite designing company in delhi ncr
Website designing company in delhi ncrCss Founder
 
Website designing company in delhi ncr
Website designing company in delhi ncrWebsite designing company in delhi ncr
Website designing company in delhi ncrCss Founder
 
Lecture01 fractals
Lecture01 fractalsLecture01 fractals
Lecture01 fractalsvijay bane
 
Hierarchical matrices for approximating large covariance matries and computin...
Hierarchical matrices for approximating large covariance matries and computin...Hierarchical matrices for approximating large covariance matries and computin...
Hierarchical matrices for approximating large covariance matries and computin...Alexander Litvinenko
 
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeksBeginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeksJinTaek Seo
 
Maximizing Submodular Function over the Integer Lattice
Maximizing Submodular Function over the Integer LatticeMaximizing Submodular Function over the Integer Lattice
Maximizing Submodular Function over the Integer LatticeTasuku Soma
 
Signals and Systems Ch 4 5_Fourier Domain
Signals and Systems Ch 4 5_Fourier DomainSignals and Systems Ch 4 5_Fourier Domain
Signals and Systems Ch 4 5_Fourier DomainKetan Solanki
 

Similar to Optimizing Gradient Shadow Maps (20)

SA09 Realtime education
SA09 Realtime educationSA09 Realtime education
SA09 Realtime education
 
Glowworm Swarm Optimisation
Glowworm Swarm OptimisationGlowworm Swarm Optimisation
Glowworm Swarm Optimisation
 
Light Propagation Volume.pdf
Light Propagation Volume.pdfLight Propagation Volume.pdf
Light Propagation Volume.pdf
 
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
 
short course on Subsurface stochastic modelling and geostatistics
short course on Subsurface stochastic modelling and geostatisticsshort course on Subsurface stochastic modelling and geostatistics
short course on Subsurface stochastic modelling and geostatistics
 
Geometry Shader-based Bump Mapping Setup
Geometry Shader-based Bump Mapping SetupGeometry Shader-based Bump Mapping Setup
Geometry Shader-based Bump Mapping Setup
 
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeksBeginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
 
Vector Distance Transform Maps for Autonomous Mobile Robot Navigation
Vector Distance Transform Maps for Autonomous Mobile Robot NavigationVector Distance Transform Maps for Autonomous Mobile Robot Navigation
Vector Distance Transform Maps for Autonomous Mobile Robot Navigation
 
Fractal Rendering in Developer C++ - 2012-11-06
Fractal Rendering in Developer C++ - 2012-11-06Fractal Rendering in Developer C++ - 2012-11-06
Fractal Rendering in Developer C++ - 2012-11-06
 
Calc224FinalExamReview
Calc224FinalExamReviewCalc224FinalExamReview
Calc224FinalExamReview
 
Z-transform and Its Inverse.ppt
Z-transform and Its Inverse.pptZ-transform and Its Inverse.ppt
Z-transform and Its Inverse.ppt
 
Website designing company in delhi ncr
Website designing company in delhi ncrWebsite designing company in delhi ncr
Website designing company in delhi ncr
 
Website designing company in delhi ncr
Website designing company in delhi ncrWebsite designing company in delhi ncr
Website designing company in delhi ncr
 
Lecture01 fractals
Lecture01 fractalsLecture01 fractals
Lecture01 fractals
 
Hierarchical matrices for approximating large covariance matries and computin...
Hierarchical matrices for approximating large covariance matries and computin...Hierarchical matrices for approximating large covariance matries and computin...
Hierarchical matrices for approximating large covariance matries and computin...
 
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeksBeginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
 
Maximizing Submodular Function over the Integer Lattice
Maximizing Submodular Function over the Integer LatticeMaximizing Submodular Function over the Integer Lattice
Maximizing Submodular Function over the Integer Lattice
 
Signals and Systems Assignment Help
Signals and Systems Assignment HelpSignals and Systems Assignment Help
Signals and Systems Assignment Help
 
Signals and Systems Ch 4 5_Fourier Domain
Signals and Systems Ch 4 5_Fourier DomainSignals and Systems Ch 4 5_Fourier Domain
Signals and Systems Ch 4 5_Fourier Domain
 
01fourier
01fourier01fourier
01fourier
 

More from 종빈 오

트위터 봇 개발 후기
트위터 봇 개발 후기트위터 봇 개발 후기
트위터 봇 개발 후기종빈 오
 
적당한 스터디 발표자료 만들기 2.0
적당한 스터디 발표자료 만들기 2.0적당한 스터디 발표자료 만들기 2.0
적당한 스터디 발표자료 만들기 2.0종빈 오
 
페리 수열(Farey sequence)
페리 수열(Farey sequence)페리 수열(Farey sequence)
페리 수열(Farey sequence)종빈 오
 
내가 본 미드 이야기
내가 본 미드 이야기내가 본 미드 이야기
내가 본 미드 이야기종빈 오
 
비트 경제와 공짜
비트 경제와 공짜비트 경제와 공짜
비트 경제와 공짜종빈 오
 
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해종빈 오
 
[Windows via c/c++] 4장 프로세스
[Windows via c/c++] 4장 프로세스[Windows via c/c++] 4장 프로세스
[Windows via c/c++] 4장 프로세스종빈 오
 
Intrusive data structure 소개
Intrusive data structure 소개Intrusive data structure 소개
Intrusive data structure 소개종빈 오
 
2011 아꿈사 오전반 포스트모템
2011 아꿈사 오전반 포스트모템2011 아꿈사 오전반 포스트모템
2011 아꿈사 오전반 포스트모템종빈 오
 
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81종빈 오
 
[GEG1] 3.volumetric representation of virtual environments
[GEG1] 3.volumetric representation of virtual environments[GEG1] 3.volumetric representation of virtual environments
[GEG1] 3.volumetric representation of virtual environments종빈 오
 
넘쳐나는 정보 소화 노하우
넘쳐나는 정보 소화 노하우넘쳐나는 정보 소화 노하우
넘쳐나는 정보 소화 노하우종빈 오
 
[Domain driven design] 17장 전략의 종합
[Domain driven design] 17장 전략의 종합[Domain driven design] 17장 전략의 종합
[Domain driven design] 17장 전략의 종합종빈 오
 
LevelDB 간단한 소개
LevelDB 간단한 소개LevelDB 간단한 소개
LevelDB 간단한 소개종빈 오
 
[GEG1] 2.the game asset pipeline
[GEG1] 2.the game asset pipeline[GEG1] 2.the game asset pipeline
[GEG1] 2.the game asset pipeline종빈 오
 
[TAOCP] 2.5 동적인 저장소 할당
[TAOCP] 2.5 동적인 저장소 할당[TAOCP] 2.5 동적인 저장소 할당
[TAOCP] 2.5 동적인 저장소 할당종빈 오
 
[GEG1] 24. key value dictionary
[GEG1] 24. key value dictionary[GEG1] 24. key value dictionary
[GEG1] 24. key value dictionary종빈 오
 
[TAOCP] 2.2.3 연결된 할당 - 위상정렬
[TAOCP] 2.2.3 연결된 할당 - 위상정렬[TAOCP] 2.2.3 연결된 할당 - 위상정렬
[TAOCP] 2.2.3 연결된 할당 - 위상정렬종빈 오
 
[TAOCP] 1.3.1 MIX 설명
[TAOCP] 1.3.1 MIX 설명[TAOCP] 1.3.1 MIX 설명
[TAOCP] 1.3.1 MIX 설명종빈 오
 
[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering종빈 오
 

More from 종빈 오 (20)

트위터 봇 개발 후기
트위터 봇 개발 후기트위터 봇 개발 후기
트위터 봇 개발 후기
 
적당한 스터디 발표자료 만들기 2.0
적당한 스터디 발표자료 만들기 2.0적당한 스터디 발표자료 만들기 2.0
적당한 스터디 발표자료 만들기 2.0
 
페리 수열(Farey sequence)
페리 수열(Farey sequence)페리 수열(Farey sequence)
페리 수열(Farey sequence)
 
내가 본 미드 이야기
내가 본 미드 이야기내가 본 미드 이야기
내가 본 미드 이야기
 
비트 경제와 공짜
비트 경제와 공짜비트 경제와 공짜
비트 경제와 공짜
 
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
 
[Windows via c/c++] 4장 프로세스
[Windows via c/c++] 4장 프로세스[Windows via c/c++] 4장 프로세스
[Windows via c/c++] 4장 프로세스
 
Intrusive data structure 소개
Intrusive data structure 소개Intrusive data structure 소개
Intrusive data structure 소개
 
2011 아꿈사 오전반 포스트모템
2011 아꿈사 오전반 포스트모템2011 아꿈사 오전반 포스트모템
2011 아꿈사 오전반 포스트모템
 
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
 
[GEG1] 3.volumetric representation of virtual environments
[GEG1] 3.volumetric representation of virtual environments[GEG1] 3.volumetric representation of virtual environments
[GEG1] 3.volumetric representation of virtual environments
 
넘쳐나는 정보 소화 노하우
넘쳐나는 정보 소화 노하우넘쳐나는 정보 소화 노하우
넘쳐나는 정보 소화 노하우
 
[Domain driven design] 17장 전략의 종합
[Domain driven design] 17장 전략의 종합[Domain driven design] 17장 전략의 종합
[Domain driven design] 17장 전략의 종합
 
LevelDB 간단한 소개
LevelDB 간단한 소개LevelDB 간단한 소개
LevelDB 간단한 소개
 
[GEG1] 2.the game asset pipeline
[GEG1] 2.the game asset pipeline[GEG1] 2.the game asset pipeline
[GEG1] 2.the game asset pipeline
 
[TAOCP] 2.5 동적인 저장소 할당
[TAOCP] 2.5 동적인 저장소 할당[TAOCP] 2.5 동적인 저장소 할당
[TAOCP] 2.5 동적인 저장소 할당
 
[GEG1] 24. key value dictionary
[GEG1] 24. key value dictionary[GEG1] 24. key value dictionary
[GEG1] 24. key value dictionary
 
[TAOCP] 2.2.3 연결된 할당 - 위상정렬
[TAOCP] 2.2.3 연결된 할당 - 위상정렬[TAOCP] 2.2.3 연결된 할당 - 위상정렬
[TAOCP] 2.2.3 연결된 할당 - 위상정렬
 
[TAOCP] 1.3.1 MIX 설명
[TAOCP] 1.3.1 MIX 설명[TAOCP] 1.3.1 MIX 설명
[TAOCP] 1.3.1 MIX 설명
 
[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering
 

Recently uploaded

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Recently uploaded (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

Optimizing Gradient Shadow Maps

  • 1. ShaderX5 4.2 Multisampling Extension for Gradient Shadow Maps ohyecloudyhttp://ohyecloudy.com shader study http://cafe.naver.com/shader.cafe 2010.5.24
  • 2. Overview of Gradient Shadow Maps Multisampling and PCF Merging the Algorithms Optimizing Texture Look-ups Conclusion
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. • Slope-scale depth bias – gradient를 depth bias에 사용 • Fuzzy depth comparison – 1 or 0이 아니라 0~1 값을 쓴다. • Linearly filtered depth values – point 샘플링이 아니라 보간 해서 사용. • 예) bilinear filter
  • 8. float lightVisibility_GSM(float3 lightCoord) { // get the magnitude of the gradient, by either method float gradient = length(getGradientVector(lightCoord)); // get the difference between stored and interpolated depth // (depthMap should have LINEAR filtering enabled) float diff = tex2D(depthMap, lightCoord.xy).x – lightCoord.z; // replace the less-than operator with a smooth function // for diff >= 0 the result is 1 return saturate(diff/gradient + 1); }
  • 9. Overview of Gradient Shadow Maps Multisampling and PCF Merging the Algorithms Optimizing Texture Look-ups Conclusion
  • 10. float lightVisibility_PCF(float3 ligthCoord) { float result = 0; for (int i = 0; i < n; ++i) { float3 offCoord = lightCoord + offset[i]; result += lightCoord.z < tex2D(depthMap, offCoord.xy).x; } return result / n; }
  • 11. Overview of Gradient Shadow Maps Multisampling and PCF Merging the Algorithms Optimizing Texture Look-ups Conclusion
  • 12. float lightVisibility_PCF_with_GSM(float3 lightCoord) { float result = 0; for (int i = 0; i < n; ++i) { result += lightVisibility_GSM(lightCoord + offset[i]); } return result / n; }
  • 13.
  • 14. incident light incident light surface surface shadow volume shadow volume PCF area PCF area
  • 15. float lightVisibility_GSM_modified(float3 lightCoord, float2 offset) { // get the gradient, by either method float2 gradientVector = getGradientVector(lightCoord); float gradient = length(gradientVector); // calculate an offset coordinate // the z coord is moved along with the local gradient // (this is equivalent to having a local plane equation) float3 offCoord = float3( lightCoord.xy + offset, lightCoord.z + dot(offset, gradientVector)); // the rest is straightforward float diff = offCoord.z – tex2D(depthMap, offCoord.xy).x; return saturate(diff/gradient + 1); }
  • 16. Overview of Gradient Shadow Maps Multisampling and PCF Merging the Algorithms Optimizing Texture Look-ups Conclusion
  • 17. • depth map에 scalar depth 저장했을 때 – gradient vector : texture loockup 3번 • 추가로 depth sampling 한번, PCF에서 4번 • 전체 PCF 영역에서 평균 gradient를 근사 – 최소 제곱 근사값least squares approximation을 찾기 위한 선형회귀linear regression
  • 18. z    x 2  xy  1  z x   x    i i i  z   xy  y 2   z y   y   i   i i  공(共)분산 행렬 covariance matrix  z   pi p i  T 1  zi pi  xy 제거   zi xi   z    x     xi2  z   zi yi    y     yi  2   
  • 19. 8 PCF samples float lightVisibility_unrolled_circluar8(float3 lightCoord) { const float displace = .5 / depthMapResolution; const float displaceLong = 1.41421 * displace; float depths[8] = { tex2D(depthMap, lightCoord.xy + float2(-displaceLong,0)).x, tex2D(depthMap, lightCoord.xy + float2(displaceLong,0)).x, tex2D(depthMap, lightCoord.xy + float2(0,-displaceLong)).x, tex2D(depthMap, lightCoord.xy + float2(0,displaceLong)).x, tex2D(depthMap, lightCoord.xy + float2(-displaceLong,-displaceLong)).x, tex2D(depthMap, lightCoord.xy + float2(displaceLong,-displaceLong)).x, tex2D(depthMap, lightCoord.xy + float2(-displaceLong, displaceLong)).x, tex2D(depthMap, lightCoord.xy + float2(displaceLong, displaceLong)).x }; const float inverseCovariance = 1. / (1 + 1+ 2); float2 gradientVector = float2( depths[1] * 1.41421 + depths[5] + depths[7] -depths[0] * 1.41421 – depths[4] – depths[6], depths[3] * 1.41421 + depths[6] + depths[7] -depths[2] * 1.41421 – depths[4] – depths[5] ) * inverseCovariance; // continue with summation over PCF samples // using the average gradient }
  • 20. Overview of Gradient Shadow Maps Multisampling and PCF Merging the Algorithms Optimizing Texture Look-ups Conclusion
  • 21. • ShaderX4에서 봤던 Acne 제거 기술 복습 – Slope-scale depth bias, – Fuzzy depth comparison, – Linearly filtered depth values • 추가로 부드러운 그림자 가장자리(edge)를 만들기 위한 기술 – PCF – 샘플링 회수를 줄이기 위한 근사