Is there a node similar to the SetRange node in Maya?

Hey!

I’ve been looking for a way to map and set ranges, with a texture as input, similar to how the SetRange node works in Maya.

So as an example, say I have a texture of a gradient, going from black (0) to white (1).
I can then specify my new black point (eg. 0.25) and new white point (eg. 0.75), and secondly I can set which values my new black and white points get. For instance I could set the new black value to 1 and the new white value to 0.
This would result in my output looking inverted, and clamped to black and white around where originally the 0.25 and 0.75 values where on my input texture.

The 3PointLevels kind of gives me the basic functionality but is (i think) a more expensive shader operation then this requires, and gives me a hard time getting a smooth gradient in between my defined new values.

Any suggestions much appreciated!

-Felix

PS: I’ve attached an image of what the setrange node properties look like. (note: its 3 channels, and in this instance the R channel is being multiplied by 50.

Create a material function, the inputs are (Value, Old_Min, Old_Max, New_Min, New_Max)
Then do this in the graph:
Output = New_Min + (((Value - Old_Min) / (Old_Max - Old_Min)) * (New_Max - New_Min))
Hope that helps.

Ha! Re-googled my question, and found it answered. Awesome!
Thank you so much! :slight_smile: