Skip to content

[HDRP] Fix incorrect light list indexing when TAA is enabled #5287

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 3 commits into from
Aug 3, 2021
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
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 @@ -353,6 +353,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix issue with change in lens model (perfect or imperfect) wouldn't be taken into account unless the HDRP asset was rebuilt.
- Fixed custom pass delete operation (case 1354871).
- Fixed viewport size when TAA is executed after dynamic res upscale (case 1348541).
- Fixed incorrect light list indexing when TAA is enabled (case 1352444).

### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ void UpdateVolumeAndPhysicalParameters()
}
}

Matrix4x4 GetJitteredProjectionMatrix(Matrix4x4 origProj)
internal Matrix4x4 GetJitteredProjectionMatrix(Matrix4x4 origProj)
{
// Do not add extra jitter in VR unless requested (micro-variations from head tracking are usually enough)
if (xr.enabled && !HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.xrSettings.cameraJitter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ unsafe void PrepareBuildGPULightListPassData(
for (int viewIndex = 0; viewIndex < hdCamera.viewCount; ++viewIndex)
{
var proj = hdCamera.xr.enabled ? hdCamera.xr.GetProjMatrix(viewIndex) : camera.projectionMatrix;
// Note: we need to take into account the TAA jitter when indexing the light list
proj = hdCamera.RequiresCameraJitter() ? hdCamera.GetJitteredProjectionMatrix(proj) : proj;

m_LightListProjMatrices[viewIndex] = proj * s_FlipMatrixLHSRHS;

var tempMatrix = temp * m_LightListProjMatrices[viewIndex];
Expand Down