godot-blender-exporter icon indicating copy to clipboard operation
godot-blender-exporter copied to clipboard

Feature request: Allow the user to edit the material in Godot

Open Raj2032 opened this issue 5 years ago • 4 comments

I wish that the user can edit the material within Godot. This can be useful if the user wanted to change a material's color during game play via script.

Raj2032 avatar Feb 28 '19 09:02 Raj2032

Pretty interesting point, Spatial Material may be the best option to do this functionality, however, I still haven't come out a compact way to export Blender material to Spatial Material.

If you want to do it with the current shader script, it is possible but it may need to have some understanding of the shader script and add uniform variable somewhere in the script. Uniform variable can be changed via gdscript

Besides, current I am working in progress supporting VisualShader coming in Godot 3.1, once it is done, it could be easier to add some uniform node

Jason0214 avatar Mar 12 '19 07:03 Jason0214

I wonder if converting 'value' and 'rgb' nodes into uniform values would be a sane approach?

sdfgeoff avatar Mar 14 '19 16:03 sdfgeoff

@sdfgeoff I think most people don't use value node and rgb node, more likely they would set the value on socket. But you just inspired me, it would a good idea to make non-zero socket to be uniform (or at least given an option to do that). It would be easy to implement after my recent refactoring

Jason0214 avatar Mar 14 '19 20:03 Jason0214

The problem I see with that is that there's no nice way to name them, and in most cases, the majority of sockets will be unconnected resulting in many many unused uniforms.

Even though most shaders currently don't use value nodes, I think it would be better to use them and then document that - and then you can draw the uniform name from the node name

sdfgeoff avatar Mar 15 '19 07:03 sdfgeoff