2

I'm rendering an explosion and adding glow in Blender compositor.

I want to use it in a video editor later to composit the explosion on top of other footage. The premultiplied alpha should let me have the non-transparent parts (thick flames, smoke) cover the backdrop, while having the transparent parts (glow, soft flames) be added onto the backdrop.

I know how the math of alpha blending works, but Blender seems to be somehow always producing broken results, no matter how hard I try to work this around.

This is what I get every time when I export pre-multiplied alpha from Blender and composit on top of other footage in a video editor:

enter image description here

The fire is there, the glow is tehre, but there's a horrible white border around the fireball. Why is Blender doing this? It's clearly miscalculating RGB values when dealing with associated alpha, and I found absolutely no way to work this around.

Is there no way to export anything from Blender having premultiplied alpha working? It seems to be inherently broken. It's hard to believe, but that's what it looks like. If it's an error on my part - I'd be happy to learn the solution.

If I preview my render with added Glow without alpha used it looks like this:

enter image description here

Which is fine.

The alpha channel looks like this:

enter image description here

Which is also what I'd expect.

Somehow Blender takes the two and when I just apply the alpha to above RGB content I get this monstrosity, no matter how I do it (Set Alpha node, Separate/Combine RGBA nodes, routing Alpha directly into Viewer node...):

enter image description here

I am pretty sure I'm doing everything correctly, but somehow Blender compositor seems to be incapable of handling associated alpha material and breaks the RGB values at every step when fed such input. Which sucks, because I won't be able to get the visual results I want out of it.

Now - to get the Glare node work correctly I had to do this:

enter image description here

If I just give it the RGBA output from RenderLayer it obviously breaks:

enter image description here

How is this possible? is that a recently introduced bug of what? I've heard Troy Sobotka complaining about Blender's compositor not understanding associated alpha, but I've never experienced this first hand before.

What is going on? How do I get a nice glow without a hideous white border?

unfa
  • 1,199
  • 15
  • 23
  • https://blender.stackexchange.com/questions/154188/strugging-to-render-my-fire-animation-with-alpha-transparency-correctly/154213#154213 and https://blender.stackexchange.com/questions/57816/how-do-i-get-the-glare-node-to-output-transparent-instead-of-black-background/57824#57824 – susu Oct 25 '20 at 21:46
  • Thank you. So the Blender Compositor is broken. The only way to get correct results is to save out to EXR - PNG output and screen display will always produce broken results. Can we somehow get the Blender team to fix this? – unfa Oct 25 '20 at 21:54
  • 1
    I know that there have been recent improvements to the alpha handling for display in the image editor. Can you show the rest of your compositing nodes after the Glare node and what Blender version you're using? You may also want to check how this behaves in 2.91 or 2.92. From a short test it seems to work fine in master (Render Layer => Glare => Composite). It should also be noted that Blender always handled the output fine, just the viewer had some issues in the past. – Robert Gützkow Oct 25 '20 at 22:36
  • It seemed there's been some improvements in Blender, but the PNG format seems to only support pre-multiplied alpha. So attempting to write straight alpha to PNG is futile. – unfa Nov 14 '20 at 14:11

0 Answers0