# “Map Range” node equivalent for Material nodes?

I would like to use the age of particles to effect the color of a material, however the Particle Info node returns the age of the particles in frames so the values are greater than one. (which makes the ColorRamp node ineffective as it works in the 0-1 range.)

So I need to convert the Age value to the 0-1 range (As you would with the Map Range/Map Value node) but with Material nodes instead of Composite nodes.
Is this possible?

• dude, how did you figure out the output was in frames?? got that exact question up here blender.stackexchange.com/questions/2885/… – krivar Sep 13 '13 at 17:19
• @krivar it says so on the wiki ;) That's a good question though, you might want to consider generalizing it to be something like "is it possible to view values outputted by node as numbers?" I have wondered that too.. – gandalf3 Sep 13 '13 at 20:17

## 1 Answer

Use a Math node set to multiply:

• on top put 1.0 / max age <-- this you can precalculate
• in the second socket connect age

= 0....1

or, Use two Math nodes. Useful for if your max age is the same as lifetime of the particle. This way you can also deal with a dynamically changing particle lifetime.

• Why don't you just Divide the Age by the Lifetime? You would have a [ParticleInfo] node and a [Divide] node, and [ParticleInfo:Age] -> [Divide:TopValue], [ParticleInfo:Lifetime] -> [Divide:BottomValue]. – wchargin Oct 20 '13 at 22:58