From 30ef8aeb1fdf7f3686442d758ee77874aa29d53e Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 7 Jan 2025 23:19:31 +0100 Subject: gltf point lights --- world/src/main.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'world/src/main.rs') 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(( -- cgit v1.2.3-70-g09d2