Open LaoLittle opened 11 months ago
I can reproduce, but I'm not sure why it occurs yet. Bind group 0 should be the mesh view bindings, which doesn't look like it's affected by TAA.
I've fixed the panic with bf2385f167f903be1bc821cc44bad382225a2f0b, but for TAA to work properly the outline shader also needs to write to the depth and motion vector textures. Alternatively, the outline pass could run after TAA but then outlines wouldn't be anti-aliased.
but for TAA to work properly the outline shader also needs to write to the depth and motion vector textures. Alternatively, the outline pass could run after TAA but then outlines wouldn't be anti-aliased.
I think the TAA just works.
Without TAA:
With TAA enabled:
Is the sphere moving in your example? If it's not moving then the motion vectors will be zero just like the background and it will look correct. However, if you enable TAA on one of the examples with moving objects, then you can see that the border of the outline has a fuzzy effect. Per comments in the Bevy source code:
It is very important that correct motion vectors are written for everything on screen. Failure to do so will lead to ghosting artifacts. For instance, if particle effects are added using a third party library, the library must either:
- Write particle motion vectors to the motion vectors prepass texture
- Render particles after TAA
I will address this issue, but I cannot guarantee a time scale.
Is the sphere moving in your example?
No. You are right, the borders of moving objects are kinda fuzzy
@komadori could you draft a patch release with the panic fix?
@Shatur I've released the interim fix in 0.6.1.
One problem is that TAA reads from both the motion vector buffer and the depth buffer. However, the outline pass reuses and clears the depth buffer, and so I'm not sure how to make TAA work correctly after outlining.
Presently, I've changed the render graph so that the outlining node runs between the tone-mapping and FXAA labels and hence after TAA. This means that there are no TAA artefacts caused by outlining, but outlines are not anti-aliased by TAA.
The new ui_aa example on master illustrates this.
@komadori panics for me with TAA enabled on 0.14 :(
thread '<unnamed>' panicked at /home/gena/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2996:5:
wgpu error: Validation Error
Caused by:
In a RenderPass
note: encoder = `<CommandBuffer-(16, 1, Vulkan)>`
In a draw command, indexed:true indirect:false
note: render pipeline = `outline_pipeline`
Incompatible bind group at index 1 in the current render pipeline
note: Should be compatible an with an explicit bind group layout with label = `skinned_mesh_layout`
note: Assigned explicit bind group layout with label = `skinned_motion_mesh_layout`
note: Entry 6 not found in expected bind group layout
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace