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

Fix BaseMaterial3D update with certain material settings #83145

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

bitsawer
Copy link
Member

Certain BaseMaterial3D settings result in a material key that is all zeros while still being a valid material. This causes the material update to be skipped when the material is created and a default material will be used instead.

This PR adds invalid_key member to the material key (BaseMaterial3D::MaterialKey) which can be used to mark the material invalid and force an update. This same idiom is already used in ParticleProcessMaterial and CanvasItemMaterial.

@bitsawer bitsawer added this to the 4.2 milestone Oct 11, 2023
@bitsawer bitsawer requested a review from a team October 11, 2023 11:47
@akien-mga akien-mga merged commit 05d6183 into godotengine:master Oct 11, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StandardMaterial3D with certain property values is not applied on MeshInstance3D upon reopening scene
3 participants