bevy/crates/bevy_pbr/src/prepass
robtfm 5cc3352f5b
allow DeferredPrepass to work without other prepass markers (#10223)
# Objective

fix crash / misbehaviour when `DeferredPrepass` is used without
`DepthPrepass`.

- Deferred lighting requires the depth prepass texture to be present, so
that the depth texture is available for binding. without it the deferred
lighting pass will use 0 for depth of all meshes.
- When `DeferredPrepass` is used without other prepass markers, and with
any materials that use `OpaqueRenderMode::Forward`, those entities will
try to queue to the `Opaque3dPrepass` render phase, which doesn't exist,
causing a crash.

## Solution

- check if the prepass phases exist before queueing
- generate prepass textures if `Opaque3dDeferred` is present
- add a note to the DeferredPrepass marker to note that DepthPrepass is
also required by the default deferred lighting pass
- also changed some `With<T>.is_some()`s to `Has<T>`s
2023-11-03 01:09:14 +00:00
..
mod.rs allow DeferredPrepass to work without other prepass markers (#10223) 2023-11-03 01:09:14 +00:00
prepass_bindings.rs Bind group entries (#9694) 2023-10-21 15:39:22 +00:00
prepass_bindings.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
prepass_io.wgsl pbr shader cleanup (#10105) 2023-10-13 19:12:40 +00:00
prepass_utils.wgsl StandardMaterial Light Transmission (#8015) 2023-10-31 20:59:02 +00:00
prepass.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00