Gen - Smoothstep function

t's icon

I was trying to observe the difference between "mix" and "smoothstep" types of interpolation. And somehow I can't understand what "smoothstep" is doing.

Max Patch
Copy patch and select New From Clipboard in Max.

Use the toggle to switch between "mix" and "smoothstep"...

pid's icon

[mix] is default linear interpolation, [smoothstep] is default no interpolation. i see the results fine with your patch. what do you see?

t's icon

this is what I see at xfade 0 and 1 for [smoothstep]. I was expecting some kind of crossfade...?

3340.Screenshot20120212at5.59.53PM.png
png
Wesley Smith's icon

smoothstep is a different beast compared to mix. mix mixes between two values where the mix value is between [0, 1]. smoothstep gives you a ramp in the range [0, 1] that is calculated from two values and an interpolation value that is between those two inputs. For example:

smoothstep(0, 2, 0.5) --> 0.16
smoothstep(0, 2, 1.5) --> 0.84
smoothstep(0, 2, 1.75) --> 0.96

smoothstep(1, 2, 0.5) --> 0
smoothstep(1, 2, 1.5) --> 0.5
smoothstep(1, 2, 1.75) --> 0.84

Max Patch
Copy patch and select New From Clipboard in Max.

If you're trying to create a hermite interpolated crossfade, you'll need to something like this:

pid's icon

thanks wesley! now i know too...