浏览代码

Lw/bugfix/1059142 (#1823)

*  Fixed lightweight directional cascade culling.

*  updated release notes
/main
GitHub 6 年前
当前提交
7fb58b9a
共有 4 个文件被更改,包括 6 次插入5 次删除
  1. 1
      com.unity.render-pipelines.lightweight/CHANGELOG.md
  2. 4
      com.unity.render-pipelines.lightweight/LWRP/LightweightShadowUtils.cs
  3. 4
      com.unity.render-pipelines.lightweight/LWRP/Passes/DirectionalShadowsPass.cs
  4. 2
      com.unity.render-pipelines.lightweight/LWRP/Passes/LocalShadowsPass.cs

1
com.unity.render-pipelines.lightweight/CHANGELOG.md


- The UI for Lightweight asset has been updated with new categories. A more clean structure and foldouts has been added to keep things organized.
### Fixed
- Shadow casters are now properly culled per cascade. (case 1059142)
- Rendering no longer breaks when Android platform is selected in Build Settings. (case 1058812)
- Scriptable passes no longer have missing material references. Now they access cached materials in the renderer.(case 1061353)
- When you change a Shadow Cascade option in the Pipeline Asset, this no longer warns you that you've exceeded the array size for the _WorldToShadow property.

4
com.unity.render-pipelines.lightweight/LWRP/LightweightShadowUtils.cs


}
public static void RenderShadowSlice(CommandBuffer cmd, ref ScriptableRenderContext context,
ref ShadowSliceData shadowSliceData,
Matrix4x4 proj, Matrix4x4 view, DrawShadowsSettings settings)
ref ShadowSliceData shadowSliceData, ref DrawShadowsSettings settings,
Matrix4x4 proj, Matrix4x4 view)
{
cmd.SetViewport(new Rect(shadowSliceData.offsetX, shadowSliceData.offsetY, shadowSliceData.resolution, shadowSliceData.resolution));
cmd.EnableScissorRect(new Rect(shadowSliceData.offsetX + 4, shadowSliceData.offsetY + 4, shadowSliceData.resolution - 8, shadowSliceData.resolution - 8));

4
com.unity.render-pipelines.lightweight/LWRP/Passes/DirectionalShadowsPass.cs


success = LightweightShadowUtils.ExtractDirectionalLightMatrix(ref cullResults, ref shadowData, shadowLightIndex, cascadeIndex, shadowResolution, shadowNearPlane, out m_CascadeSplitDistances[cascadeIndex], out m_CascadeSlices[cascadeIndex], out view, out proj);
if (success)
{
settings.splitData.cullingSphere = m_CascadeSplitDistances[cascadeIndex];
LightweightShadowUtils.RenderShadowSlice(cmd, ref context, ref m_CascadeSlices[cascadeIndex], proj,
view, settings);
LightweightShadowUtils.RenderShadowSlice(cmd, ref context, ref m_CascadeSlices[cascadeIndex], ref settings, proj, view);
}
}

2
com.unity.render-pipelines.lightweight/LWRP/Passes/LocalShadowsPass.cs


var settings = new DrawShadowsSettings(cullResults, shadowLightIndex);
LightweightShadowUtils.SetupShadowCasterConstants(cmd, ref shadowLight, proj, sliceResolution);
LightweightShadowUtils.RenderShadowSlice(cmd, ref context, ref m_LocalLightSlices[i], proj, view, settings);
LightweightShadowUtils.RenderShadowSlice(cmd, ref context, ref m_LocalLightSlices[i], ref settings, proj, view);
}
}

正在加载...
取消
保存