Gen - Smoothstep function


    Feb 12 2012 | 3:36 pm
    I was trying to observe the difference between "mix" and "smoothstep" types of interpolation. And somehow I can't understand what "smoothstep" is doing.
    Use the toggle to switch between "mix" and "smoothstep"...

    • Feb 12 2012 | 3:53 pm
      [mix] is default linear interpolation, [smoothstep] is default no interpolation. i see the results fine with your patch. what do you see?
    • Feb 12 2012 | 5:02 pm
      this is what I see at xfade 0 and 1 for [smoothstep]. I was expecting some kind of crossfade...?
    • Feb 12 2012 | 6:08 pm
      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
      If you're trying to create a hermite interpolated crossfade, you'll need to something like this:
    • Feb 12 2012 | 8:53 pm
      thanks wesley! now i know too...