浏览代码

[PlanarPRobe] Use oblique matrix for baked planar probes

/main
Frédéric Vauchelles 7 年前
当前提交
8b3b4aa8
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/ReflectionSystemInternal.cs

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/ReflectionSystemInternal.cs


capturePosition = probe.transform.TransformPoint(probe.captureLocalPosition);
captureRotation = Quaternion.LookRotation((Vector3)probe.influenceToWorld.GetColumn(3) - capturePosition, probe.transform.up);
projection = Matrix4x4.Perspective(fov, aspect, nearClipPlane, farClipPlane);
var clipPlane = CameraUtils.CameraSpacePlane(worldToCamera, probe.captureMirrorPlanePosition, probe.captureMirrorPlaneNormal);
projection = Matrix4x4.Perspective(fov, aspect, nearClipPlane, farClipPlane);
projection = CameraUtils.CalculateObliqueMatrix(projection, clipPlane);
}
static void CalculateMirroredCaptureCameraProperties(PlanarReflectionProbe probe, Camera viewerCamera, out float nearClipPlane, out float farClipPlane, out float aspect, out float fov, out CameraClearFlags clearFlags, out Color backgroundColor, out Matrix4x4 worldToCamera, out Matrix4x4 projection, out Vector3 capturePosition, out Quaternion captureRotation)

正在加载...
取消
保存