Dont reload textures if some already exist
This commit is contained in:
parent
92e1f1d0ec
commit
4a4ae65cc1
|
@ -545,9 +545,11 @@ impl Model {
|
|||
/// Builds the SrgbTextures for rendering.
|
||||
pub fn build_texture_for_material(&mut self, material: &Material, renderer: &Renderer) {
|
||||
if let Some((path, _)) = material.textures.get("map_Kd") {
|
||||
if ! self.textures.contains_key(path) {
|
||||
let texture = renderer.make_texture(path);
|
||||
// Don't need to insert multiple times the same texture
|
||||
self.textures.entry(path.to_owned()).or_insert(Rc::new(texture));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue