tyFlow Forum
Colorize using distance to an object? - Printable Version

+- tyFlow Forum (https://forum.tyflow.com)
+-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html)
+--- Forum: Bugs and Issues (https://forum.tyflow.com/forum-3.html)
+--- Thread: Colorize using distance to an object? (/thread-4836.html)



Colorize using distance to an object? - Fabrice - 06-20-2025

I i'd like my particles to have their color from their distance to an objet.

I mean :
I created a materiel using a multicolor gradient going formthe first color at the beginning (color 0) to the last color at the end (color 100).
When the particles are far from the object I want them to get color 0
and when they reach the objet's center (or, better, its surface) they get color 100.

I guess I need to use "Distance to target" custom float data and a mapping node but how?
(as I do when driving the opacity with a gradient using "Particle age" custom float value)
But what represents "target" in the  "Distance to target"? A value ? An objet ? A channel ?
The channel "target" allready exists, why? Should I use it?
How to evaluate the distance from each particle to the object?
...

Any help, tuto or example about it would very wellcome Smile