0
$\begingroup$

I have a render with transparent film that I ran. When it finished, it appeared completely fine in the Blender render viewer. It has glowing cloud-like parts where I attached an emission shader to the Volume output:

enter image description here

The issue is, when I save the render as a PNG, it completely culls out the areas that hit the background, even though they should be partially and not completely transparent. Here's an image showing the render in Blender preview with the volume rendered correctly, and then in Photoshop after export with a simple black backdrop, where the volume against the transparent back disappears completely:

enter image description here

Is this a bug in Blender? I'm using v3.0.0 - maybe I need to update? Update: Just installed Blender v3.4 - still the same bug, which appears to have been reported: https://developer.blender.org/T101693

TIA

p.s. I found this question which tries to explain it, but it isn't clear enough for me to derive the following:

  • Why? Why disregard areas that have a clearly understood amount of alpha? I am looking at the rendered image in Blender's preview. It looks fine (likely new in v3.0.0 since the question says the preview didn't work). I simply want to export it as is as a PNG. Why can't I?

  • How does an emissive volume 'represent' transparency? To me, I would have assumed it is simply more opaque the farther the rays travel through it, and that using the emission shader simply maintains a constant light color, which doesn't seem to be something Volume Absorption or Volume Scatter will do.

$\endgroup$
2
  • $\begingroup$ Instead of the Emission shader, try the Principled Volume, it should give you a correct Alpha output. I suppose it's because Emission represents light, which by nature has no density. $\endgroup$
    – thibsert
    Commented Dec 13, 2022 at 18:46
  • $\begingroup$ Thanks @thibsert. But it isn't supposed to have density. The point is that it looks like light, not a cloud. p.s. I did try the Principled Volume shader; with the same 'emission' settings, I get the same effect. :-/ $\endgroup$
    – Codesmith
    Commented Dec 13, 2022 at 19:18

3 Answers 3

0
$\begingroup$

Why? Why disregard areas that have a clearly understood amount of alpha? I am looking at the rendered image in Blender's preview. It looks fine (likely new in v3.0.0 since the question says the preview didn't work). I simply want to export it as is as a PNG. Why can't I?

Because PNGs do not encode alpha correctly.

Think of RGB as the quantity of tristimulus. Think of the A as the degree of occlusion in terms of geometry.

In some cases, the degree of geometric occlusion is zero. Think of a reflection; the light as a quantity of tristimulus is not occluding.

In a PNG, the design is fundamentally broken. The geometry is always in the sidecar A channel. As such, it is not yet associated with the amplitude of the RGB tristimulus. That means that we are missing information in a PNG due to the nature of its broken and woeful design.

In the case of a PNG, there is no way for us to carry the information of an RGB tristimulus quantity of greater than zero, and a degree of occlusion of zero, because PNG must, according to the horrible design, always store the alpha unassociated with the tristimulus.

When a PNG is loaded with an A channel, the encoding must be forced to associate the A with the tristimulus amplitudes in RGB. That means if the wretched encoding carries an A channel, it will be forever forced to scale the amplitudes of the RGB tristimulus with whatever values are present in the degree of occlusion specified. In the case of 0.0, it scales / gains the tristimulus to 0.0 via a multiply. Always.

It is a broken encoding and should be thrown in the garbage. Worse, Blender’s entire handling at eight bit is also broken in a similar way.

How does an emissive volume 'represent' transparency? To me, I would have assumed it is simply more opaque the farther the rays travel through it, and that using the emission shader simply maintains a constant light color, which doesn't seem to be something Volume Absorption or Volume Scatter will do.

Think of a reflection is the simplest example. If we are standing in front of a window, the window is effectively occluding nothing, plus or minus small amounts of energy being attenuated.

Now think of a reflection on the near surface. It is 100% unoccluding. We know that under our mental model of encoded A that the A represents degree of occlusion. One value solved! A = 0.0.

Now we isolate the reflection against a black curtain behind the window. We could quantify and measure the reflection now as amplitudes of RGB. Blam! Now we have our amplitudes of tristimulus!

Now we want to composite the reflection over the background outside the window. Dead simple…

We take our amplitude of the background and we gain / scale the background by the degree of occlusion. Given our reflection does not occlude and has an A of zero, we don’t do anything! Now we add on the tristimulus of the reflection and presto! Solved.

If we think of a similar thing, such as something that is virtually identical to the reflection, but it is a sticker that has a neutral density of 50%, we can do the exact same calculation. Only this time, we gain the background down by 50%, and then add the tristimulus of the RGB foreground to it.

TL;DR: There is only one proper alpha encoding. The other one doesn’t encode alpha, and is a broken concept. It also happens to be the concept that the PNG creators thought was a good idea.

They were incorrect.

$\endgroup$
0
$\begingroup$

If the transparency in the render is broken for areas of a volume, it could be due to the volume scatter settings. In the Volume Scatter tab of the Material Properties panel, try increasing the density and/or decreasing the scattering distance. This can help improve the transparency in the rendered volume. Additionally, make sure that the Use Transparent checkbox is enabled in the Film tab of the Render Properties panel.

$\endgroup$
0
$\begingroup$

I'm still seeing this in 3.5.1.

PNG isn't to blame either. You can see this in the Render window if you select the Display Channels drop down and set it to display Alpha only.

$\endgroup$
2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .