Experimental shader feature: Expose shader's float uniforms to the UI

If the loaded shader has uniforms, they will be exposed to the UI, so the users will be able to modify the shader parameters easily. Currently only works with float uniforms.
This commit is contained in:
OverloadedOrama 2020-07-28 04:11:06 +03:00
parent 86ee5d1abf
commit ec81950139
3 changed files with 86 additions and 22 deletions

View file

@ -226,6 +226,5 @@ func load_shader() -> void:
shader.code = file_data
var shader_effect_dialog = Global.control.get_node("Dialogs/ImageEffects/ShaderEffect")
shader_effect_dialog.preview.material.shader = shader
shader_effect_dialog.shader_loaded_label.text = tr("Shader loaded:") + " " + file_name.get_basename()
shader_effect_dialog.change_shader(shader, file_name.get_basename())