Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLTF: Always read alphaCutoff property #101051

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
GLTF: Always read alphaCutoff property
aaronfranke committed Jan 2, 2025

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
commit ec7d7abde93f2bc552e52b687ad00a61970fc0de
10 changes: 5 additions & 5 deletions modules/gltf/gltf_document.cpp
Original file line number Diff line number Diff line change
@@ -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);