浏览代码

Fixed shadow filtering issue on main light

/main
Felipe Lira 6 年前
当前提交
6b4d0c0c
共有 1 个文件被更改,包括 4 次插入7 次删除
  1. 11
      com.unity.render-pipelines.lightweight/LWRP/Passes/ScreenSpaceShadowResolvePass.cs

11
com.unity.render-pipelines.lightweight/LWRP/Passes/ScreenSpaceShadowResolvePass.cs


{
public class ScreenSpaceShadowResolvePass : ScriptableRenderPass
{
public bool softShadows { get; set; }
RenderTextureFormat m_ColorFormat;
Material m_ScreenSpaceShadowsMaterial;

: RenderTextureFormat.ARGB32;
m_ScreenSpaceShadowsMaterial = renderer.GetMaterial(MaterialHandles.ScrenSpaceShadow);
softShadows = false;
}
public override void Setup(CommandBuffer cmd, RenderTextureDescriptor baseDescriptor, int[] colorAttachmentHandles, int depthAttachmentHandle = -1, int samples = 1)

return;
CommandBuffer cmd = CommandBufferPool.Get("Collect Shadows");
SetShadowCollectPassKeywords(cmd, renderingData.shadowData.directionalLightCascadeCount);
SetShadowCollectPassKeywords(cmd, ref renderingData.shadowData);
// Note: The source isn't actually 'used', but there's an engine peculiarity (bug) that
// doesn't like null sources when trying to determine a stereo-ized blit. So for proper

CommandBufferPool.Release(cmd);
}
void SetShadowCollectPassKeywords(CommandBuffer cmd, int cascadeCount)
void SetShadowCollectPassKeywords(CommandBuffer cmd, ref ShadowData shadowData)
CoreUtils.SetKeyword(cmd, LightweightKeywords.SoftShadowsText, softShadows);
CoreUtils.SetKeyword(cmd, LightweightKeywords.CascadeShadowsText, cascadeCount > 1);
CoreUtils.SetKeyword(cmd, LightweightKeywords.SoftShadowsText, shadowData.renderedDirectionalShadowQuality == LightShadows.Soft);
CoreUtils.SetKeyword(cmd, LightweightKeywords.CascadeShadowsText, shadowData.directionalLightCascadeCount > 1);
}
}
}
正在加载...
取消
保存