Skip to content

Commit

Permalink
Merge pull request godotengine#101051 from aaronfranke/gltf-always-re…
Browse files Browse the repository at this point in the history
…ad-alpha-cutoff

GLTF: Always read `alphaCutoff` property
  • Loading branch information
akien-mga committed Jan 3, 2025
2 parents c3c0c24 + ec7d7ab commit bdf625b
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 bdf625b

Please sign in to comment.