Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/bevy_light/src/directional_light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ pub fn update_directional_light_frusta(
/// By default, the atmosphere is rendered with [`SunDisk::EARTH`], which approximates the
/// apparent size and brightness of the Sun as seen from Earth. You can also disable the sun
/// disk entirely with [`SunDisk::OFF`].
///
/// In order to cause the sun to "glow" and light up the surrounding sky, enable bloom
/// in your post-processing pipeline by adding a `Bloom` component to your camera.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't make this a doc-link because there's no dependency between bevy_light and bevy_post_process.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what we sometimes do is link the website docs instead in this case

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, which I don't hate, but IMO this is easy to search for end users.

#[derive(Component, Clone)]
#[require(DirectionalLight)]
pub struct SunDisk {
Expand Down
22 changes: 22 additions & 0 deletions release-content/release-notes/sun_disk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Procedural Sun Disk
authors: ["@defuz"]
pull_requests: [20434]
---

TODO: grab images from 20434 PR description.

Any good [procedural atmosphere] deserves a procedural sun to light it.
To enable this, add the [`SunDisk`] component to your [`DirectionalLight`] entity.
The sun will move with your light, playing nicely with any positioning or movement logic you've implemented.

You can set both the `angular_size` and `intensity` of the sun disk, changing the size and brightness of the sun.
We've included a convenient `SunDisk::EARTH` constant, to spare you the tricky experimental trigonometry.

If you've ever stared directly at the sun in real life (not recommended), you'll also be familiar with a spreading glow
that bleeds out into the nearby sky.
This is an effect known as "bloom", which is enabled by adding the [`Bloom`] component to your camera entity.

[procedural atmosphere]: https://bevy.org/news/bevy-0-16/#procedural-atmospheric-scattering
[`SunDisk`]: https://docs.rs/bevy/0.17.0-rc.1/bevy/light/struct.SunDisk.html
[`Bloom`]: https://docs.rs/bevy/0.17.0-rc.1/bevy/post_process/bloom/struct.Bloom.html
Loading