浏览代码

Fixed bug where probes with scaling in their transform would render incorrectly

/main
runes 8 年前
当前提交
bb33bfce
共有 1 个文件被更改,包括 9 次插入6 次删除
  1. 15
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/TilePass/TilePass.cs

15
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/TilePass/TilePass.cs


var mat = probe.localToWorld;
Vector3 vx = mat.GetColumn(0);
Vector3 vy = mat.GetColumn(1);
Vector3 vz = mat.GetColumn(2);
Vector3 vw = mat.GetColumn(3);
vx.Normalize(); // Scale shouldn't affect the probe or its bounds
vy.Normalize();
vz.Normalize();
//Vector3 C = bnds.center; // P + boxOffset;
var C = mat.MultiplyPoint(boxOffset); // same as commented out line above when rot is identity
var C = vx * boxOffset.x + vy * boxOffset.y + vz * boxOffset.z + vw;
Vector3 vx = mat.GetColumn(0);
Vector3 vy = mat.GetColumn(1);
Vector3 vz = mat.GetColumn(2);
// transform to camera space (becomes a left hand coordinate frame in Unity since Determinant(worldToView)<0)
vx = worldToView.MultiplyVector(vx);

正在加载...
取消
保存