浏览代码

workaround to alleviate the bias cascade issue while we don't have a proper solution.

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

5
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


// Scale bias by cascade's world space depth range.
// Directional shadow lights have orthogonal projection.
// proj.m22 = -2 / (far - near) since the projection's depth range is [-1.0, 1.0]
// Therefore we scale it by 0.5. We keep the negative sign and only flip it in case z is
// reversed.
// In order to be correct we should multiply bias by 0.5 but this introducing aliasing along cascades more visible.
bias = light.shadowBias * proj.m22 * 0.5f * sign;
bias = light.shadowBias * proj.m22 * sign;
// Currently only square POT cascades resolutions are used.
// We scale normalBias

正在加载...
取消
保存