summaryrefslogtreecommitdiff
path: root/world
diff options
context:
space:
mode:
Diffstat (limited to 'world')
-rw-r--r--world/Cargo.toml6
-rw-r--r--world/src/main.rs11
2 files changed, 16 insertions, 1 deletions
diff --git a/world/Cargo.toml b/world/Cargo.toml
index 540b54b..93d1133 100644
--- a/world/Cargo.toml
+++ b/world/Cargo.toml
@@ -7,7 +7,11 @@ edition = "2024"
anyhow = "1.0.95"
clap = { version = "4.5.23", features = ["derive"] }
env_logger = "0.11.6"
-gltf = { version = "1.4.1", features = ["extras", "names"] }
+gltf = { version = "1.4.1", features = [
+ "extras",
+ "names",
+ "KHR_lights_punctual",
+] }
log = "0.4.22"
weareshared = { path = "../shared" }
rand = "0.9.0-beta.1"
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((