Skip to content

Use the proper history info for Bicubic resampling in TAA #2759

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 2 commits into from
Nov 26, 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
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 @@ -43,6 +43,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed the clear coat not being handled properly for SSR and RTR (case 1291654).
- Fixed ghosting in RTGI and RTAO when denoising is enabled and the RTHandle size is not equal to the Viewport size (case 1291654).
- Fixed alpha output when atmospheric scattering is enabled.
- Fixed issue with TAA history sharpening when view is downsampled.

### Changed
- Volume Manager now always tests scene culling masks. This was required to fix hybrid workflow.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,7 @@ struct TemporalAntiAliasingParameters
public MaterialPropertyBlock taaPropertyBlock;
public bool resetPostProcessingHistory;

public Vector4 previousScreenSize;
public Vector4 taaParameters;
public Vector4 taaFilterWeights;
public bool motionVectorRejection;
Expand Down Expand Up @@ -1681,6 +1682,8 @@ TemporalAntiAliasingParameters PrepareTAAParameters(HDCamera camera, bool PostDO

parameters.taaHistoryPropertyBlock = m_TAAHistoryBlitPropertyBlock;
parameters.taaPropertyBlock = m_TAAPropertyBlock;
Vector2Int prevViewPort = camera.historyRTHandleProperties.previousViewportSize;
parameters.previousScreenSize = new Vector4(prevViewPort.x, prevViewPort.y, 1.0f / prevViewPort.x, 1.0f / prevViewPort.y);

return parameters;
}
Expand Down Expand Up @@ -1719,9 +1722,7 @@ static void DoTemporalAntialiasing(in TemporalAntiAliasingParameters taaParams,

taaParams.taaPropertyBlock.SetTexture(HDShaderIDs._DepthTexture, depthMipChain);

Vector2 historySize = new Vector2(prevHistory.referenceSize.x * prevHistory.scaleFactor.x,
prevHistory.referenceSize.y * prevHistory.scaleFactor.y);
var taaHistorySize = new Vector4(historySize.x, historySize.y, 1.0f / historySize.x, 1.0f / historySize.y);
var taaHistorySize = taaParams.previousScreenSize;

taaParams.taaPropertyBlock.SetVector(HDShaderIDs._TaaPostParameters, taaParams.taaParameters);
taaParams.taaPropertyBlock.SetVector(HDShaderIDs._TaaHistorySize, taaHistorySize);
Expand Down