Particle movement and color based on image texture?

   1367   2   1
User Avatar
Member
60 posts
Joined: Nov. 2015
Online
Hello all.

I am trying to figure out how to have particle movement based on color, and the colors would be initially generated by an image texture. A flag with three colors, for example. How would I have the particles moving differently based on color? Different speeds, different flow, turbulence, etc. Yet still interacting with each other. The red particles would flow fast in one direction, while the green and blue particles would swirl in an opposite directions, for example.

I will be rendering in Redshift.

Any advice would be much appreciated.

Terence
User Avatar
Member
1737 posts
Joined: May 2006
Offline
Here's one of many ways.

Next to the popnet is a little example of a hacked together colour keyer inspired from reading this page [vfxtheory.blogspot.com]. Take the colour of each pixel (or particle), and plot that colour so that rgb becomes xyz. Then take the colour you want to use as your main colour, say a bright blue, also plot that in 3d space.

If you measure the distance between those two points, and only keep the points that are within a certain distance, then thats a basic colour keyer.

Using that idea, inside the popnet I have a few forces, and each uses the same colour keyer maths to only allow that force to affect particles with a certain colour. So red particles are moved along z, blue particles along x, and green particles are spun in a circle.

After that are a few more forces that work on all particles equally, here a pop interact so the particles repel each other a little, and a noise to give a general noisy behaviour.
Edited by mestela - Jan. 25, 2019 02:07:14

Attachments:
pops_forces_from_colour.gif (2.5 MB)
pop_forces_by_colour.hip (425.2 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
60 posts
Joined: Nov. 2015
Online
Thank you. That’s a great approach. Very helpful.

Terence
  • Quick Links