You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Objective
Another step in the migration to required components: lights!
Note that this does not include `EnvironmentMapLight` or reflection
probes yet, because their API hasn't been fully chosen yet.
## Solution
As per the [selected
proposals](https://hackmd.io/@bevy/required_components/%2FLLnzwz9XTxiD7i2jiUXkJg):
- Deprecate `PointLightBundle` in favor of the `PointLight` component
- Deprecate `SpotLightBundle` in favor of the `PointLight` component
- Deprecate `DirectionalLightBundle` in favor of the `DirectionalLight`
component
## Testing
I ran some examples with lights.
---
## Migration Guide
`PointLightBundle`, `SpotLightBundle`, and `DirectionalLightBundle` have
been deprecated. Use the `PointLight`, `SpotLight`, and
`DirectionalLight` components instead. Adding them will now insert the
other components required by them automatically.
Copy file name to clipboardExpand all lines: crates/bevy_pbr/src/light/directional_light.rs
+13-2Lines changed: 13 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
use bevy_render::{view::Visibility, world_sync::SyncToRenderWorld};
2
+
1
3
usesuper::*;
2
4
3
5
/// A Directional light.
@@ -36,8 +38,8 @@ use super::*;
36
38
///
37
39
/// Shadows are produced via [cascaded shadow maps](https://developer.download.nvidia.com/SDK/10.5/opengl/src/cascaded_shadow_maps/doc/cascaded_shadow_maps.pdf).
38
40
///
39
-
/// To modify the cascade set up, such as the number of cascades or the maximum shadow distance,
40
-
/// change the [`CascadeShadowConfig`] component of the [`DirectionalLightBundle`].
41
+
/// To modify the cascade setup, such as the number of cascades or the maximum shadow distance,
42
+
/// change the [`CascadeShadowConfig`] component of the entity with the [`DirectionalLight`].
41
43
///
42
44
/// To control the resolution of the shadow maps, use the [`DirectionalLightShadowMap`] resource:
0 commit comments