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

TAA followup tracking issue #8423

Open
3 of 15 tasks
JMS55 opened this issue Apr 17, 2023 · 2 comments
Open
3 of 15 tasks

TAA followup tracking issue #8423

JMS55 opened this issue Apr 17, 2023 · 2 comments
Assignees
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Feature A new feature, making something new possible C-Performance A change motivated by improving speed, memory usage or compile times C-Tracking-Issue An issue that collects information about a broad development initiative

Comments

@JMS55
Copy link
Contributor

JMS55 commented Apr 17, 2023

TAA got merged in #7291, but there's a couple of things we could do better.

Compatibility

  • Write motion vectors for skinned meshes correctly
  • Write motion vectors for morph targets correctly
  • Write motion vectors for materials with parallax mapping correctly
  • Support jittering orthographic cameras

Quality

Performance

@JMS55 JMS55 added C-Bug An unexpected or incorrect behavior C-Feature A new feature, making something new possible A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times labels Apr 17, 2023
@nicopap nicopap added the C-Tracking-Issue An issue that collects information about a broad development initiative label Apr 18, 2023
@JMS55 JMS55 self-assigned this May 3, 2023
@JMS55 JMS55 added this to the 0.11 milestone May 3, 2023
@JMS55 JMS55 modified the milestones: 0.11, 0.12 Jun 11, 2023
@nicopap
Copy link
Contributor

nicopap commented Sep 28, 2023

Relevant:

@JMS55 JMS55 mentioned this issue Oct 17, 2023
@JMS55 JMS55 removed this from the 0.12 milestone Oct 17, 2023
@JMS55 JMS55 added this to the 0.14 milestone Feb 5, 2024
@JMS55 JMS55 removed this from the 0.14 milestone Apr 11, 2024
pcwalton added a commit to pcwalton/bevy that referenced this issue May 30, 2024
morph targets.

This is a revamped version of bevyengine#9902. Instead of adding more bind group
layouts as that patch did, which created a combinatorial explosion of
layouts, this patch unconditionally adds `prev_joint_matrices` and
`prev_morph_weights` bindings to the shader bind groups. These add no
significant overhead if unused because we simply bind dummy buffers, and
the driver strips them out if unused. We already do this extensively
with the various `StandardMaterial` bindings as well as the mesh view
bindings, so this approach isn't anything new.

The overall technique consists of double-buffering the joint matrix and
morph weights buffers, as most of the previous attempts to solve this
problem did. The process is generally straightforward. Note that, to
avoid regressing the ability of mesh extraction, skin extraction, and
morph target extraction to run in parallel, I had to add a new system to
rendering, `set_mesh_motion_vector_flags`. The comment there explains
the details; it generally runs very quickly.

I've tested this with modified versions of the `animated_fox`,
`morph_targets`, and `many_foxes` examples that add TAA, and the patch
works. To avoid bloating those examples, I didn't add switches for TAA
to them.

Addresses points (1) and (2) of bevyengine#8423.
pcwalton added a commit to pcwalton/bevy that referenced this issue May 30, 2024
morph targets.

This is a revamped version of bevyengine#9902. Instead of adding more bind group
layouts as that patch did, which created a combinatorial explosion of
layouts, this patch unconditionally adds `prev_joint_matrices` and
`prev_morph_weights` bindings to the shader bind groups. These add no
significant overhead if unused because we simply bind dummy buffers, and
the driver strips them out if unused. We already do this extensively
with the various `StandardMaterial` bindings as well as the mesh view
bindings, so this approach isn't anything new.

The overall technique consists of double-buffering the joint matrix and
morph weights buffers, as most of the previous attempts to solve this
problem did. The process is generally straightforward. Note that, to
avoid regressing the ability of mesh extraction, skin extraction, and
morph target extraction to run in parallel, I had to add a new system to
rendering, `set_mesh_motion_vector_flags`. The comment there explains
the details; it generally runs very quickly.

I've tested this with modified versions of the `animated_fox`,
`morph_targets`, and `many_foxes` examples that add TAA, and the patch
works. To avoid bloating those examples, I didn't add switches for TAA
to them.

Addresses points (1) and (2) of bevyengine#8423.
github-merge-queue bot pushed a commit that referenced this issue May 31, 2024
…orph targets. (#13572)

This is a revamped equivalent to #9902, though it shares none of the
code. It handles all special cases that I've tested correctly.

The overall technique consists of double-buffering the joint matrix and
morph weights buffers, as most of the previous attempts to solve this
problem did. The process is generally straightforward. Note that, to
avoid regressing the ability of mesh extraction, skin extraction, and
morph target extraction to run in parallel, I had to add a new system to
rendering, `set_mesh_motion_vector_flags`. The comment there explains
the details; it generally runs very quickly.

I've tested this with modified versions of the `animated_fox`,
`morph_targets`, and `many_foxes` examples that add TAA, and the patch
works. To avoid bloating those examples, I didn't add switches for TAA
to them.

Addresses points (1) and (2) of #8423.

## Changelog

### Fixed

* Motion vectors, and therefore TAA, are now supported for meshes with
skins and/or morph targets.
@Affinator
Copy link

What is missing to implement jittering orthograpic cameras?

When I just remove the check from camera.rs ...

if clip_from_view.w_axis.w == 1.0 {
   warn!(
       "TemporalJitter not supported with OrthographicProjection. Use PerspectiveProjection instead."
   );
   return;
}

... then TAA seems to work (fine)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Feature A new feature, making something new possible C-Performance A change motivated by improving speed, memory usage or compile times C-Tracking-Issue An issue that collects information about a broad development initiative
Projects
None yet
Development

No branches or pull requests

3 participants