The Map Range operation is basically a shortcut to a number of mathematical atomic operations.
You can emulate its behaviour by using regular Attribute Math Nodes.
Using the formula from the first link I suggested, I laid out the algorithm :
output = output_start + ((output_end - output_start) / (input_end - input_start)) * (input - input_start)
<=>
output = To Min + (To Max - To Min) / (From Max - From Min) * (input - From Min)
We then just need to do the operations linearly.
Let's create a node group in order to reuse it wherever we want.
First operation, calculate input - From Min
Then, From Max - From Min
To Max - To Min
(To Max - To Min) / (From Max - From Min)
(To Max - To Min) / (From Max - From Min) * (input - From Min)
Finally, (To Max - To Min) / (From Max - From Min) * (input - From Min) + To Min
:
for the sake of tidiness, remove the unneeded attributes, and output the geometry.
Here's a simple setup to generate a bunch of attributes to test out our node group.
Plug everything up, and use a control regular Map Range node to test it.
Use the new Spreadsheet Editor to analyse the data.
It's the same, yay !
Caveats, possible improvements :
- This group only accepts attributes. You could theoretically tweak it to accept floats with a Switch node (Blender 3.00 +), but the sheer number of possible configurations would make the node group very big and convoluted.
- This is a linear interpolation, meaning you would need to change the algorithm to add a damping coefficient if you want a smoother interpolation.
- Add an Attribute Clamp node at the end if you want the possibility to clamp output
Grab the file to test out the node group :
and here the attribute clamp node: