-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Point/Spot light docs #6813
Point/Spot light docs #6813
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -41,9 +41,15 @@ use crate::{ | |||||
#[derive(Component, Debug, Clone, Copy, Reflect)] | ||||||
#[reflect(Component, Default)] | ||||||
pub struct PointLight { | ||||||
/// Color of the light emitted. | ||||||
pub color: Color, | ||||||
/// Amount/strength of light emitted, in lumens. | ||||||
pub intensity: f32, | ||||||
/// How far light extends from the surface (TODO: or center?) of the point light. | ||||||
pub range: f32, | ||||||
/// The size (radius) of the point light itself. | ||||||
/// | ||||||
/// A radius of 0.0 (the default) is a point with no measureable size, while a radius of 1.0 is a unit sphere, etc. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if it's the case in Bevy, but usually the size of the light source affects the sharpness of the shadows. The bigger the light source (keeping the light source at the same distance from the object), the softer the shadows get as they are further from the object. I mention the distance, because the sun is a huge sphere, but since it's so far that it works as a directional light giving mostly sharp shadows (?). Might be interesting to mention? Rendered in Blender: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are no soft shadows yet. This would be addressed by something like #3631 . When I was hacking on soft shadows using the PCSS method, I was using the light's radius for this kind of effect. |
||||||
pub radius: f32, | ||||||
pub shadows_enabled: bool, | ||||||
pub shadow_depth_bias: f32, | ||||||
|
@@ -92,9 +98,15 @@ impl Default for PointLightShadowMap { | |||||
#[derive(Component, Debug, Clone, Copy, Reflect)] | ||||||
#[reflect(Component, Default)] | ||||||
pub struct SpotLight { | ||||||
/// Color of the light emitted. | ||||||
pub color: Color, | ||||||
/// Amount/strength of light emitted, in lumens. | ||||||
pub intensity: f32, | ||||||
/// How far light extends from the surface (TODO: or center?) of the spot light. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
pub range: f32, | ||||||
/// The size (radius) of the spot light itself. | ||||||
/// | ||||||
/// A radius of 0.0 (the default) is a point with no measureable size, while a radius of 1.0 is a unit sphere, etc. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Radius 1.0 would give the cone cut from a unit sphere according to the outer angle. |
||||||
pub radius: f32, | ||||||
pub shadows_enabled: bool, | ||||||
pub shadow_depth_bias: f32, | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.