Godot Version
4.2.1
Question
Hello, I have a couple of shader uniforms:
uniform float distortion : hint_range(0.0, 1.0) = 0.1;
uniform float distortion_speed : hint_range(0.0, 32.0) = 1.0;
And then I have sliders that control these:
func _on_distortion_slider_value_changed(value):
(self.material as ShaderMaterial).set_shader_parameter("distortion", value)
func _on_distortion_speed_slider_value_changed(value):
(self.material as ShaderMaterial).set_shader_parameter("distortion_speed", value)
However, in order to create those Sliders in the UI, I manually matched the hint_range
s to minimum, maximum and default values.
Is it please possible to do all of this automatically and read hint_range
s when creating the UI Sliders (and, for example, set the minimum and maximum values in their _ready
functions?
Thank you.