Prepass fragment shader is not run for opaque materials on version 0.16+
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## Bevy version
0.16 & main
## Relevant system information
```ignore
`AdapterInfo { name: "AMD Radeon RX 7900 XTX (RADV NAVI31)", vendor: 4098, device: 29772, device_type: DiscreteGpu, driver: "radv", driver_info: "Mesa 24.2.6", backend: Vulkan }`
```
## What you did
I modified the `shader_prepass` example to show the issue. See the code here: https://github.com/hansler/bevy/tree/feature/prepass_shader_alpha_example
If you grab that branch and run `cargo run --example shader_prepass`, you can reproduce the issue.
## What went wrong
On 0.15, if I create an ExtendedMaterial as I did in the example with `AlphaMode::Opaque` and use `discard` in the prepass fragment shader, the mesh's shadow respects the discarded fragments. (Note: The opacity value in my example influences a Bayer matrix, so it's discarding fragments, not influencing the alpha color value.)
When I upgraded to 0.16, this is no longer the case. Shadows seem to ignore the prepass fragment shader.
## Screenshot

In this screenshot, there are three cubes: One with Opaque, one with AlphaMask(1.0), and one with Blend. All three cubes have most of their fragments discarded, in both the standard and the prepass fragment shader. The AlphaMask and Blend cubes are casting shadows according to the prepass fragment shader, but the opaque cube's shadow seems to be ignoring the discarded fragments in the prepass shader.
I couldn't find anything related to this in the 0.16 release notes or migration guide, so since this behaved differently in 0.15, I think this is a regression.
Contributor guide
Assessment
This issue has not been assessed yet.