particle color transition from a object to another

Hi. I have a question about the particle color transition. i have done a test that a object with particles on the surface turn to the other object with particle flow. but the two objects have two different materials. so i want to do a particle color transition from the start position to the end in krakatoa magmaflow . it will be great if anybody could give me a hand:)

There are various approaches to this - you can handle it at Color level, or at Material level, or even in PFlow itself.

There are a few tutorials already available showing how to mix colors based on Age, Velocity and so on. The principle is generally the same - you need some channel that controls the blending by producing a value between 0.0 and 1,0, and then you use a Blend node in Magma to mix two colors, texture maps etc.

The alternative method is a bit slower, but potentially more powerful. You still need a control channel, but instead of using it as the 3rd input of a Blend operator, you output it converted to Vector as TextureCoord or one of the other Mapping channels. Then you assign a Blend Material to the PRT Loader and set two Standard materials with whatever properties you want (Diffuse color/map, Opacity, Self-Illumination color/value/map and so on). In the 3rd slot of the Blend material, you add a Vertex Color map and select the same channel as in the Magma modifier. As result, the two Standard sub-materials will be blended based on the control value coming from the Magma via the mapping channel…

What channel do you have that will control the blending?
You could produce the control channel by creating an animated Mapping operator set to change from black to white and synchronizing it with the current event. So particles entering the event would get their Mapping animated while they are in it. You could drive a Blend material with that channel, or save it for the Magma/Material approach described above…

Anyway, these are just general ideas. Without knowing your setup, it is difficult to tell what would work best.

Hi Bobo,

I’ve done those tutorials and I have one question about the alternative method. I have made a quick setup with sphere that generates particles and have spherical mapping on it with str material - diffuse bitmap. Then a box that has a box mapping with str material - diffuse checker. Then i made particles going from event 1 to event 2, making all the correct get material, get mapping coords and give particle age (delete at frame 100) to these objects. The setup works fine, and the only prob is that the transition is made in one frame. When it finds the target, changes color. The question is:
If i export this simple setup (.prt) with texturecoord, color, lifespan and age and then make a prt loader with it, can i make that transition by age, so it blends smoothly? Because on the tutorials i saw, the texturecoord is applyed with magma flow, and color, etc…

Thanks for any tip on this,

Hi!

You are sending particles between two events with different materials AND mapping coordinates, which of course causes the abrupt switch. What I was suggesting was to have both materials and mapping coordinate sets available to the particles at all times, and slowly blending between them. So even if the particles switched from one event to another, their material would not change. What would be changing is the blending control channel or map that slowly reveals the second material while reducing the first (via a Blend Material).

This should be easy if the mapping coordinates (spherical and box) could be applied in the beginning. But in some cases this cannot be done, esp. if you want your particles approaching the box target to ACQUIRE the coordinates from the box itself (in other words, the particles would “build” the box and have the correct coordinates at the target point!).

The way to do this would be to use two PFlow systems and a bit of DataOps. FindTarget lets you use explicit target positions to send every particles from one system to a specific coordinate which could be taken from another particle system! So my suggestion is to create a second PFlow with a Position Object operator and cover the Box’ surface with these particles, while stealing the UVs from the closest point on the Box’ surface. These particles will be set to non-renderable and will remain static. They should all be created on the first frame and you will need AT LEAST the same number of particles as in your dynamic system.
Then use a DataOp in the original particle system to copy the mapping coordinates from your target particles into a mapping channel 2 of your dynamic particles. You can also set the ScriptVector channel of the dynamic particles to the Position of the target particles (matching them by index so particle 1 from system A goes to particle 1 from system B and also has a mapping channel with its mapping). Then switch the FindTarget to By Script Vector so the dynamic particles will try to reach the static ones on the Box. For this to work in world space, you need to remove any meshes from the targets list!

If you would now slowly blend between two materials using some control channel, you can have the first material use the spherical UVs from channel 1 and the second material use the acquired box mapping from channel 2. You could do the blending using a DataOp also (it is very similar to using Magma, but is native to PFlow and 3ds Max 2014). For example you could read the Age and LifeSpan and normalize a value between 0.0 at frame F and 1.0 at frame F+D (where F is the first frame of the blending and D is the duration of the blending), then convert this value to a Vector and output as Mapping 3. Put a VertexColor map in the control slot of a Blend material assigned to all particles all the time (in all events or globally) and set the map to use Channel 3. Now as the blend value changes from 0.0 to 1.0 gradually, so will the UVW in Channel 3, and the Blend Material will slowly reveal the alternative material and box mapping…

Hope this gives you some ideas…

Thanks for your help Bobo!
My only prob is that i don’t know that much of data op’s and how to copy mapping coords from one event to other. Then again, how to use scriptvector channel, etc… Maybe you can point me some direction on where to learn this kind of operations (dvd’s + sites, etc).
Until i learn how to do this (i think it will take a while!), i have one simple solution that is rendering two time’s the same sim and comp it to have that blending material.
I thought that using prt, and having all the mapping coords, color, etc saved on it, i could easily make this transition. Because if particle has the information that in frame 0 it’s white and in frame 60 it’s red, then magma could do the blend between those colors (so i thought).
Thanks again for your ideas… hope one day i can look at them without the technicall black hole between me and so many data operators and vectors and etc… :wink: Study time!

Cheers,

Here is a Max 2014 PFlow example scene which contains the following:

*A Torus (non-renderable) which is used to create 10,000 box-shaped particles (PF Source 002).
*A Teapot (non-renderable) which is used to create 10,000 target particles (PF Source 001).
*The mapping channel 1 of the Torus is copied to the dynamic particles in PF Source 002.
*The mapping channel 1 of the Teapot was copied into channel 2, then copied into the target particles of PF Source 001.
*A DataOp in PF Source 002 reads that channel and copies it into its own particles, so then now have both Channel 1 from the Torus and Channel 2 from the Teapot.
*The dynamic particles first fly off to a Find Target icon up in the air, then go to another event and use Find Target to land on the Teapot.
*The second Find Target is set to Script Vector. A DataOp is used to copy the Positions of the PF Source 001 particles into the Script Vector channel of PF Source 002.
*Same DataOp also calculates a Blend factor based on distance to the target with range of 100.0 units - when the particles get closer than 100 units, they will blend from the Torus material to the Teapot material. The blending is controlled via Mapping Channel 3 which is inserted into a Blend Material via Vertex Color Map set to Channel 3.
*The Blend Material is assigned globally to the whole system via a Material Static.
*I used a Rotate Speed Space to make them follow their velocity vector in the second part of the trip.
*When the particles land (currently using Spherical icon vectors), they stop, rotate to world space and are also set via DataOp to the exact positions of the target particles to produce a correct shape, because the Find Target uses a Distance Threshold and does not match perfectly.

I have added Comments to all operators in PFlow, feel free to dissect and find out how it works.
PFlow_TorusToTeapot_FindTarget_DataOp_v004.zip (38.7 KB)

I also made a Krakatoa version of the setup.
*I increased the number of particles to 100,000 in both systems, and set viewport to 10% to show 10,000.
*I added a Point light to illuminate them in Krakatoa.
*I disabled the PF Phantom particle source in Krakatoa to avoid rendering the target particles.
*I tweaked the Gradient colors to make it more obvious when the transition happens.
*I enabled 8 passes Jittered Motion Blur with 360.0 degrees shutter.

PFlow_TorusToTeapot_FindTarget_DataOp_v005.zip (43.4 KB)

Here is a little more advanced version of the same concept.
This time, the transition is by Event Duration (time since entering the event), which is similar to Age, but localized to an Event.
I also used a Deflector to trigger the particles gradually, and some Turbulent Wind and Drag to make them move more interestingly.
PFlow_TorusToTeapot_FindTarget_DataOp_v009.zip (101 KB)

Nice! Thanks Bobo.

I did manage to solve my issue by using a FollowFumeFX operator, but I’m going to investigate Stroke 2.0

~tsp

WOW! Simply perfect… super thanks (once again) bobo! :slight_smile:
Time to work hard now!

Cheers

Hi Bobo,

This is the final result of the spot using this color transition :slight_smile:)) Super thanks for your help again!

facebook.com/photo.php?v=30 … =2&theater

Cheers,

Beautiful!
Glad I could help!