0

I hope you can help me.

I am trying to render a PNG image in front of other objects. I have my png image into the principled bsdf and the alpha to the alpha.

my blend mode is set to alpha clip. I have the same issue with alpha blend.

my issue is that everything works fine until i import an object and place it behind my png. Suddenly, everything goes black where the png covers the object.

In the image, my sphere is well behind my png car so they are not intersecting. I have duplicated the cars just to show that in rendered view, the car is transparent until it is in front of another object.

can anyone help? thanks!

enter image description here

rythem
  • 1
  • 1
  • This seems to only happen in cycles. As soon as i switch to eevee, it works perfectly. – rythem Sep 29 '22 at 04:38
  • @DuarteFarrajotaRamos Although the linked duplicate question is on the same problem and has an accepted answer, the solution given there for Blender 2.8 and higher wouldn't work here (and not in the other question either, as I pointed out in my comment there). – Gordon Brinkmann Oct 01 '22 at 07:13
  • @GordonBrinkmann thanks for looking into it attentively. Trying to keep in line with what was outlined here and avoid scattered information, could you please post an updated answer in the linked duplicate post? A copy paste from here will be fine. Feel free to ping me for an up vote. – Duarte Farrajota Ramos Oct 01 '22 at 14:24
  • @DuarteFarrajotaRamos Yeah, I can do that. The first vote to close here was suggesting to file a bug report for this, so I wanted to answer because it's definitely not a bug, just an unfortunate transparency setting. – Gordon Brinkmann Oct 02 '22 at 00:51

1 Answers1

1

With a very high probability the reason is the Max Bounces setting for Transparent bounces under Light Paths in the Render Properties.

As it seems, you have a value of 0 there. I would rather suggest setting it to a much higher value like 64 or even 128. It doesn't increase the render time very much but you can avoid black artifacts when too many transparent objects are overlapping themselves. Also black artifacts in smoke simulations are much less likely to happen.

The problem doesn't occur in Eevee since it's not a raytracing engine and doesn't use the Light Paths settings for bounces etc. The background is still transparent since it is not "bouncing off" rays so it's not limited to that setting.

It is not necessary to increase the Total bounces, since Transparent bounces are independent from the Total amount while the other values are not. You'll find it here:

transparent bounces

Here is an example: When you have one plane with transparency in front of another object e.g. a sphere, the object behind it will be black in the transparent areas just like in your screenshot, because the Transparent bounces are set to 0.

transparent 0

If you now simply increase the value to 1, the sphere will no longer be black behind the plane. But if you put a second plane in the scene, the sphere only shows correct behind the one or the other plane. Where they are overlapping it has turned black again, because there are 2 transparent layers. You can imagine that using small values will quickly give bad results for example on tree objects holding lots of leaves with transparency.

transparent 1

Gordon Brinkmann
  • 28,589
  • 1
  • 19
  • 49