12
GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process http://www.kindnap.pe.kr http://cafe.naver.com/shader

GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

  • Upload
    lula

  • View
    62

  • Download
    0

Embed Size (px)

DESCRIPTION

GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process. http://www.kindnap.pe.kr http://cafe.naver.com/shader. introduction. 간단한 후처리 방법으로 대기중의 그림자에 반응하는 volumetric light scattering 효과를 구현해본다 . Figure 13-1 Volumetric Light Scattering on a Highly Animated Scene in Real Time. - PowerPoint PPT Presentation

Citation preview

Page 1: GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

GPU Gems 3Chapter 13. Volumetric Light Scattering

as a Post-Process

http://www.kindnap.pe.krhttp://cafe.naver.com/shader

Page 2: GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

introduction간단한 후처리 방법으로 대기중의 그림자에 반응하는

volumetric light scattering 효과를 구현해본다 .

Figure 13-1 Volumetric Light Scat-tering on a Highly Animated Scene in Real Time

Page 3: GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

introduction대기중의 차폐물에 반응하여 산란하는 효과를 보이는 빛을 만드는 것이 목표정밀한 산란공식을 적용하기 보단 , 단순화된 공식을 적용 근사한 효과를 얻어냄

Page 4: GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

Shader CodeExample 13-1. Post-Process Shader Implementation of Additive Sampling

   float4 main(float2 texCoord : TEXCOORD0) : COLOR0   {   

  // Calculate vector from pixel to light source in screen space.      half2 deltaTexCoord = (texCoord - ScreenLightPos.xy);     // Divide by number of samples and scale by control factor.     deltaTexCoord *= 1.0f / NUM_SAMPLES * Density;     // Store initial sample.      half3 color = tex2D(frameSampler, texCoord);     // Set up illumination decay factor.      half illuminationDecay = 1.0f;     // Evaluate summation from Equation 3 NUM_SAMPLES iterations.      for (int i = 0; i < NUM_SAMPLES; i++)     {       // Step sample location along ray.       texCoord -= deltaTexCoord;       // Retrieve sample at new location.      half3 sample = tex2D(frameSampler, texCoord);       // Apply sample attenuation scale/decay factors.       sample *= illuminationDecay * Weight;       // Accumulate combined color.       color += sample;       // Update exponential decay factor.       illuminationDecay *= Decay;     }     // Output final color with a further scale control factor.     return float4( color * Exposure, 1);   

}  

Page 5: GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

Implementation화면을 구성합니다 .

Page 6: GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

Implementation새로운 RT 를 생성하여 태양을 그림 스텐실을 사용하여 보이는 부분만을 걸려냄다운 사이즈 (Next Pass)

Page 7: GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

ImplementationShader 적용

Page 8: GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

Implementation화면과 결과물의 조합

- 동영상 -

Page 9: GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

Other Solution언리얼

Page 10: GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

Other SolutionCrysis

Page 11: GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

Other Solutionunigine

Page 12: GPU Gems 3 Chapter 13. Volumetric Light Scattering as a Post-Process

Screen Space Sun Shafts in CrysisS6172i1.pdf 문서 참조