check transparency when generating models
This commit is contained in:
parent
de0eb0790a
commit
bb8c53aee2
@ -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[..]{
|
||||
|
14
src/main.rs
14
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<ModelGraphicsInstance>=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<ModelGraphicsInstance>=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
|
||||
|
Loading…
Reference in New Issue
Block a user