Emission over time

Hi! Im trying to make that my particles decrease his emission depending on his particle age. I followed the tutorial for change density over time, and tryed to change the out channel to emission channel but this doesn’t work. How can I did it? Really thanks.

The main difference between Density and Emission is the Arity - the Density is a single Float (Arity 1), the Emission is a Vector (RGB - Arity 3).
So assuming you got the Density setup working, the only change to make to the flow would be to convert the value wired to the Output to a Vector using a ToVector operator.

Alternatively, if you are modifying an incoming value (Emission channel Input node), you can Multiply the incoming Emission by the value calculated using the original Density-oriented flow.
Since a Vector multiplied by a Scalar will produce both the correct Arity of 3 AND will scale all its 3 components, this should work.

Yet another alternative - if you don’t have an Emission channel already, you can create a Vector Input node, set the Emission color in it and Multiply by the original flow’s value before outputting to the Emission channel.

Hope this helps.

Thanks for your help, but I cant do it.
I attach a .max , that its basically one scene you submitted to another thread for change color over time. The scene attached is from your first solution, I have to activate user emission under main control? or something else? Really thanks for your time.
KRA_MagmaFlow_emission_Max2011_v002.rar (23.5 KB)

I cannot download the file from behind the firewall without bugging the IT department, so let’s try to go over the steps and figure out what is going on.

The first thing to learn about reporting problems is to describe what the problem really is. You say you cannot do it, but you are not saying what you are getting. An error? No Emission? A crash? Something else?

So here are the basic steps:

*Create a PFlow, add a Delete operator to define a valid LifeSpan.
*Save to a PRT sequence, while including both Age and LifeSpan as channels to save.
*Create a PRT Loader, load the sequence, add a KCM to the stack.
*In MagmaFlow, create the Inputs for Age and LifeSpan and convert both to Floats because they are Integers.
*Divide the Age by the LifeSpan.
*Subtract the result from 1.0 to get 1.0 in the beginning and 0.0 at the end.
*Create a Vector, set to some valid color like Red or Green or whatever, and multiply by the result of the Subtraction operator.
*Output the value to the Emission channel.
*In Krakatoa Main Controls rollout, enable Use Emission and start rendering - you should see you particles fully emissive at age of 0 and non-emissive when they die.

This should work with any PRT sequence that contains valid Age and LifeSpan.

Common user mistakes:
*No Delete operator in the PFlow - using an Age Test to send particles out to a Delete event does NOT work. The LifeSpan is initialized correctly only if there is a direct Delete operator right after the particles were born.
*Age and LifeSpan not saved to the PRT files.
*Age or LifeSpan not converted to Floats before performing the Division.
*Use Emission not enabled.
*Use Emission enabled, but Override Emission also checked - this will overwrite anything coming from the KCM.

Please try these steps and tell me where it fails.

Ignore my previous post.
We managed to download the file you sent, I created the particles and found the problem.
I didn’t think of mentioning this, but you have a Standard Material assigned to the PRT Loader.
Since materials are generally evaluated AFTER the modifier stack, and a Standard Material is a valid source of Emission (Self-Illumination channel is taken as Emission), you were overriding the KCM with the Material and getting Black color in the Emission. Once I removed the Material from the PRT Loader (select the PRT Loader and type $.material = undefined in the MAXScript Listener), you will see the Emission calculated in the KCM on your particles. You can even check >Ignore Scene Lights or delete the light and the particles will still render in the Emission color…

Also note that if you have v1.6.0 installed, the Emission Strength spinners have to be set to about the same values as the Final Pass Density spinners (there is an option in the [>>] menu to copy the value), otherwise you might get an overblown value. In v1.5.x, the Final Pass Density will control the Emission strength.

Really thanks! I was frustated!

There is any manual that explain the mathematics behind the magmaflow?
My problem now is that I have a curve to define the intensity of the emission, but what about if I want to change the color of the emission? If I use the override color emission tool in krakatoa GUI all the particles will emit light.
Another problem I have is with age particles, its possible to work the age life if I have in pflow a kill particles operator but after that a spawn particles operator that goes to another event?

The following chapter discusses the possible sources and the evaluation order of shading-related particle data:
software.primefocusworld.com/sof … on_Channel

Every particle can have its own individual Color, Emission, Absorption, Density and so on values. I don’t see what mathematics have to do with the defining of the Emission color. You can assign a color to each particle inside of a KCM, via the Self-Illumination of Standard Material, via the Krakatoa Material, via a Global Channels Override KCM or via the global overrides in the Krakatoa GUI. Obviously these changes happen at different stages of the evaluation of the particles (on the stack, after the stack, or at render time), so they work differently. But you can use any texture map or mathematical methods in a KCM to define a specific value for each channel for each particle. The Overrides are meant only for the cases where you want ALL particles to have the same color source (althrough you can still use texture maps in materials and global overrides).

In your particular case, and as already explained in this same thread, you can either multiply a Color or TextureMap Input Node by the value calculated from the Age/LifeSpan/Curve setup (Vector*Scalar instead of ToVector), or have an Emission Input node multiplied by them in the one KCM and define the Emission color in a separate KCM below on the stack. As with vertex/face data in Max, particle data flows up the stack in Krakatoa and you can have any number of KCMs stacked on top of each-other, passing data via named channels as needed. So it is up to you how you will define your colors and how you will manipulate them.

As for the Age/LifeSpan, this is not directly Krakatoa related, this is how PFlow works. If you are Spawning particles and sending them to another event, you will have to provide another Delete operator for them if you want a non-infinite LifeSpan value. Or you could try using a Delete operator in the Global (PF_Source) event to affect any new-born particle, regardless of where it was born.

Hope this helps.