Skip to content
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

Vulkan: TAA does not make the editor redraw until it has fully converged #62887

Open
Tracked by #69494
Calinou opened this issue Jul 10, 2022 · 2 comments
Open
Tracked by #69494

Comments

@Calinou
Copy link
Member

Calinou commented Jul 10, 2022

Related to #54892, #54893 and #56723.

Godot version

4.0.alpha11, 4.3.dev4

System information

Fedora 36, GeForce GTX 1080 (NVIDIA 510.68.02)

Issue description

Temporal antialiasing (TAA) does not make the editor redraw until it has fully converged. This means that when toggling TAA or changing a setting that causes it to regenerate (such as resizing the editor viewport), it will have partially-converged appearance until you move the 3D camera around a bit (or cause the editor viewport to update somehow, e.g. by hovering controls).

We should resolve this by forcing the engine to redraw for 16 frames every time something is updated when both TAA and low processor mode are enabled.1 (16 frames is the duration of the Halton jitter sequence used by TAA.)

Steps to reproduce

  • Add some MeshInstance3Ds with BoxMeshes.
  • Enable Use TAA in the Project Settings. Don't move the 3D editor camera for now. Notice the boxes' edges being aliased.
  • Start moving the 3D editor camera slowly (use mouse wheel or hold Alt while using freelook). Notice how boxes' edges are smooth, at least until you stop moving.
  • Enable Update Continuously in the Editor Settings to force the editor to redraw every frame. Notice how edges are smooth.

Minimal reproduction project

N/A

Footnotes

  1. We shouldn't just do this when the camera moves, as other objects being updated (such as a mesh's visibility being toggled) also requires the TAA to fully converge to look good – even if the camera doesn't move.

@DarioSamo
Copy link
Contributor

Part of my proposal for FSR 2 requires to add a flag for discarding the history of the scene to the viewport ("reset accumulation"). This is just a boolean that should be used and cleared once the accumulation is reset. Adding this kind of control seems like it'd allow fixing this issue easily.

Adding this setting to the viewport would be beneficial for this case as well as the editor could clear the flag correctly whenever a setting changes. The current TAA implementation can also be extended to take this setting into account to properly clear the history buffer. This would give users all the control they need over resetting the effect of temporal accumulation techniques when major changes occur in the scene.

Maybe we could split this idea into a proposal instead?

@Calinou
Copy link
Member Author

Calinou commented Nov 10, 2023

Adding this kind of control seems like it'd allow fixing this issue easily.

While we need a "reset accumulation" method, we still need to force drawing until the rendering has fully converged when using low-processor mode. Otherwise, you'll be left with an aliased image unless something in the scene happens to be forcing redrawing (such as a shader using TIME or an active animation).

Now that FSR2 is implemented, this also means we should add a method to return the number of frames required to fully converge TAA (since this varies depending on FSR2 input resolution scale). Having this exposed separately is useful for scripts that automatically take screenshots, so that you can wait until the image is fully converged before taking the screenshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants