浏览代码

Fixed CSM clipping issue

/main
runes 8 年前
当前提交
f1ab4d10
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 4
      Assets/ScriptableRenderLoop/RenderPasses/ShadowRenderPass.cs

4
Assets/ScriptableRenderLoop/RenderPasses/ShadowRenderPass.cs


var lightType = visibleLights[lightIndex].lightType;
var lightDirection = visibleLights[lightIndex].light.transform.forward;
var shadowNearClip = visibleLights[lightIndex].light.shadowNearPlane;
var shadowNearPlaneOffset = QualitySettings.shadowNearPlaneOffset;
int shadowSliceIndex = packedShadows.GetShadowSliceIndex(lightIndex, 0);

{
var settings = new DrawShadowsSettings(cullResults, lightIndex);
var shadowResolution = shadowSlices[shadowSliceIndex].shadowResolution;
bool needRendering = cullResults.ComputeDirectionalShadowMatricesAndCullingPrimitives(lightIndex, s, shadowSliceCount, splitRatio, shadowResolution, shadowNearClip, out view, out proj, out settings.splitData);
bool needRendering = cullResults.ComputeDirectionalShadowMatricesAndCullingPrimitives(lightIndex, s, shadowSliceCount, splitRatio, shadowResolution, shadowNearPlaneOffset, out view, out proj, out settings.splitData);
packedShadows.directionalShadowSplitSphereSqr[s] = settings.splitData.cullingSphere;
packedShadows.directionalShadowSplitSphereSqr[s].w *= packedShadows.directionalShadowSplitSphereSqr[s].w;

正在加载...
取消
保存