浏览代码

Merge pull request #42 from Unity-Technologies/LayeredLit

Fixed the way Utilities.GetViewProjectionMatrix works when given the LookAt parameters so that it matches the camera.worldToCameraMatrix APIs (fixed skybox temporary Cubemap from being flipped)
/main
GitHub 8 年前
当前提交
c1db7458
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/Utilities.cs

9
Assets/ScriptableRenderLoop/HDRenderLoop/Utilities.cs


// The actual projection matrix used in shaders is actually massaged a bit to work across all platforms
// (different Z value ranges etc.)
var gpuProj = GL.GetGPUProjectionMatrix(projectionMatrix, false);
var gpuVP = gpuProj * worldToViewMatrix;
var gpuVP = gpuProj * worldToViewMatrix * Matrix4x4.Scale(new Vector3(1.0f, 1.0f, -1.0f)); // Need to scale -1.0 on Z to match what is being done in the camera.wolrdToCameraMatrix API.
return gpuVP;
}

return GetViewProjectionMatrix(camera.worldToCameraMatrix, camera.projectionMatrix);
// The actual projection matrix used in shaders is actually massaged a bit to work across all platforms
// (different Z value ranges etc.)
var gpuProj = GL.GetGPUProjectionMatrix(camera.projectionMatrix, false);
var gpuVP = gpuProj * camera.worldToCameraMatrix;
return gpuVP;
}
public static Vector4 ComputeScreenSize(Camera camera)

正在加载...
取消
保存