summaryrefslogtreecommitdiff
path: root/world/src/main.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-07 23:19:31 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-07 23:19:31 +0100
commit30ef8aeb1fdf7f3686442d758ee77874aa29d53e (patch)
tree32ba50fc1a547a6889ee82e430c26be696524ddb /world/src/main.rs
parenta617f060f80d6f2b544b7cfda59da2ce5ce758f8 (diff)
downloadweareserver-30ef8aeb1fdf7f3686442d758ee77874aa29d53e.tar
weareserver-30ef8aeb1fdf7f3686442d758ee77874aa29d53e.tar.bz2
weareserver-30ef8aeb1fdf7f3686442d758ee77874aa29d53e.tar.zst
gltf point lights
Diffstat (limited to 'world/src/main.rs')
-rw-r--r--world/src/main.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/world/src/main.rs b/world/src/main.rs
index c0b6833..546b73b 100644
--- a/world/src/main.rs
+++ b/world/src/main.rs
@@ -70,6 +70,17 @@ fn main() -> Result<()> {
if let Some(mesh) = node.mesh() {
import_mesh(mesh, &buffers, &store, path_base, &node, &mut prefab)?;
}
+ let (position, _, _) = node.transform().decomposed();
+ if let Some(light) = node.light() {
+ let emission = Some(Vec3A::from_array(light.color()) * light.intensity());
+ prefab.light.push((
+ Vec3A::from_array(position),
+ store.set(&LightPart {
+ emission,
+ ..Default::default()
+ })?,
+ ));
+ }
}
prefab.light.push((