enter image description here

I want to control the "pos" value of the color ramp (here the 0.5) by a driver. This would be easy, but... the driver should be controlled by a value from the same shader nodes tree.

Is this possible? Or some clever workaround?

so e.g. i want to change the pos value by the y value here:

enter image description here

This is just an example - i need the driver. ;)

  • $\begingroup$ Does this answer your question? 'color' and 'position' input for Color Ramp node? Here I explained how you can either use drivers or - in your case probably better - simulate the Color Ramp with a Map Range node to mix colors. You can plug the Y value into the From Max input. But look at the other answer there, too. There is a more complex setup for building a color ramp with more sliders. $\endgroup$ Commented Feb 10, 2023 at 7:30
  • $\begingroup$ Ah sorry, my fault - your color ramp is set to constant. In this case you can use a simple Mix Color shader and for the mix factor you plug the Y value into a Math node set to Greater Than with the slider position as Threshold. But when you say this is just an example it may be important what exactly you need the driver for - different ways to use it might need different kinds of solutions. The more I think about it the less I understand how this actually should work - let's say the Y value varies along the geometry, then you want the slider position to vary as well? $\endgroup$ Commented Feb 10, 2023 at 7:47
  • $\begingroup$ for two values your solution proposal would be no problem, but if you have several stops and you want to control them, it would be soon become a pretty messy shader nodes setup with lots of mix nodes. I hoped i could output and input a value via shader nodes (or somehow else). That's why i wanted to use a driver driven by a shader value. $\endgroup$
    – Chris
    Commented Feb 10, 2023 at 8:44
  • $\begingroup$ ...that's why I said the solution might depend on what you actually want and not only the example. Also when you say several - for example, if several means 3 or 4 I would say, maybe a bit messy but better than nothing if you don't have any other solution. If we talk about 10 to 20 stops... well, that's gonna be really messy ;) $\endgroup$ Commented Feb 10, 2023 at 9:06
  • $\begingroup$ that's why i wrote: it's just an example, i need the driver ;) $\endgroup$
    – Chris
    Commented Feb 10, 2023 at 9:17


You must log in to answer this question.

Browse other questions tagged .