Skip to content

Improve TAA Edge Handling#113003

Closed
mrjustaguy wants to merge 1 commit into
godotengine:masterfrom
mrjustaguy:TAA-Edge
Closed

Improve TAA Edge Handling#113003
mrjustaguy wants to merge 1 commit into
godotengine:masterfrom
mrjustaguy:TAA-Edge

Conversation

@mrjustaguy
Copy link
Copy Markdown
Contributor

@mrjustaguy mrjustaguy commented Nov 21, 2025

Prevents objects from seeing local pixel wide expansions and contractions to it's edges while in motion.

Moving Object that are viewed through a child Camera are the easiest to observe this phenomenon with clearly.

Method Explanation
This works by taking Two histories in to account.

  1. The Raw Motion Vector History, which can hit between Samples
  2. Pixel Centered Motion Vector History, which takes the Closest Sample

It clips Both of them to the Same Standard, resulting in Two possible History Clips.

  1. Raw History is sharp but may suffer the Edge Issue
  2. Pixel Centered History is slightly blurry but doesn't suffer the Edge Issue

If the two values differ too much the history value of the Pixel Centered History is taken as Correct.
The Threshold for determining this has to be high enough to prevent the slight sharpness differences from triggering it, but low enough for the difference in results of the Edges in the Clipped Histories to be detected.

@Saul2022
Copy link
Copy Markdown

Does this improve the flickering when using screen space effects? And with fsr2 ?

@jcostello
Copy link
Copy Markdown
Contributor

Can you show the improvement in a comparison?

@mrjustaguy
Copy link
Copy Markdown
Contributor Author

mrjustaguy commented Nov 21, 2025

Can you show the improvement in a comparison?

Before

unknown_2025.11.21-14.20.mp4

After

unknown_2025.11.21-14.21.mp4

Do note this isn't even fully showcasing the problem, as the MRP still needs some work to fully show the expansion contraction, so the Before is worse in some observed cases

Does this improve the flickering when using screen space effects? And with fsr2 ?

No, and this has Nothing to do with FSR.

The only thing I'm not quite yet satisfied with with TAA after this (beyond not using the same MVs as FSR) is Bright objects on a dark background get basically removed (say lasers at a distance flying in space) which is the next area I'm exploring, though it'll likely require more substantial changes

Edit: I've Resolved the Laser issue with a new anti-flicker algorithm that is both SIGNIFICANTLY more responsive and slightly stabler then the current one (yes, they're not mutually exclusive apparently 😁 ). I'll open a PR for it after this is merged, considering it requires changing a single line that was introduced in this PR in order to not break this PR.

@mrjustaguy
Copy link
Copy Markdown
Contributor Author

mrjustaguy commented Nov 22, 2025

Closing as this PR will be superseded by a PR that changes the Anti Flickering Algorithm which also resolves this, without causing the blur that this PR causes in some scenarios

Edit: Superseded by #113043

@mrjustaguy mrjustaguy closed this Nov 22, 2025
@AThousandShips AThousandShips removed this from the 4.x milestone Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants