Skip to content

Commit

Permalink
GLTF: Always read alphaCutoff property
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronfranke committed Jan 2, 2025
1 parent 2582793 commit ec7d7ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/gltf/gltf_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4822,13 +4822,13 @@ Error GLTFDocument::_parse_materials(Ref<GLTFState> p_state) {
material->set_transparency(BaseMaterial3D::TRANSPARENCY_ALPHA_DEPTH_PRE_PASS);
} else if (am == "MASK") {
material->set_transparency(BaseMaterial3D::TRANSPARENCY_ALPHA_SCISSOR);
if (material_dict.has("alphaCutoff")) {
material->set_alpha_scissor_threshold(material_dict["alphaCutoff"]);
} else {
material->set_alpha_scissor_threshold(0.5f);
}
}
}
if (material_dict.has("alphaCutoff")) {
material->set_alpha_scissor_threshold(material_dict["alphaCutoff"]);
} else {
material->set_alpha_scissor_threshold(0.5f);
}

if (material_dict.has("extras")) {
_attach_extras_to_meta(material_dict["extras"], material);
Expand Down

0 comments on commit ec7d7ab

Please sign in to comment.