浏览代码

[PlanarReflection] Renamed CameraUtils -> GeometryUtils

/main
Frédéric Vauchelles 7 年前
当前提交
c34bc1a2
共有 6 个文件被更改,包括 10 次插入10 次删除
  1. 2
      ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs
  2. 2
      ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs.meta
  3. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDAdditionalCameraData.cs
  4. 14
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/ReflectionSystemInternal.cs
  5. 0
      /ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs
  6. 0
      /ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs.meta

2
ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs


namespace UnityEngine.Experimental.Rendering
{
public static class CameraUtils
public static class GeometryUtils
{
public static readonly Matrix4x4 FlipMatrixLHSRHS = Matrix4x4.Scale(new Vector3(1, 1, -1));

2
ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs.meta


fileFormatVersion: 2
guid: e745f635b9e142643bc73b74471d3523
guid: 22101f54eb5a9d94c9f6c8f75af844d6
MonoImporter:
externalObjects: {}
serializedVersion: 2

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDAdditionalCameraData.cs


// For custom projection matrices
// Set the proper getter
public NonObliqueProjectionGetter nonObliqueProjectionGetter = CameraUtils.CalculateProjectionMatrix;
public NonObliqueProjectionGetter nonObliqueProjectionGetter = GeometryUtils.CalculateProjectionMatrix;
public Matrix4x4 GetNonObliqueProjection(Camera camera)
{

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


capturePosition = probe.transform.TransformPoint(probe.captureLocalPosition);
captureRotation = Quaternion.LookRotation((Vector3)probe.influenceToWorld.GetColumn(3) - capturePosition, probe.transform.up);
worldToCamera = CameraUtils.CalculateWorldToCameraMatrixRHS(capturePosition, captureRotation);
var clipPlane = CameraUtils.CameraSpacePlane(worldToCamera, probe.captureMirrorPlanePosition, probe.captureMirrorPlaneNormal);
worldToCamera = GeometryUtils.CalculateWorldToCameraMatrixRHS(capturePosition, captureRotation);
var clipPlane = GeometryUtils.CameraSpacePlane(worldToCamera, probe.captureMirrorPlanePosition, probe.captureMirrorPlaneNormal);
projection = CameraUtils.CalculateObliqueMatrix(projection, clipPlane);
projection = GeometryUtils.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)

clearFlags = viewerCamera.clearFlags;
backgroundColor = viewerCamera.backgroundColor;
var worldToCapture = CameraUtils.CalculateWorldToCameraMatrixRHS(viewerCamera.transform);
var reflectionMatrix = CameraUtils.CalculateReflectionMatrix(probe.captureMirrorPlanePosition, probe.captureMirrorPlaneNormal);
var worldToCapture = GeometryUtils.CalculateWorldToCameraMatrixRHS(viewerCamera.transform);
var reflectionMatrix = GeometryUtils.CalculateReflectionMatrix(probe.captureMirrorPlanePosition, probe.captureMirrorPlaneNormal);
var clipPlane = CameraUtils.CameraSpacePlane(worldToCamera, probe.captureMirrorPlanePosition, probe.captureMirrorPlaneNormal);
var clipPlane = GeometryUtils.CameraSpacePlane(worldToCamera, probe.captureMirrorPlanePosition, probe.captureMirrorPlaneNormal);
projection = CameraUtils.CalculateObliqueMatrix(sourceProj, clipPlane);
projection = GeometryUtils.CalculateObliqueMatrix(sourceProj, clipPlane);
capturePosition = reflectionMatrix.MultiplyPoint(viewerCamera.transform.position);

/ScriptableRenderPipeline/Core/CoreRP/CameraUtils.cs → /ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs

/ScriptableRenderPipeline/Core/CoreRP/CameraUtils.cs.meta → /ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs.meta

正在加载...
取消
保存