Repository: bevyengine/bevy
File: crates/bevy_light/src/directional_light.rs (Rust)

Code before:
                )
            })
            .collect();
    }
}

/// This component marks a [`DirectionalLight`] entity for changing the size and intensity of the sun disk.
///
/// 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`].
#[derive(Component, Clone)]
#[require(DirectionalLight)]
pub struct SunDisk {
    /// The angular size (diameter) of the sun disk in radians as observed from Earth.
    pub angular_size: f32,
    /// Multiplier applied to the brightness of the sun disk in the sky.
    ///
    /// `0.0` disables the sun disk entirely while still
    /// allowing the sun's radiance to scatter into the atmosphere,
    /// and `1.0` renders the sun disk at its normal intensity.
    pub intensity: f32,
}

impl SunDisk {
    /// Parameters of the Sun disk as viewed from Earth.
    ///
    /// Use this constant to render a sun disk with its typical apparent size (about 32 arcminutes)
    /// and default intensity.
    pub const EARTH: SunDisk = SunDisk {
        // 32 arc minutes is the mean size of the sun disk when the Earth is
        // exactly 1 astronomical unit from the sun.
        angular_size: 0.00930842,
        intensity: 1.0,
    };

    /// Disable sun disk rendering: zero angular size and zero intensity.
    ///
    /// This keeps atmospheric scattering and lighting from the directional light,
    /// but hides sun disk in atmosphere rendering.
    pub const OFF: SunDisk = SunDisk {
        angular_size: 0.0,
        intensity: 0.0,
    };
}

impl Default for SunDisk {
    fn default() -> Self {
        Self::EARTH
    }
}

Review comment (suggestion):
```suggestion
    /// Parameters of the sun disk as viewed from Earth.
```

Code after:
                )
            })
            .collect();
    }
}

/// Add to a [`DirectionalLight`] to control rendering of the visible solar disk in the sky.
/// Affects only the disk’s appearance, not the light’s illuminance or shadows.
/// Requires a `bevy::pbr::Atmosphere` component on a [`Camera3d`](bevy_camera::Camera3d) to have any effect.
///
/// 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`].
#[derive(Component, Clone)]
#[require(DirectionalLight)]
pub struct SunDisk {
    /// The angular size (diameter) of the sun disk in radians, as observed from the scene.
    pub angular_size: f32,
    /// Multiplier for the brightness of the sun disk.
    ///
    /// `0.0` disables the disk entirely (atmospheric scattering still occurs),
    /// `1.0` is the default physical intensity, and values `>1.0` overexpose it.
    pub intensity: f32,
}

impl SunDisk {
    /// Earth-like parameters for the sun disk.
    ///
    /// Uses the mean apparent size (~32 arcminutes) of the Sun at 1 AU distance
    /// with default intensity.
    pub const EARTH: SunDisk = SunDisk {
        angular_size: 0.00930842,
        intensity: 1.0,
    };

    /// No visible sun disk.
    ///
    /// Keeps scattering and directional light illumination, but hides the disk itself.
    pub const OFF: SunDisk = SunDisk {
        angular_size: 0.0,
        intensity: 0.0,
    };
}

impl Default for SunDisk {
    fn default() -> Self {
        Self::EARTH
    }
}

impl Default for &SunDisk {