use crate::utils::GltfData;
use image::GrayImage;
use std::sync::Arc;
#[derive(Clone, Debug)]
pub struct Occlusion {
pub texture: Arc<GrayImage>,
pub factor: f32,
}
impl Occlusion {
pub(crate) fn load(gltf_mat: &gltf::Material, data: &mut GltfData) -> Option<Self> {
gltf_mat.occlusion_texture().map(|texture| Self {
texture: data.load_gray_image(&texture.texture(), 0),
factor: texture.strength(),
})
}
}