Four simple nodes that allow you to map (or reverse) values and vectors/colors. The two main "functions" are "Map value" and "Map color" (i.e. vector or "triplet values") and those exist in two versions: node groups and OSL scripts.
This can be usefull when you want to map the location from the object/particle info node etc. You can see an example of with and without mapping of location values in the preview images.
In the file there's a usage example with a particle system and a node tree where each of the nodes are represented.Usage tips:
<ol><li>If you're mapping locations make the Min & Max of the input the range in Blender Units(/meters) match the locations of the objects/particles (if your objects can be find from -42 to 42 BU on an axis, enter that as your Input Min & Max).</li>
<li>If there's a big difference on the range where the objects are from one axis to another, you might want to use a Seperate RGB on the Location, run each value (RGB = XYZ) through it's own Map Value node and then use Combine RGB (this also allows you to swap axis etc). You could also use a HSV-convert instead!</li>
<li>The uses are not limited to locations (but that's what I wanted it primary for!)</li>
</ol>The OSL scripts are included in the .blend but can also be downloaded as seperate files here (since BlendSwap didn't allow the .OSL-files in the .ZIP).
Side note: There's a built-in node like this in the compositor, but sadly not one for Cycles (hopefully that will be added in the future [for better performance]). All "mapping" nodes in Cycles (like Vector > Mapping) wont map the values like this, instead it clips the values.
There are no comments yet, log in to add one and start a discussion. Make someone feel good today!