浏览代码

Fixed spot light shadows.

/main
Felipe Lira 6 年前
当前提交
824548ef
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 7
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs

7
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


CommandBuffer cmd = CommandBufferPool.Get("Collect Shadows");
SetupShadowReceiverConstants(cmd, visibleLights[lightData.mainLightIndex]);
SetShadowCollectPassKeywords(cmd, ref lightData);
SetShadowCollectPassKeywords(cmd, visibleLights[lightData.mainLightIndex], ref lightData);
cmd.GetTemporaryRT(m_ScreenSpaceShadowMapRTID, m_CurrCamera.pixelWidth, m_CurrCamera.pixelHeight, 0, FilterMode.Bilinear, RenderTextureFormat.R8);
cmd.Blit(null, m_ScreenSpaceShadowMapRT, m_ScreenSpaceShadowsMaterial);

CoreUtils.SetKeyword(cmd, "FOG_EXP2", exponentialFogModeEnabled);
}
private void SetShadowCollectPassKeywords(CommandBuffer cmd, ref LightData lightData)
private void SetShadowCollectPassKeywords(CommandBuffer cmd, VisibleLight shadowLight, ref LightData lightData)
bool cascadeShadows = shadowLight.lightType == LightType.Directional && m_Asset.CascadeCount > 1;
CoreUtils.SetKeyword(cmd, "_SHADOWS_CASCADE", lightData.shadowMapSampleType != LightShadows.None && m_Asset.CascadeCount > 1);
CoreUtils.SetKeyword(cmd, "_SHADOWS_CASCADE", cascadeShadows);
}
private bool RenderShadows(ref CullResults cullResults, ref VisibleLight shadowLight, int shadowLightIndex, ref ScriptableRenderContext context)

正在加载...
取消
保存