mirror of
https://codeberg.org/icewind/vbsp-to-gltf.git
synced 2026-06-03 10:14:08 +02:00
material backface culling
This commit is contained in:
parent
5f77902a90
commit
31b0ff9b10
2 changed files with 4 additions and 4 deletions
|
|
@ -73,7 +73,7 @@ pub fn push_material(buffer: &mut Vec<u8>, gltf: &mut Root, material: MaterialDa
|
|||
.alpha_test
|
||||
.map(AlphaCutoff)
|
||||
.filter(|_| alpha_mode == AlphaMode::Mask),
|
||||
double_sided: true,
|
||||
double_sided: material.no_cull,
|
||||
alpha_mode: Valid(alpha_mode),
|
||||
pbr_metallic_roughness: PbrMetallicRoughness {
|
||||
base_color_factor: PbrBaseColorFactor(
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ pub struct MaterialData {
|
|||
pub alpha_test: Option<f32>,
|
||||
pub bump_map: Option<TextureData>,
|
||||
pub translucent: bool,
|
||||
pub no_cull: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
@ -80,10 +81,8 @@ pub fn load_material(
|
|||
color: [82, 180, 217, 128],
|
||||
name: name.into(),
|
||||
path,
|
||||
texture: None,
|
||||
bump_map: None,
|
||||
alpha_test: None,
|
||||
translucent: true,
|
||||
..MaterialData::default()
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -112,6 +111,7 @@ pub fn load_material(
|
|||
bump_map,
|
||||
alpha_test,
|
||||
translucent: translucent | glass,
|
||||
no_cull: material.no_cull(),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue