SMAA looks extreme in split screen on non-top level viewports
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
0.14.0
The release number or commit hash of the version you're using.
b231ebbc195e12ae47616748e532c8dbc24218dd (branch `release-0.14.0`, also tried with crates.io version)
#### System information
Archi Linux (EndeavorOS)
DE: KDE Plasma
```ignore
AdapterInfo { name: "NVIDIA GeForce RTX 3080", vendor: 4318, device: 8726, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "555.58", backend: Vulkan }
```
## What you did
I added the SmaaSettings to the cameras in my split screen game.
```rust
SmaaSettings {
preset: SmaaPreset::High,
},
```
## What went wrong
I was expecting SMAA to look the same on every camera but instead it looked stronger on the additional cameras.
## Additional information
I was able to replicate this on the Bevy split_screen example:

You can see it on the UI buttons the most.
I believe this is caused by the effect writing outside the camera's viewport causing a multiplying effect with the camera's layered on top of each other. Restricting it to the camera's viewport somehow would probably solve this.
If we get this solved, we should update the `post_processing` example too as it suffers from the same problem. It's not going to be obvious in that example, but it's used as an example for creating other fullscreen effects. I used it to create a film grain noise effect and it has the same problem of the noise being multiplied from other cameras depending on the order.
Here's an example of it happening with my noise shader in case it helps make sense of the problem. The camera order decreases starting from the top left, so the effect is more pronounced on later cameras because, I assume, the previous camera's effect is rendered on top of them:

Contributor guide
Research direction
Start by reproducing the issue in the Bevy split_screen example with SmaaSettings and compare the additional camera viewports. Then inspect the SMAA post-processing path and the post_processing example, which shows the same multi-camera behavior. Done means post-processing is isolated per camera viewport and both examples behave correctly with split-screen cameras.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100