Search code examples
shadergodot4

In Godot shader how to use `hint` with a default value?


In this documentation: https://docs.godotengine.org/en/stable/tutorials/shaders/shader_reference/shading_language.html#uniforms I see several examples of how to use hint but I don't know how to set a default value when I use a hint

I have tried:

uniform float mask_scale = 1.0 : hint_range(0.1, 10.0);

But I got error:

Expected expression, found 'HINT_RANGE'


Solution

  • uniform float mask_scale : hint_range(0.1, 10.0) = 1.0;