From 45f2ef4c0fdcad45093be02e5463bd8ac7a03776 Mon Sep 17 00:00:00 2001 From: bitsawer Date: Wed, 11 Oct 2023 13:51:52 +0300 Subject: [PATCH] Fix BaseMaterial3D update with certain material settings --- scene/resources/material.cpp | 2 ++ scene/resources/material.h | 1 + 2 files changed, 3 insertions(+) diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 39b3acfe3fac..461dbbec2fad 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -3079,6 +3079,8 @@ BaseMaterial3D::BaseMaterial3D(bool p_orm) : flags[FLAG_ALBEDO_TEXTURE_MSDF] = false; flags[FLAG_USE_TEXTURE_REPEAT] = true; + current_key.invalid_key = 1; + _mark_initialized(callable_mp(this, &BaseMaterial3D::_queue_shader_change)); } diff --git a/scene/resources/material.h b/scene/resources/material.h index 8cd583c709e3..a631f7759882 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -325,6 +325,7 @@ class BaseMaterial3D : public Material { uint64_t emission_op : get_num_bits(EMISSION_OP_MAX - 1); uint64_t distance_fade : get_num_bits(DISTANCE_FADE_MAX - 1); // booleans + uint64_t invalid_key : 1; uint64_t deep_parallax : 1; uint64_t grow : 1; uint64_t proximity_fade : 1;