AWS Thinkbox Discussion Forums

How to composite Krakatoa render?


Up until now I have been compositing my Krakatoa .exr particle layer above a scene layer in After Effects by simply using a blend mode for the top Krakatoa particle layer (Screen). This works OK for white particles, but not well for other particle colours.

I find that whatever Alpha option I select in After Effect for the Krakatoa layer (Straight - Unmatted, or Premultiplied - Matted with Color) the particles look dark in some areas and nothing like the render in Maya/Krakatoa render view. My best solution has been to Ignore the alpha and use a Luma Key effect in AE to manually create an alpha and remove the black background to just leave the particles. I have also set colour space to Linear, so that doesn’t seem to be the problem, as the Ignore alpha setting looks correct in AE.

Is there a better way? Am I missing some Maya Render Setting? The alpha channel it creates is unusable.

P.S. My latest, best solution is to add a Levels in AE to the layer and reduce the Alpha Input White to around 7.
This is better than my older method that was to add layers of the Krakatoa layer on top of each other. This seems to eliminate the ugly dark particles by, presumably, solidifying the alpha matte of the particles.

Hi litote,

The alpha channel in Krakatoa renders is for the most part controlled by the “Density” channel of the particles, as well as the Final Pass Density. The “Density” channel can can either be set using Magma, or overridden globally in the “Global Render Values” rollout in Krakatoa’s render settings. Final Pass Density can be set in the “Lighting and Drawing Pass Density and Filtering” rollout in Krakatoa’s render settings. One caveat of this is that increasing the density will increase the intensity of the particles self shadowing each other. If you want to retain the same self shadowing, but increase the value of the alpha channel, you can enable “Use Lighting Pass Density” (right underneath where Final Pass Density is set) and control the density scale used when lighting is calculated independently of the density scale used when drawing the alpha channel.

More information on this topic can be found here:

1 Like

Hello Evan,

Thanks for your reply. I am not sure how to set a value for the “Use Lighting Pass Density” to, presumably, make the particles more dense/less transparent so they look correct in After Effects.

For example, My current settings are:
Final Pass Density: 3; Final Pass Exponent: -4
When I render and import to AE as Straight-Unmatted, I get a very small, faded particles and have to adjust the Levels on the Alpha channel to strengthen the visibility of the faded particles to get a result that matches the Krakatoa render.

If I check “Use Lighting Pass Density” to control the density scale, what “Lighting Pass Density” and “Lighting Pass Exponent” should I try to make this work? I’ve tried different values and whatever values I choose I don’t see any difference when I switch to Display Alpha Channel. I’m trying to make the alpha more solid.

The render looks fine in AE if I don’t use the alpha channel, but when I do it looks faded and fringed with black. Could you give me an example of parameters that work?

Lighting Pass Density should be set to whatever you had Final Pass Density set to originally.

To get a more solid alpha channel you’ll need to use a non-negative Final Pass Exponent. Something like a final pass density of 0.5 and a final pass exponent of 0 or 1 would probably give you a result closer to what you’re looking for.

1 Like

Thanks Evan.

I see what you mean by setting a non-negative Final Pass Exponent to make the alpha more solid. But, if I want to composite particle renders that have a more transparent density setting (higher negative exponent), is the only method to manipulate the alpha channel within the compositing app to make it look correct?

My current method is to use a Levels effect in After Effects to boost the solidness of the alpha, otherwise the render layer looks very transparent and faded when you use its alpha. The only problem with this is it introduces some black fringing around the particles, which is of course more noticeable on light backgrounds.

I am just wondering if this is simply a limitation for the less dense particles renders?

I can’t find any tutorials on compositing practices.

Edit: I have been experimenting some more and I find that if I keep the Final Pass Exponent at no greater a negative value than -3 I don’t have these issues. If I push it to -4 the render layer looks greatly faded when I import in to AE and looks nothing like the Krakatoa render. So there seems to be this limitation, at least in AE. Perhaps Nuke handles it better?

First things first, the Final Pass Exponent value simply decreases/increases the actual value of the Final Pass Density multiplier by an order of magnitude. So if the Final Pass Density is 5.0 and the Exponent is -1, it results in a value of 0.5 used to multiply the Density coming from the particles. Thus, changing it to -2 produces 0.05, -3 is 0.005, -4 is 0.0005 and so on. Of course, the resulting Alpha of the render image will be 10x lower when you render with -4 as opposed to -3, so no wonder things look faint and faded.

You should NOT manipulate the levels of your input in AE. Just remember that the render output from Krakatoa is PRE-MULTIPLIED. So when you render in Krakatoa, leave the background black, and when AE asks you on import, answer that the image is Pre-Multiplied and keep the default black swatch value - it will divide the RGB channels based on the Alpha and Background swatch values and remove the black from the RGB components.

From Krakatoa, render with Occluded particles pass so you would have a background layer containing the particles behind Matte objects. Put the background image at the bottom of the comp, the Occluded layer on top, the Geometry rendering from the non-Krakatoa renderer above it, and finish with the main Krakatoa render output which contains the foreground particles.

Keep in mind that bright particles on black background will generally appear brighter than when composited over a bright background. For testing purposes, I would suggest setting the background in Krakatoa to a brighter shade of sky blue to get an idea how little they actually contribute to the color. When rendering out the final pass, disable the background override and save with black background to make the pre-multiplied post-division easier in AE.

Here is an occluding teapot in a spherical volumetric particles cloud with Final Pass Density of 1.0 Exponent -2:

Here is the same thing with sky-blue (0.2,0.5,0.8) background:

This is the geometry rendering of the teapot itself:

The actual Alpha in the saved image might appear relatively high when looking at the channel in the frame buffer. In my test, it was around 0.5, which means that 50% of the background image would be blended with 50% of the Krakatoa particles’ color. However if both colors are rather bright (in my case a mid-gray over mostly a blue sky), the particles won’t look too solid - they will be literally 50% transparent.

This the the Alpha:

When composited in AE over a photo of the Olympic Fire in Vancouver I took a few years ago, it produces this (ignore the wrong pespective :slight_smile: ):

Hello Bobo,

UPDATE: OK I think the problem may have been I had AE project set to 16-bit. Changing the project setting to 32-bit seemed to make all the difference.


Thanks for the explanation. In the image in the link below you can see the differences in the renders I got using premultiplied and unmatted options in AE, compared to the render I got in the Maya Render view:

In the scene I just used a few Spot lights and one point light.

I found that, although the premultiplied option gave the truest alpha, some lighter hue shading shows in one area that is different to the Maya render view. Is this simply to be expected — that there will not be a 100% match, especially at settings such as I have that make the particles somewhat transparent? The render looks the same in AE if I don’t use the alpha (Ignore).

Does this explain why at a higher transparency/lower density setting of Final Pass Exponent: -5 there is such a big difference between the AE render and the Maya viewport render? At this setting of -5, the image is so faint it is barely visible in AE, but it is very solid in Maya. I notice in other tests (as in the image link) that in areas where there are less particles, there is this lighter colour shift where the alpha is more apparent. Even if I increase the particle count at this highly transparent setting of -5, the render in AE gives a very different, faded colour.

Privacy | Site terms | Cookie preferences