Fix global shader texture uniform

This commit is contained in:
LuoZhihao 2025-06-13 13:24:38 +08:00
parent 03bd8ba9c2
commit 7419e4429d
2 changed files with 16 additions and 8 deletions

View file

@ -872,10 +872,14 @@ void MaterialData::update_textures(const HashMap<StringName, Variant> &p_paramet
E->value = global_textures_pass;
}
if (v->override.get_type() == Variant::RID && ((RID)v->override).is_valid()) {
textures.push_back(v->override);
} else if (v->value.get_type() == Variant::RID && ((RID)v->value).is_valid()) {
textures.push_back(v->value);
RID override_rid = v->override;
if (override_rid.is_valid()) {
textures.push_back(override_rid);
} else {
RID value_rid = v->value;
if (value_rid.is_valid()) {
textures.push_back(value_rid);
}
}
}