summaryrefslogtreecommitdiff
path: root/engine/src/lighting.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-05-12 19:02:35 +0200
committerHampusM <hampus@hampusmat.com>2024-05-12 19:38:01 +0200
commitf82ceb5587954802352e00ffacd229559a2ca4df (patch)
treeb23d62d86108274fe4c1fc704e00c35ce3983ae8 /engine/src/lighting.rs
parentbf5cf271702b1ed00cf3475c29011cb1b5de7345 (diff)
feat(engine): add global material ambient color offsetting
Diffstat (limited to 'engine/src/lighting.rs')
-rw-r--r--engine/src/lighting.rs22
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()
+ }
+}