浏览代码

Removed branching on shadow sampling.

/feature-ReflectionProbeFit
Felipe Lira 7 年前
当前提交
aea66b82
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 9
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightShaderLibrary/Shadows.hlsl

9
ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightShaderLibrary/Shadows.hlsl


shadowCoord.xyz = shadowCoord.xyz /= shadowCoord.w;
#endif
if (shadowCoord.x <= 0 || shadowCoord.x >= 1 || shadowCoord.y <= 0 || shadowCoord.y >= 1 || shadowCoord.z <= 0 || shadowCoord.z >= 1)
return 1;
#ifdef _SHADOWS_SOFT
// 4-tap hardware comparison
half4 attenuation4;

#endif
// Apply shadow strength
return LerpWhiteTo(attenuation, _ShadowData.x);
attenuation = LerpWhiteTo(attenuation, _ShadowData.x);
// Shadow coords that fall out of the light frustum volume must always return attenuation 1.0
// TODO: We can set shadowmap sampler to clamptoborder when we don't have a shadow atlas and avoid xy coord bounds check
return (shadowCoord.x <= 0 || shadowCoord.x >= 1 || shadowCoord.y <= 0 || shadowCoord.y >= 1 || shadowCoord.z >= 1) ? 1.0 : attenuation;
}
inline half ComputeCascadeIndex(float3 wpos)

正在加载...
取消
保存