Is there a way we can expose the coloramp on a shader group??
i know we could it with a mix color but this way we get out only 2 colors. if we have more?
thank you in advance
Is there a way we can expose the coloramp on a shader group??
i know we could it with a mix color but this way we get out only 2 colors. if we have more?
thank you in advance
There is a way, by remote controlling the color with drivers. Drivers allow you to pick a value somewhere in Blender and make an other value somewhere else be the same.
You create a new input to your group and set it to “color”. You now have a color input to the group, but there is nowhere to plug it, so it does nothing for now.
Then, you click on the color as if you were trying to pick a color, right click on the red channel, choose “copy as new driver”. Then, go inside the group and find the color ramp. go into the same color picking menu on the ramp’s color, right click on the red channel and choose “paste driver”. If you did it correctly, the number will change color (it will be purple with default settings) and you won’t be able to change it manually anymore.
Now, the red channel of that color will always be the same as the red channel of the group input despite the fact that you can’t connect it with a wire. Do the same for the green and blue channels (sadly, it can’t be done for the entire color at once).
It’s also possible to control the position of each color on the ramp with this method, though that’s less practical, as you won’t see what you are doing remote controlling each pin from the outside with a number setting.
wow you are the best thanks so much ![]()
![]()
He really is., @etn249 is a rockstar in the support category and we are very lucky to have them in our community.
I don’t think there’s any really “efficient” way to expose color ramps (and a lot of other stuff in the shader node editor - see how limited is the image texture node at the moment - only the texture coordinates is exposed - )
You can set up a driver system such as the one suggested.. but it’s not worth the effort, in my opinion, since drivers link specific datablocks and they don’t allow a true procedural workflow.
If you need, for instance, to create a second - different - material with a color ramp and use drivers.. you can’t simply copy the one you created, you have to redo/relink everything from scratch.. so it’s not something you can simply “reuse” as you like.. and for me it’s not worth the effort. That’s why I usually use several color mix nodes controlled by different map range nodes to “fake” a color ramp node. It’s quite complicated and not efficient as I would like, but at least it’s really procedural.
yes this method takes time, at least it works. but i wonder why there is not an easier way? i have seen it exposed in some native blender stuff or maybe some addons if i remember correctly
There are various reasons I suppose: while Geo Nodes are new - and so introducing new features is “easier” - the Shader Node module is very old and has too many dependencies (and two different renders to keep - somehow - at the same “pace” - ).
Changing a module that is so old (preserving most of the compatibility) requires a lot of time and work..
Anyway.. I hope to see it become a bit more procedural in the near future .. and that more and more stuff will be exposed like in the Geo Nodes.. to allow that procedural workflow that is changing Blender forever (in a good way).
AFAIK, I do remember a PR for closures mentioning that they could be used to expose color ramps/ curves, probably something left unimplemented.
EDIT: this is the PR https://projects.blender.org/blender/blender/pulls/141264