1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Add color_conversion_disabled shader hint.

Sometimes shaders want to accept a color as input that is always
in the srgb color space.  This adds a hint to vec3/vec4 to enable
the color picker popup for those vectors but disable color space
conversion.
This commit is contained in:
Rob Blanckaert
2024-10-04 00:29:28 -07:00
parent 97241ffea6
commit 8c54290b4a
4 changed files with 45 additions and 11 deletions

View File

@@ -176,6 +176,7 @@ public:
TK_HINT_ROUGHNESS_GRAY,
TK_HINT_ANISOTROPY_TEXTURE,
TK_HINT_SOURCE_COLOR,
TK_HINT_COLOR_CONVERSION_DISABLED,
TK_HINT_RANGE,
TK_HINT_ENUM,
TK_HINT_INSTANCE_INDEX,
@@ -661,6 +662,7 @@ public:
HINT_RANGE,
HINT_ENUM,
HINT_SOURCE_COLOR,
HINT_COLOR_CONVERSION_DISABLED,
HINT_NORMAL,
HINT_ROUGHNESS_NORMAL,
HINT_ROUGHNESS_R,
@@ -844,6 +846,7 @@ public:
static bool is_scalar_type(DataType p_type);
static bool is_float_type(DataType p_type);
static bool is_sampler_type(DataType p_type);
static bool is_hint_color(ShaderNode::Uniform::Hint p_hint);
static Variant constant_value_to_variant(const Vector<Scalar> &p_value, DataType p_type, int p_array_size, ShaderLanguage::ShaderNode::Uniform::Hint p_hint = ShaderLanguage::ShaderNode::Uniform::HINT_NONE);
static Variant get_default_datatype_value(DataType p_type, int p_array_size, ShaderLanguage::ShaderNode::Uniform::Hint p_hint);
static PropertyInfo uniform_to_property_info(const ShaderNode::Uniform &p_uniform);