From 8cb859e873f5e1c21b7cf200113f518da3a635a1 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sun, 16 Nov 2025 21:26:12 -0500 Subject: [PATCH 1/3] Enhance model color tint application in Reify implementation --- bridge/src/lib.rs | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/bridge/src/lib.rs b/bridge/src/lib.rs index 575ea83..329377c 100644 --- a/bridge/src/lib.rs +++ b/bridge/src/lib.rs @@ -168,30 +168,19 @@ impl Reify for BridgeState { entity_type_name, id, model_source); match Model::direct(&model_path) { - Ok(model) => { - // TODO: Apply color tint to the model - // The asteroids Model element doesn't expose material manipulation yet. - // This would require: - // 1. Loading the model's materials - // 2. Multiplying base color by the tint color - // 3. Re-applying the modified materials - // For now, we just log the color for debugging. + Ok(mut model) => { + // Apply color tint to the model if not default (white) if node.color != [1.0, 1.0, 1.0, 1.0] { - eprintln!("[bridge/reify] Node {} has color tint: RGBA({:.2}, {:.2}, {:.2}, {:.2}) - NOT YET APPLIED", + use stardust_xr_asteroids::elements::model::MaterialParameter; + model = model.mat_param("color", MaterialParameter::Color(node.color.into())); + eprintln!("[bridge/reify] Node {} applying color tint: RGBA({:.2}, {:.2}, {:.2}, {:.2})", id, node.color[0], node.color[1], node.color[2], node.color[3]); } - - // TODO: Apply texture from texture_url - // Similar to color, texture application requires material manipulation. - // This would involve: - // 1. Downloading the texture if it's an HTTP URL - // 2. Loading it as a texture resource - // 3. Applying it to the model's materials + // TODO: Apply texture from texture_url (future) if !node.texture_url.is_empty() { eprintln!("[bridge/reify] Node {} has texture URL: {} - NOT YET APPLIED", id, node.texture_url); } - Some(model.build()) } Err(e) => { From d5d06379483e17ca8b3e445f996f97072ab3e562 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sun, 16 Nov 2025 21:33:12 -0500 Subject: [PATCH 2/3] Update stardust-xr-molecules source to latest commit for improved stability --- bridge/Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge/Cargo.lock b/bridge/Cargo.lock index 2b68118..cb028d8 100644 --- a/bridge/Cargo.lock +++ b/bridge/Cargo.lock @@ -2823,7 +2823,7 @@ dependencies = [ [[package]] name = "stardust-xr-molecules" version = "0.45.0" -source = "git+https://github.com/StardustXR/molecules.git?branch=dev#53cfb2eecb066faf60a1b0da0b70f84231bae2be" +source = "git+https://github.com/StardustXR/molecules.git?branch=dev#26e004af199ccccb2ff4d8662f82f4d65311d8d3" dependencies = [ "ashpd", "futures-util", From bc330e7a40301296f1e98279e0152abbefdfb833 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sun, 16 Nov 2025 21:35:04 -0500 Subject: [PATCH 3/3] Update color tint application in Reify implementation to reflect current limitations --- bridge/src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bridge/src/lib.rs b/bridge/src/lib.rs index 329377c..c294bad 100644 --- a/bridge/src/lib.rs +++ b/bridge/src/lib.rs @@ -168,12 +168,11 @@ impl Reify for BridgeState { entity_type_name, id, model_source); match Model::direct(&model_path) { - Ok(mut model) => { - // Apply color tint to the model if not default (white) + Ok(model) => { + // TODO: Color tinting is not currently supported due to missing public API in asteroids. + // When Model/MaterialParameter API is available, apply color here. if node.color != [1.0, 1.0, 1.0, 1.0] { - use stardust_xr_asteroids::elements::model::MaterialParameter; - model = model.mat_param("color", MaterialParameter::Color(node.color.into())); - eprintln!("[bridge/reify] Node {} applying color tint: RGBA({:.2}, {:.2}, {:.2}, {:.2})", + eprintln!("[bridge/reify] Node {} requested color tint RGBA({:.2}, {:.2}, {:.2}, {:.2}) -- NOT SUPPORTED YET", id, node.color[0], node.color[1], node.color[2], node.color[3]); } // TODO: Apply texture from texture_url (future)