浏览代码

fix z/y axis swap to column major

/main
Paul Melamed 7 年前
当前提交
53c32b8e
共有 1 个文件被更改,包括 10 次插入3 次删除
  1. 13
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Decal/DecalSystem.cs

13
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Decal/DecalSystem.cs


Matrix4x4 decalRotation = Matrix4x4.Rotate(decal.transform.rotation);
// z/y axis swap for normal to decal space
Vector4 row2 = decalRotation.GetRow(2);
decalRotation.SetRow(2, decalRotation.GetRow(1));
decalRotation.SetRow(1, row2);
float y0 = decalRotation.m01;
float y1 = decalRotation.m11;
float y2 = decalRotation.m21;
decalRotation.m01 = decalRotation.m02;
decalRotation.m11 = decalRotation.m12;
decalRotation.m21 = decalRotation.m22;
decalRotation.m02 = y0;
decalRotation.m12 = y1;
decalRotation.m22 = y2;
m_CachedNormalToWorld[decal.CullIndex] = decalRotation;
m_BoundingSpheres[decal.CullIndex] = GetDecalProjectBoundingSphere(m_CachedTransforms[decal.CullIndex]);

正在加载...
取消
保存