浏览代码

Screenspace Shadow samples work in stereo doublewide

The screen-space shadow map texture coordinates need to be corrected for stereo, but it has to happen after the perspective divide in SampleScreenSpaceShadowMap
/2018.1
Tim Cooper 7 年前
当前提交
34a401c8
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4
      ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Shadows.hlsl

4
ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Shadows.hlsl


inline half SampleScreenSpaceShadowMap(float4 shadowCoord)
{
shadowCoord.xy /= shadowCoord.w;
// The stereo transform has to happen after the manual perspective divide
shadowCoord.xy = UnityStereoTransformScreenSpaceTex(shadowCoord.xy);
half attenuation = SAMPLE_TEXTURE2D(_ScreenSpaceShadowMap, sampler_ScreenSpaceShadowMap, shadowCoord.xy).x;
// Apply shadow strength

正在加载...
取消
保存