Emission-Falloff

Hey,
I wanted to fade the emssion of my particles per age. The emission is already depending on the age of the particles and a gradient-ramp (Green -> Yellow -> Red) is used. I wanted to fade the emission, so that it’s getting less and less overtime. My thought was: black emission = no emssion and I could make the yellow a little bit darker than the green and the red even darker (nearly black). Since I didn’t want to change the color in the color-gradient ramp I created a new gradient ramp from white (=1) to black (=0) and multiplied it with my original green-yellow-red-gradient-ramp :slight_smile: All of this is done in Magma.

The flow look like this:
puu.sh/cxzOD/506584eb41.png
The top texmap is the fade and the lower texmap is the color.

The curves/clamps are just for more control over the color/fade. My problem is that somehow, when I render my particles they doesn’t seem to fade, but as you can see they fade in the viewport. Even when I really pump the black part in the fade gradient up (so that it’s nearly just black) the emssion is still there (a little bit less but still easy to see):
puu.sh/cxA1c/66e2af4d74.png

I also added a new MagmaModifier for the density by age and even if the density is zero, the particles are still there, shining like never before :frowning:, even though the alpha channel is black…
I think I missunderstood a really big part of the emssion or density, because I don’t even have a clue what’s happening here…
Color: puu.sh/cxAia/9dc6003575.jpg
Alpha: puu.sh/cxAjc/1d48bac89d.png

Thank you really much guys. You’ve been always helpfull and I hope someone can explain this for me!
Matthias :slight_smile:

The Color, Emission, Absorption and Density channels work together to produce the final output color. So their balance results in various (un)expected effects. Add to that the Final Pass Density, Emission Strength controls and all the Magma and it becomes a bit scary! (Happy Halloween! :smiling_imp: )

I created a simple PFlow with Delete By Age 60 and saved to disk.
I then loaded in a PRT Loader and added a Magma with a similar flow to yours, but with some small changes.
I did not multiply by another GradientRamp because evaluating maps is generally slow. Instead, I multiplied by 1.0-(Age/Lifespan), the same value calculated for the UV of the Ramp, but subtracted from 1.0. This gives you 1.0 in the beginning and 0.0 at the end.
I also added a Power operator to skew its curvature instead of using a Curve operator.

I create the Emission output, the PRTViewportColor to keep an eye on the output, and a Density output which was also set to the same falloff as the multiplier of the Emission.

In order to clearly see the difference in color, I made the gradient Red-Green-Red. Rendering this with a Final Pass Density of 1.0E0 (1.0) and Nearest filtering to avoid variations in the pixel colors, I got clearly a fade off in the Density, but the Emission was relatively strong throughout. The Per-Particle Density was mostly high during the life of the particles - in my case, due to the scene size, a Final Pass Density of 1.0 produced Alpha close to 1.0 for most of the particle’s life. By default, the Emission channel is also modulated (multiplied by) the Final Pass Density, so it used the same 1.0E0 multiplier and remained rather high.
See the left-most particles here:
KMX2_EmissionByAgeLifespanFalloff_v001.png

So I then reduced the FPD to 1.0E-1. This now showed the correct Density falloff, and the Emission was also scaled with it, revealing the Age falloff as one would hope. See the second (RGB) and third (Alpha) particles in the above image.

Note that I had disabled Gamma Correction in the beginning. When I enabled it, the effect of the falloff was mostly lost due to the 2.2 Gamma curve on the VFB. See image #4 above. But the saved EXR would NOT contain this color correction.

Finally, I changed the Falloff from Power 1.0 to Power 2.0, skewing the Age falloff and making the Density go down much faster (and with it, the Emission, too, since the same value was used to multiply the Emission channel in the Magma). Image #5 shows the result.

Note that the Emission Strength can be used to multiply the Emission channel of all particles by a value different from the Final Pass Density one. Normally, when Use Emission Strength is unchecked, the particles will be painted rather brightly with the Emission color, producing the solid look we saw in the first column of the above image. If you enable Use Emission Strength and lower the value below the Final Pass Density, you will get less emissive particles. If you increase the Emission Strength above Final Pass Density, your particles will become a lot brighter.
In the following screenshot, the left image is Falloff Power of 1.0 (same as image 1) without Emission Strength and Final Pass Density of 1.0E-1 (0.1), then Emission Strength of 5.0E-2 (0.05), and Emission Strength of 2.0E-1 (0.2):
KMX2_EmissionByAgeLifespanFalloff_EmissionStrength_v001.png

On top of that, if you add a Color channel set to 0,0,0 to your Magma and then enable >Use Absorption, your particles will become fully Additive, with zero Alpha and Emission controlling the color. If you set the Color to 1,1,1 (white), the particles will render as solid (as in the above tests). But if you set the Color to an Age-based White to Black Gradient, the particles will transition from solid Alpha (with volumetric shading if you add a light) on top to fully Additive with black Alpha and ignoring any scene lights at the bottom.
Here is an example image:
KMX2_EmissionByAgeLifespanFalloff_Additive_v001.png
*Left two images shows Fully Additive rendering with Black Color and Use Absorption on - note that the particles are bright, and there is no Alpha at all.
*Right two images show the RGB and Alpha with a White-Black Gradient in the Color channel, switching from Volumetric to Additive shading…

So in these examples, the Alpha is affected not only by the Density, but by the Color and Absorption, too!
I highly recommend looking at this to learn more about volumetric vs. additive shading by controlling channel content:
thinkboxsoftware.com/krak-mi … and-volum/

Here is the Magma with all the channels at the last phase of my tests:

Hope this helps!

Thank you really much again, Bobo!

I think I’m on the right track now and I will look through the tutorial about volumetric and additive shading…
Somehow my results are still quiete different from yours. I tried your flow and the method without the second “fade”-gradient is great! When I use the same setup my particles with Power 2.0 look like your particles with Power 1.0 and my particles with Power 4.0 look like your particles with Power 2.0 and I don’t think I did something different than you. I also tweaked my gamma in the Customize - Preferences - Gamma and LUT-settings to 1.0.

Here you can see my flow and the render with a FPD of 0.1 and Power 2.0:
puu.sh/cxZaI/54fac09027.png

As you can see it doesn’t look like your image #5. It looks much more like the image #2.
Maybe you have an idea how that could happen?

Thank you again for the quick help. I’ll try to do a rendering with this technique and post it as a reply.
Happy Hallow from Germany!

Matthias :slight_smile:

It is possible our scene units affect the way it renders, although I am not sure how.

My scene was set to 1 Generic Unit = 1 Inch, yours is probably in Centimeters. But if you saved your particles while in Centimeters mode and loaded them in a PRT Loader in the same mode, there should be no difference.
When I saved my particles in Inches and then switched the scene to Centimeters and re-rendered, my particles got darker because the Density vs Generic Units mapping changed.

Can you pack your scene (Max file, PRT Files) and send it over? There might be something else we are missing…

Sure, I will mail it to you now!

I rendered your particles in place of my particles, and they look3e identical, exactly like the ones you posted in the last screenshot.
I also looked at your scene, too, and it appeared the same to me.

Just tweak your settings until you get the look you want… :slight_smile:

Okey, that’s fine! I just wanted to be sure I did nothing wrong in my scene.
I will just use a slightly different Power value to get the same look :slight_smile: