#How to add noise to lerp

1 messages · Page 1 of 1 (latest)

kind briar
#

Hi, I wanted to add a bit of noise to the edge on a Lerp node (image included). How would I go about doing that in Shader Graph? Thanks

cunning sapphire
#

you need to modulate the input to the Lerp node

#

You'll want to make sure the input doesn't leave the 0..1 range

#

to do that, you can use the original input value to decide what range the noise is allowed to have

#

it'd be like this in HLSL:

float lower_bound = lerp(0, -0.3, lerp_input);
float upper_bound = lerp(0.3, 0, lerp_input);
lerp_input += lerp(lower_bound, upper_bound, noise);
#

when the input is at 0, your noise must be positive

#

when the input is at 1, your noise must be negative

#

and in-between, both positive and negative values are acceptable

#

If your noise isn't in the 0..1 range, remap it first

#

For the actual noise, I'm pretty sure there's a "gradient noise" node that'll do what you want

#

Note that this will need a 2D input to calculate the noise value