Gradient Parameter

Hello, simple question:

when creating a gradient parameter in the shadergraph, the Exposed checkmark remains grayed out and the gradient does not appear in the material.

Are gradient parameters simply not functional?

Thank you.

You can’t have exposed gradients and it’s not coming anytime soon afaik

Thanks for the reply. Too bad, it could be useful.

HI. How make a gradient without gradient. Im trying lerp but lerp take only two colors

I think the easy way is to sample gradient texture. Create image in gimp/photoshop or other program - it can be even 1 pixel wide and just sample it from 0-1.

This is how I made it: the bottom saturate is the 0-1 value that I would use to sample my gradient, then I have a bunch of comparisons and branches. Meaning the output will be one of the 5 colors depending on where between 0 and 1 that initial value is.

This is done to make random tree colors, depending on their position.
5986988--643646--grad.jpg

I didn’t want to sample a gradient texture, simply because I want to be able to change the colors precisely in Unity.

1 Like

I changed the “branches” for “lerps” in the final version of the shader. Instead of logic gates comparisons, I simply remap the value to create a sharp black and white mask.