RodZill4 / material-maker

A procedural textures authoring and 3D model painting tool based on the Godot game engine
MIT License
3.54k stars 222 forks source link

Uniform parameter node #476

Open novalis opened 2 years ago

novalis commented 2 years ago

Feature/enhancement description:

I want to have a shader with parameters that I can control from code. In Godot, I can do this by calling set_shader_param to set the value of any uniforms. But I can't easily create such a uniform from Material Maker. When I tried adding uniform float foo = 1.0; in the Instance Functions section of a greyscale node, it somehow got translated to const float foo = 1.0; in the shader output. And, while maybe I could add uniform float foo = 1.0; to my Material's preview and export tabs, that wouldn't help me when previewing only this node (and its dependents).

Of course, I could manually hack the shader after exporting it, but for obvious reasons, I would prefer to avoid that.

RodZill4 commented 2 years ago

I already have a prototype for that, but didn't include it yet. It basically turns named parameters (in top level Remote node) into uniforms. This needs a bit more work but if you need it now, please don't hesitate to contact me on discord. But yeah, it's planned. ;)

poiati commented 1 year ago

That would be great! Are we still planing to do that?