Possible alpha computation bug for halos

Hi,

I’ve created a simple scene with a bube and a particle system in front of it (some kind of poisonous green smoke :slight_smile:

Here’s the scene: http://kyosuke.sweb.cz/Alpha_halos.blend

The problem is that I can’t make Blender to calculate a reasonable alpha. The “Sky” option creates a nice output, the cube is visible as I expected with the settings I made.

But when I use the Premul or Key option:

  1. The visibility of the cube changes drastically, although it IMHO shouldn’t (it’s a partially transparent halo smoke in front of the totally opaque cube. Does the algorithm of computing pixel colours based on RGBA samples change with this setting? If I understand it correctly, the colour of a pixel shouldn’t change with the change of the rendering mode unless the last visible surface isn’t fully opaque (== (resulting_total_alpha != 1))

  2. The alpha is obviously wrong. At least in the Sky mode it behaved totally differently and the cube was much more visible. (What’s also strange, although it is still visible, the alpha of the smoke is 1.0 at the edges of the cube which means the cube edges houldn’t be visible at all, but they are :slight_smile:

If you render at let’s say frame 50 with Key/Premul (doesn’t matter which one of these) and peep into alpha channel, the center of the smoke is totally opaque. But in Sky mode the sky could be seen through (i.e. affected the colour) even in these “toally opaque” pixels.

Using Sky is not quite an option, since I nead several layers for compositing with live footage (smoke over live scene!) and I’d like to have some flexibility which “burning everything in one animation” doesn’t have at all.

I used the Unified renderer for these images and turning it off didn’t make it any better. Premul+Unified looks quite OK in Blender render window, but the alpha in the saved file is still erroneous (you can’t see through Alpha=1-objects in real world, can you? So the red cube in alpha=1 area is a bug for me :)))

Images:

http://sweb.cz/Kyosuke/Sky.jpg
http://sweb.cz/Kyosuke/Strange.jpg

If I understand it correctly, the colour of a pixel shouldn’t change with the change of the rendering mode unless the last visible surface isn’t fully opaque (== (resulting_total_alpha != 1))

Not quite true, you will lose any reflections, refractions etc. caused by the background that is now just alpha.
It says the the file doesn’t exist so I couldn’t download it to take a look.

GreyBeard

[quote=“GreyBeard”]

Not quite true, you will lose any reflections, refractions etc. caused by the background that is now just alpha.
It says the the file doesn’t exist so I couldn’t download it to take a look.

GreyBeard

But not if you’re using image based or presaved envmaps which is what one needs if rendering separate layers for video (a faster (=better) option :slight_smile:

I think I’ve found the reason:

The alpha for halos is simply summing itself!

If you for example have two overlapping halo circles each with alpha=0.5, you wont see through them (alpha total=1), but I’d expect 0.75…? This way my particles will never render correctly since I!m expecting an anpproximation of exponential fallow of opacity along the ray inside cloud. I really consider it a bug. I’ll either report it, fix it for myself or both :slight_smile:

Any core Blender developer here?