forked from StrafesNET/strafe-client
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);
|
spawn_point=model_transform.transform_point3(-glam::Vec3::Y)+glam::vec3(0.0,2.5+0.1,0.0);
|
||||||
println!("Found MapStart{:?}",spawn_point);
|
println!("Found MapStart{:?}",spawn_point);
|
||||||
}
|
}
|
||||||
if *transparency==1.0 {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: also detect "CylinderMesh" etc here
|
//TODO: also detect "CylinderMesh" etc here
|
||||||
let shape=match &object.class[..]{
|
let shape=match &object.class[..]{
|
||||||
|
@ -164,11 +164,15 @@ impl GraphicsData {
|
|||||||
let mut unique_texture_models=Vec::with_capacity(indexed_models_len);
|
let mut unique_texture_models=Vec::with_capacity(indexed_models_len);
|
||||||
for mut model in indexed_models.models.into_iter(){
|
for mut model in indexed_models.models.into_iter(){
|
||||||
//convert ModelInstance into ModelGraphicsInstance
|
//convert ModelInstance into ModelGraphicsInstance
|
||||||
let instances:Vec<ModelGraphicsInstance>=model.instances.iter().map(|instance|{
|
let instances:Vec<ModelGraphicsInstance>=model.instances.into_iter().filter_map(|instance|{
|
||||||
ModelGraphicsInstance{
|
if instance.color.w==0.0{
|
||||||
|
None
|
||||||
|
}else{
|
||||||
|
Some(ModelGraphicsInstance{
|
||||||
transform: glam::Mat4::from(instance.transform),
|
transform: glam::Mat4::from(instance.transform),
|
||||||
normal_transform: glam::Mat4::from(instance.transform.inverse()).transpose(),
|
normal_transform: glam::Mat4::from(instance.transform.inverse()).transpose(),
|
||||||
color: instance.color,
|
color: instance.color,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}).collect();
|
}).collect();
|
||||||
//check each group, if it's using a new texture then make a new clone of the model
|
//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