I am having pipes where I have liquid go through it. I want to simulate/show the water and show some blue to red color animation. Blue for cold, red for heat/warmth.

For best control, it would be great to define some kind of color change areas on the path of the water simulation and when a water particle goes through this area, I want to change the color for this particle. The color needs to be kept, until the next color-change area is there and changes the color again.

So I could control and simulate a heat-transfer simulation.

Any ideas how to do this the best way?

Thank you guys!

EDIT: Here is a screenshot of the animation. You can see the position by Particial works in general. But I want to colorize the blue particles inside the 3 red circles to the color red and they should in their color. I somehow lost my fluid simulation data, so I can't share the .blend file. Sorry. enter image description here

  • $\begingroup$ If you can define any function f(xyz) that return the values in the field, you can do it in shader nodes.. Circles aren't volumes.. do you mean cylinders, or spheres? $\endgroup$ – Robin Betts Sep 12 '20 at 16:24
  • $\begingroup$ @RobinBetts Hi Robin, do you have an example of those shader nodes? Yes, I mean cylinders. Was just to make things easier. $\endgroup$ – Felix Blendend Sep 13 '20 at 15:39

You can shade an object in another object's space, so perhaps, rather than do all the math to figure out where your red-zone cylinders should be, it would be more user-friendly to make actual cylinders that control the colour of your particles.

I've called mine 'RedZone'. Their Object texture coordinates are used in the shader for the particles, to make a mask, as follows:

enter image description here

The XY lengths from the cylinder's centres, clamped, return a 0-1 mask inside them, and 1 outside. (The cylinders must have their scale applied at creation radius, 1) If you scale the Cylinders in Object Mode, the masks will follow. Combining the masks with a minimum, and putting them through an (inverting) colour ramp, lets you soften the masks. The combination controls the mix of colors.

You could add more cylinders and use more minimums to mix those in.

enter image description here

The .blend file is only good for the nodes, I haven't packed the particles.

  • $\begingroup$ @Felix, I've taken you very literally.. If you need a less simple-minded answer, just ask. $\endgroup$ – Robin Betts Sep 13 '20 at 20:36
  • $\begingroup$ Thanks for your very helpful answer! Is there a reason why you set the Z axis to 0? Also: "The cylinders must have their scale applied at creation radius". What does that mean? Am I free to just scale up, move, rotate those RedZones like I wish or do I have to look out for something? Thanks! $\endgroup$ – Felix Blendend Sep 13 '20 at 22:41
  • $\begingroup$ @Felix For the red patch to match the cylinder, with this set up, the radius of the cylinder must be 1, when the cylinder's scale is 1. That's all.. that's the way a cylinder is when you create it. Z is set to 0 because we're not interested in it.. it shouldn't make a contribution to the length. If we did include it, the red zones would be spherical, not infinitely-high cylindrical. If we need to cap the cylinders, the Z would be included later.. something like 'XY length < 1 AND abs(Z) < whatever'. Yes, you can move, scale, rotate the cylinders in Object mode. $\endgroup$ – Robin Betts Sep 13 '20 at 22:51

You can just use a Particle Info node and use it's Position output to control the color of the particles

  • $\begingroup$ Hi, this work only partially. Because so I can only create a simple gradient effect from 1 source. I somehow need a way to use some kind of color force field the particles go through and then change color like I wish... $\endgroup$ – Felix Blendend Sep 12 '20 at 12:08
  • $\begingroup$ Yes, you can do it. To determine a color field you can use a 3D texture (like noise or a gradient) or math. If you want to do a heat-transfer simulation you probably have some math data/formula that say "in coordinates x,y and z the color is k", and to do that you just need the particle position. $\endgroup$ – Tareyes Sep 12 '20 at 12:13
  • $\begingroup$ @Felix Blendend Basically, share your .blend file or some pictures, so we know what you want $\endgroup$ – Tareyes Sep 12 '20 at 12:14
  • $\begingroup$ I updated the question above. $\endgroup$ – Felix Blendend Sep 12 '20 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.