diff options
Diffstat (limited to 'engine/src/lighting.rs')
-rw-r--r-- | engine/src/lighting.rs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/engine/src/lighting.rs b/engine/src/lighting.rs index e0608ef..6944ee5 100644 --- a/engine/src/lighting.rs +++ b/engine/src/lighting.rs @@ -1,6 +1,7 @@ -use ecs::Component; +use ecs::{Component, Sole}; use crate::color::Color; +use crate::util::builder; #[derive(Debug, Clone, Component)] pub struct LightSource @@ -21,3 +22,22 @@ impl Default for LightSource } } } + +builder! { +/// Global light properties. +#[builder(name = GlobalLightBuilder, derives = (Debug, Clone, Default))] +#[derive(Debug, Clone, Default, Sole)] +#[non_exhaustive] +pub struct GlobalLight +{ + pub ambient_offset: Color<f32>, +} +} + +impl GlobalLight +{ + pub fn builder() -> GlobalLightBuilder + { + GlobalLightBuilder::default() + } +} |