use case!
say you want to control audio source volume based on distance
• at 10 meters, you want volume 1
• at 20 meters, you want volume 0
then the volume is then given by
volume = InvLerp( 20, 10, distance )pic.twitter.com/NkIy47VwBg
-
-
Deze collectie tonen
-
if you've ever used photoshop's levels tool, then you've used both lerp and inverse lerp!
the input values use inverse lerp, the output values use lerp!pic.twitter.com/0ehIOXAzqS
Deze collectie tonen -
when used with images, inverse lerp can be used to increase value contrast! for example, here's a selfie before and after an inverse lerp
pic.twitter.com/TsX9N1eigx
Deze collectie tonen -
also, note that some Lerp/InvLerp functions also extrapolate (such as in shaders), while others clamp the values within your given range (such as Unity's Mathf.Lerp/InverseLerp functions) make sure you clamp unless you want to extrapolate
Deze collectie tonen -
here's an interesting use case! an inv lerp where a and b are colors and the value parameter is the depth of this water, you can achieve hue-shifting for a color elimination effect by depth
anyhow, that's all! hope you found this useful~pic.twitter.com/b5MVQvMTOmDeze collectie tonen -
I'm also going live now for a few hours, working on the level editor for Flowstorm
come hang out~http://twitch.tv/acegikmo Deze collectie tonen -
addendum - another useful function is Remap! remap takes a value within a given input range into a given output range, which is basically a combined inverse lerp and lerp! here's the code for all three! (also, none of these are clamped - they can all extrapolate)pic.twitter.com/I7tzgsctlb
Deze collectie tonen -
another thread, if you want to learn more about lerp!https://twitter.com/FreyaHolmer/status/1175925033002254338?s=19 …
0:04Deze collectie tonen
Einde van gesprek
Nieuw gesprek -
-
-
A Prel. :)
Bedankt, Twitter gebruikt dit om je tijdlijn te verbeteren. Ongedaan makenOngedaan maken
-
-
-
Neat, that's new to me. Thanks for sharing.
Bedankt, Twitter gebruikt dit om je tijdlijn te verbeteren. Ongedaan makenOngedaan maken
-
Het laden lijkt wat langer te duren.
Twitter is mogelijk overbelast of ondervindt een tijdelijke onderbreking. Probeer het opnieuw of bekijk de Twitter-status voor meer informatie.
Shapes
Shader Forge
Budget Cuts
ex-co-founder of
totally not a furry
wild shader sorceress
...math influencer?
twitch partner
blending a value, position, color and an angle!