Unexpectedly low performance of temporal antialiasing due to high GPU cost #61905
Description
Godot version
4.0.alpha (b9375ea)
System information
Fedora 36, GeForce GTX 1080 (NVIDIA 510.68.02)
Issue description
In Godot, enabling TAA on a GTX 1080 and a 2560×1440 viewport takes up more than 1.2 ms of GPU time, even in an empty scene with just a Camera3D. The performance impact seems fairly constant regardless of the scene's contents:
Empty scene
TAA disabled | TAA enabled |
---|---|
1 BoxMesh
TAA disabled | TAA enabled |
---|---|
1 BoxMesh + 1 DirectionalLight3D with shadows + Default Environment
TAA disabled | TAA enabled |
---|---|
According to the View Frame Time panel, nearly all of the rendering cost is on the GPU. CPU frame time barely changes when TAA is enabled, at least in simple scenes. Therefore, motion vector generation isn't the bottleneck. The actual TAA shader is more likely to be a bottleneck.
Replacing the main()
function's contents with just return;
in the taa_resolve.glsl
shader results in a black image, but still increases GPU time by 0.7 mspf compared to TAA disabled.
Renderdoc confirms that TAA is indeed taking around 1.2 ms of GPU time. (I don't have access to actual Vulkan profiling tools on this GPU, as it's too old to use Vulkan profiling on NSight.)
At lower resolutions, the performance impact of TAA is much less noticeable:
575×310
TAA disabled | TAA enabled |
---|---|
905×550
TAA disabled | TAA enabled |
---|---|
This doesn't compare favorably to the TAA implementation in other open source rendering engines. For example, in Tesseract, in a semi-complex scene with many objects and lights, the frame time difference between TAA disabled and enabled is only ~0.2 ms ((1.0/333 - 1.0/357) * 1000
):
TAA disabled in Tesseract | TAA enabled in Tesseract |
---|---|
There are many technical differences between Godot 4 and Tesseract's rendering engines:
- Tesseract uses traditional deferred rendering, not clustered forward rendering. It has a non-PBR renderer and favors performance over flexibility.
- Tesseract uses a seemingly simpler (yet effective) form of TAA called TQAA (temporal quincunx antialiasing).
- Tesseract uses OpenGL 4.3 on supported hardware (with 3.3 as a minimum), not Vulkan. This is less efficient than Godot on paper, even though OpenGL can be pretty efficient if used well.
Still, I feel TAA should not be this expensive on the GPU in Godot.
Steps to reproduce
- Enable Perspective > View Frame Time in the top-left corner of the 3D viewport.
- Enable Use Taa in the Project Settings.
Minimal reproduction project
Metadata
Assignees
Type
Projects
Status
For team assessment
Activity