File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,9 @@ Material to_material(gltf::Material const& material) {
58
58
ret->roughness = material.pbr .roughness_factor ;
59
59
ret->alpha_mode = material.alpha_mode ;
60
60
ret->alpha_cutoff = material.alpha_cutoff ;
61
- ret->base_colour = material.pbr .base_colour_texture ->texture ;
62
- ret->roughness_metallic = material.pbr .metallic_roughness_texture ->texture ;
63
- ret->emissive = material.emissive_texture ->texture ;
61
+ if (material. pbr . base_colour_texture ) { ret->base_colour = material.pbr .base_colour_texture ->texture ; }
62
+ if (material. pbr . metallic_roughness_texture ) { ret->roughness_metallic = material.pbr .metallic_roughness_texture ->texture ; }
63
+ if (material. emissive_texture ) { ret->emissive = material.emissive_texture ->texture ; }
64
64
ret->emissive_factor = material.emissive_factor ;
65
65
return {std::move (ret)};
66
66
}
You can’t perform that action at this time.
0 commit comments