Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 9de8b18

Browse files
committed
Gate XR TAA for 2017.3 and newer
Camera.CopyStereoDeviceProjectionMatrixToNonJittered and Camera.GetStereoNonJitteredProjectionMatrix are only on 2017.3, so we can't really support XR TAA before that. Also, fixed a method name typo
1 parent 51877f6 commit 9de8b18

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

PostProcessing/Runtime/Effects/TemporalAntialiasing.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public bool IsSupported()
5757
{
5858
return SystemInfo.supportedRenderTargetCount >= 2
5959
&& SystemInfo.supportsMotionVectors
60+
#if !UNITY_2017_3_OR_NEWER
61+
&& !RuntimeUtilities.isVREnabled
62+
#endif
6063
&& SystemInfo.graphicsDeviceType != GraphicsDeviceType.OpenGLES2;
6164
}
6265

@@ -104,16 +107,17 @@ public Matrix4x4 GetJitteredProjectionMatrix(Camera camera)
104107
return cameraProj;
105108
}
106109

107-
public void ConfiguredJitteredProjectionMatrix(PostProcessRenderContext context)
110+
public void ConfigureJitteredProjectionMatrix(PostProcessRenderContext context)
108111
{
109112
var camera = context.camera;
110113
camera.nonJitteredProjectionMatrix = camera.projectionMatrix;
111114
camera.projectionMatrix = GetJitteredProjectionMatrix(camera);
112115
camera.useJitteredProjectionMatrixForTransparentRendering = false;
113116
}
114117

115-
public void ConfiguredStereoJitteredProjectionMatrices(PostProcessRenderContext context)
118+
public void ConfigureStereoJitteredProjectionMatrices(PostProcessRenderContext context)
116119
{
120+
#if UNITY_2017_3_OR_NEWER
117121
var camera = context.camera;
118122
jitter = GenerateRandomOffset();
119123
jitter *= jitterSpread;
@@ -134,6 +138,7 @@ public void ConfiguredStereoJitteredProjectionMatrices(PostProcessRenderContext
134138
// which could be double-wide in certain stereo rendering scenarios
135139
jitter = new Vector2(jitter.x / context.singleEyeWidth, jitter.y / context.height);
136140
camera.useJitteredProjectionMatrixForTransparentRendering = false;
141+
#endif
137142
}
138143

139144
private void GenerateHistoryName(RenderTexture rt, int id, PostProcessRenderContext context)

PostProcessing/Runtime/PostProcessLayer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,10 +585,10 @@ public void Render(PostProcessRenderContext context)
585585
{
586586
// We only need to configure all of this once for stereo, during OnPreCull
587587
if (context.camera.stereoActiveEye != Camera.MonoOrStereoscopicEye.Right)
588-
temporalAntialiasing.ConfiguredStereoJitteredProjectionMatrices(context);
588+
temporalAntialiasing.ConfigureStereoJitteredProjectionMatrices(context);
589589
}
590590
else
591-
temporalAntialiasing.ConfiguredJitteredProjectionMatrix(context);
591+
temporalAntialiasing.ConfigureJitteredProjectionMatrix(context);
592592
}
593593

594594
var taaTarget = m_TargetPool.Get();

0 commit comments

Comments
 (0)