From 5495edd11c3f44436272c763f9c74ad4659424ed Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Sat, 18 May 2024 11:31:38 +0200 Subject: [PATCH] [Rendering] Improve `(u)int` shader uniform hint --- servers/rendering/shader_language.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index a2da26eb65e..c6b4e84c63b 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -4113,9 +4113,13 @@ PropertyInfo ShaderLanguage::uniform_to_property_info(const ShaderNode::Uniform pi.type = Variant::PACKED_INT32_ARRAY; } else { pi.type = Variant::INT; + pi.hint = PROPERTY_HINT_RANGE; if (p_uniform.hint == ShaderLanguage::ShaderNode::Uniform::HINT_RANGE) { - pi.hint = PROPERTY_HINT_RANGE; pi.hint_string = rtos(p_uniform.hint_range[0]) + "," + rtos(p_uniform.hint_range[1]) + "," + rtos(p_uniform.hint_range[2]); + } else if (p_uniform.type == ShaderLanguage::TYPE_UINT) { + pi.hint_string = "0," + itos(UINT32_MAX); + } else { + pi.hint_string = itos(INT32_MIN) + "," + itos(INT32_MAX); } } } break;