2
$\begingroup$

I have this node setup, with a PNG image which has a blur applied to it. I saw the node setup in this tutorial : https://www.youtube.com/watch?v=ifgQyd49hj8 (13:17sec), the nodes are seen.

When I put my PNG image on top of a white material, the blurry edges make a white halo around it. Is there a way to make the white edges not visible? On my black background and transparent background it's as I want it to be.

White hallo visible on the left

$\endgroup$

1 Answer 1

5
$\begingroup$

First of all, in this setup you can delete the second Mix Shader set to Fac = 1.000 and the Transparent BSDF plugged in it, because it is absolutely useless in this material.

A disclaimer for the following explanations: this is mostly simplified and by no means an attempt to give a technically complete correct answer on how color spaces or view transforms work. It is just meant to give an idea of what is going on there:

Then we have the fact that it looks like you are using the View Transform > Filmic in the Color Management. You can clearly see your white is not white, it is light grey (of course I don't know your lighting setup, maybe it is just not bright enough for white).

The Emission shader works additive, i.e. it adds to the color of the underlying plane wherever it is not opaque. Now the Strength is set to 6.5 which (in the mostly opaque part of the circle) results in - if I assume an emission color of RGB (0, 1, 0) for example - an emission strength of a very strong green with (0, 6.5, 0) as RGB values.

This is where the circle is fully opaque, because you cannot see the plane beneath it. If you now move to an area at the border, where the transparency is 50%, you have the following: let's say the white background is not fully lit so that it appears light grey with RGB (0.6, 0.6, 0.6). The emissive plane is half transparent, so half of the color comes through, RGB (0.3, 0.3, 0.3).

The emission is only half the strength as in the opaque part, so it's RGB (0, 3.25, 0). Since transparent emission is additive, it adds to the grey beneath so you get (0.3, 3.55, 0.3) in the semi-transparent area. (These values are only simple median values for showcasing, they can vary due to Color Management, specific examples further down).

Now the problem is, that an sRGB display can only show RGB values in the 0 to 1 range. Meaning, depending on the View Transform and what kind of contrast and exposure you set, the green in the center will always be displayed with a value of 1 at its maximum or less.

The semi-transparent will perhaps be showing (0.15, 1, 0.15) or similar - which is a brighter color on an sRGB display than (0, 1, 0). This way the combination of already bright areas like a white background can appear brighter than the actually brighter parts.

If you render an image, you can right-click an area on the image and at the bottom of the Image Editor the actual values are shown as well as the resulting colors in the 0 to 1 range from the Color Management transformation.

In the following example I have a plane with a simple Diffuse BSDF set to full white with RGB (1, 1, 1), lit by a sun lamp of strength 2. Above there are three smaller planes, all have an Emission shader, color is RGB (0, 1, 0) with a Strength of 6.5 but the top left is fully opaque, the one in the center only half so 50% opaquee, the bottom right one is only 10% opaque (i.e. 90% transparent). After rendering, I right-click in the center of each to read the values:

transparent emission on white background

As you can see, before getting darker the more transparent the emission is, it appears to get brighter. With a black background it is different, since the black plane has only 0 in all color channels, no matter how much or few gets add to it by the emission, it will always appear brighter than the background, and so there is no apparent birghtening in the semi-transparent areas. It can only be (since the overly bright green is reduced to around 1) that the emission at first does not seem to get darker with just a little transparency:

transparent emission on black background

Your third example goes a bit in the same direction as the black background, since the colors are mostly darker than the emission there is no strong brightening effect visible.

As a last example that this effect is mostly due do the green emission strength > 1 and the transformation of all values into the 0 to 1 range by the Color Management, I will show you how it looks like if the white plane in the background is not a diffuse surface, but also an emissive plane with Strength = 1. There is no sun lamp to light the scene, in Color Management the View Transform is set to Standard and Look to None (so no higher or lower contrast), but don't be confused that now the transformed colors suddenly reach values higher than 1, this is because Standard does not "normalize" the values to the 0 to 1 range as Filmic does. Of course the display cannot show higher values, but now everything where a slight opacity is left will look darker than the white background:

emissive white background, standard view transform

$\endgroup$
2
  • 1
    $\begingroup$ Such a detailed answer. Thank you. By the way, I was hesitating if "halo" was spelled with two l's or just one for a second and I chose to bet on two l's :D. Thank you for the edit. $\endgroup$ Sep 14, 2023 at 6:47
  • 1
    $\begingroup$ @mqbakamqbaka You're welcome :D I ignored the original "hallow" (which is an old word for "saint") yesterday because I understood what was meant, but when I saw you made the effort to correct everything I thought well, let's finish it ;) "hallo" with two L is just another spelling for "hello" $\endgroup$ Sep 14, 2023 at 6:56

You must log in to answer this question.

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