godot
godot copied to clipboard
[Shaders] Allow constants and expressions in `hint_range`
Allows expressions in hint_range declaration:
shader_type spatial;
const float begin = 0.5;
const float end = 4.0;
const float st = 0.1;
uniform float test : hint_range(begin, end);
uniform float test2 : hint_range(0.25 + 0.25, TAU + 1.0, st);
- Fix https://github.com/godotengine/godot/issues/101926
big fan of this
Thanks!
The hints instance_index and hint_enum also accept parameters. Should we assume they may eventually allow expressions or at least named constants as well?
I guess not with hint_enum, since only strings are allowed, and we can't set those in constants (except for macros).
But what about instance_index?