浏览代码

Fix decal normal to world transform

/main
Paul Melamed 7 年前
当前提交
907898d9
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Decal/DecalProjectorComponent.cs

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Decal/DecalProjectorComponent.cs


public const int kInvalidIndex = -1;
private int m_CullIndex = kInvalidIndex;
private static Matrix4x4 m_NormalToWorld = Matrix4x4.Scale(new Vector3(1.0f, 1.0f, -1.0f)) * Matrix4x4.Rotate(Quaternion.AngleAxis(-90.0f, new Vector3(1, 0, 0)));
public int CullIndex
{
get

}
Matrix4x4 final = transform.localToWorldMatrix;
Matrix4x4 decalToWorldR = Matrix4x4.Rotate(transform.localRotation);
Matrix4x4 decalToWorldR = Matrix4x4.Rotate(transform.rotation) * m_NormalToWorld;
Matrix4x4 worldToDecal = Matrix4x4.Translate(new Vector3(0.5f, 0.0f, 0.5f)) * Matrix4x4.Scale(new Vector3(1.0f, -1.0f, 1.0f)) * final.inverse;
if (m_PropertyBlock == null)
{

正在加载...
取消
保存