diff --git a/src/load_roblox.rs b/src/load_roblox.rs index 80698cb..efd490a 100644 --- a/src/load_roblox.rs +++ b/src/load_roblox.rs @@ -153,9 +153,6 @@ pub fn generate_indexed_models(dom:rbx_dom_weak::WeakDom) -> crate::model::Index spawn_point=model_transform.transform_point3(-glam::Vec3::Y)+glam::vec3(0.0,2.5+0.1,0.0); println!("Found MapStart{:?}",spawn_point); } - if *transparency==1.0 { - continue; - } //TODO: also detect "CylinderMesh" etc here let shape=match &object.class[..]{ diff --git a/src/main.rs b/src/main.rs index 72b8db7..3ebc278 100644 --- a/src/main.rs +++ b/src/main.rs @@ -164,11 +164,15 @@ impl GraphicsData { let mut unique_texture_models=Vec::with_capacity(indexed_models_len); for mut model in indexed_models.models.into_iter(){ //convert ModelInstance into ModelGraphicsInstance - let instances:Vec=model.instances.iter().map(|instance|{ - ModelGraphicsInstance{ - transform: glam::Mat4::from(instance.transform), - normal_transform: glam::Mat4::from(instance.transform.inverse()).transpose(), - color: instance.color, + let instances:Vec=model.instances.into_iter().filter_map(|instance|{ + if instance.color.w==0.0{ + None + }else{ + Some(ModelGraphicsInstance{ + transform: glam::Mat4::from(instance.transform), + normal_transform: glam::Mat4::from(instance.transform.inverse()).transpose(), + color: instance.color, + }) } }).collect(); //check each group, if it's using a new texture then make a new clone of the model