Implementing a Color Picker for ShaderMaterial Properties

Godot Version

4.2.stable

Question

I’m looking to enhance the user experience of my shader materials by integrating a color picker directly into the shader properties panel. This feature would allow for more intuitive and immediate adjustments of color values within custom shaders, directly from the Godot Editor.

Has anyone managed to add a color picker to the shader properties of a ShaderMaterial in GDShader? I’m particularly interested in solutions or approaches that are compatible with GDScript 2.0, considering the significant updates in Godot 4.2.

Key Points:

  • How to implement a color picker in the shader properties panel for ShaderMaterial.
  • Any existing plugins or custom scripts that facilitate this functionality.

I’m looking for any guidance, code snippets, or references to documentation that could help me achieve this.

What I’ve Tried: So far, I’ve explored customizing EditorProperty classes and delving into the new EditorInspectorPlugin , but I’m uncertain how to bind these with shader properties effectively.

You mean like this?

uniform vec4 color : source_color = vec4(1.0);

It’s right from the docs: Shading language — Godot Engine (stable) documentation in English

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.