浏览代码

Do not perform blending with the environment map if the sky is occluded

/main
Evgenii Golubev 8 年前
当前提交
92576fff
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 5
      Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources/SkyHDRI.shader

5
Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources/SkyHDRI.shader


float rawDepth = max(LOAD_TEXTURE2D(_CameraDepthTexture, coord.unPositionSS).r, 0.01);
float3 positionWS = UnprojectToWorld(rawDepth, coord.positionSS, _InvViewProjMatrix);
// Do not perform blending with the environment map if the sky is occluded.
float skyDomeWeight = (rawDepth > 0.01) ? 0.0 : 1.0;
float4 c1, c2, c3;
VolundTransferScatter(positionWS, c1, c2, c3);

#endif
// Blend with the color of the scene.
return float4(skyDome * extinction + scatter, 0.0);
return float4(skyDome * (skyDomeWeight * extinction) + scatter, 0.0);
}
ENDHLSL

正在加载...
取消
保存