Skip to content

Fix taaFrameIndex and restore TAA tests for XR #534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4387,7 +4387,7 @@ PrefabInstance:
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: waitFrames
value: 16
value: 64
objectReference: {fileID: 0}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
Expand All @@ -4397,8 +4397,8 @@ PrefabInstance:
type: 2}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: xrCompatible
value: 0
propertyPath: xrThresholdMultiplier
value: 1.5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4384,11 +4384,6 @@ PrefabInstance:
propertyPath: ImageComparisonSettings.TargetHeight
value: 512
objectReference: {fileID: 0}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: waitFrames
value: 16
objectReference: {fileID: 0}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: renderPipelineAsset
Expand All @@ -4397,8 +4392,13 @@ PrefabInstance:
type: 2}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: xrCompatible
value: 0
propertyPath: waitFrames
value: 64
objectReference: {fileID: 0}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: xrThresholdMultiplier
value: 1.2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed error when undo a Reflection Probe removal in a prefab instance. (case 1244047)
- Tentative fix for missing include in depth of field shaders.
- Fixed the light overlap scene view draw mode (wasn't working at all).
- Fixed taaFrameIndex and XR tests 4052 and 4053

### Changed
- Improve MIP selection for decals on Transparents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,10 @@ internal void Update(FrameSettings currentFrameSettings, HDRenderPipeline hdrp,
screenSize = new Vector4(screenWidth, screenHeight, 1.0f / screenWidth, 1.0f / screenHeight);
screenParams = new Vector4(screenSize.x, screenSize.y, 1 + screenSize.z, 1 + screenSize.w);

const int kMaxSampleCount = 8;
if (++taaFrameIndex >= kMaxSampleCount)
taaFrameIndex = 0;

UpdateAllViewConstants();
isFirstFrame = false;
cameraFrameCount++;
Expand Down Expand Up @@ -912,6 +916,8 @@ void UpdateAllViewConstants()
if (m_XRViewConstants == null || m_XRViewConstants.Length != viewCount)
{
m_XRViewConstants = new ViewConstants[viewCount];
resetPostProcessingHistory = true;
isFirstFrame = true;
}

UpdateAllViewConstants(IsTAAEnabled(), true);
Expand Down Expand Up @@ -1162,10 +1168,6 @@ Matrix4x4 GetJitteredProjectionMatrix(Matrix4x4 origProj)
float jitterY = HaltonSequence.Get((taaFrameIndex & 1023) + 1, 3) - 0.5f;
taaJitter = new Vector4(jitterX, jitterY, jitterX / actualWidth, jitterY / actualHeight);

const int kMaxSampleCount = 8;
if (++taaFrameIndex >= kMaxSampleCount)
taaFrameIndex = 0;

Matrix4x4 proj;

if (camera.orthographic)
Expand Down
2 changes: 1 addition & 1 deletion com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def.asset
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ MonoBehaviour:
xrSettings:
singlePass: 1
occlusionMesh: 1
cameraJitter: 0
cameraJitter: 1
postProcessQualitySettings:
NearBlurSampleCount: 030000000500000008000000
NearBlurMaxRadius:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ MonoBehaviour:
xrSettings:
singlePass: 1
occlusionMesh: 1
cameraJitter: 1
postProcessQualitySettings:
NearBlurSampleCount: 030000000500000008000000
NearBlurMaxRadius:
Expand Down
3 changes: 3 additions & 0 deletions com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public IEnumerator Run(GraphicsTestCase testCase)
yield return null;
}

// Reset temporal effects on hdCamera
HDCamera.GetOrCreate(camera).Reset();

for (int i=0 ; i<settings.waitFrames ; ++i)
yield return null;

Expand Down