浏览代码

fix a bug on reflection probes that clip the near plane. Was passing world rotation to matrix but shader isnt dealing with rotation. Just like builtin unity, rotation will be ignored.

/main
Filip Iliescu 8 年前
当前提交
431c9bfe
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 8
      Assets/ScriptableRenderPipeline/MobileRenderPipeline/ClassicDeferred/ClassicDeferredPipeline.cs

8
Assets/ScriptableRenderPipeline/MobileRenderPipeline/ClassicDeferred/ClassicDeferredPipeline.cs


var bnds = rl.bounds;
var boxOffset = rl.center; // reflection volume offset relative to cube map capture point
var blendDistance = rl.blendDistance;
var mat = rl.localToWorld;
// TODO: fix for rotations on probes... Builtin Unity also does not take these into account, for now just grab position for mat
//var mat = rl.localToWorld;
Matrix4x4 mat = Matrix4x4.identity;
mat.SetColumn (3, rl.localToWorld.GetColumn (3));
var boxProj = (rl.boxProjection != 0);
var probePosition = mat.GetColumn (3); // translation vector
var probePosition1 = new Vector4 (probePosition [0], probePosition [1], probePosition [2], boxProj ? 1f : 0f);

正在加载...
取消
保存