3
$\begingroup$

I have done this before, but that was before the principled BSDF shader existed. Now I'm trying to do a similar node setup with the principled BSDF shader instead of the diffuse BSDF shader, but the result is not 100% perfect! The background of the mesh with the transparent decal image, differ slightly compared to the surrounding mesh. I want the background around the decal to be fully transparent and look just like the nearby meshes.

The principled BSDF shader to the left in the image below has the green color for that background and that is the green color I also use on the rest of the object with the same settings.

Is there a better way to achieve this with a better node setup or just adjust my node setup in some way? I have tried to adjust the value of the mix shader, but without any improvement.

enter image description here

$\endgroup$
3
  • $\begingroup$ I'm not totally sure I understand your question, but the alpha channel of your image is important. The "background" of your decal should not be showing at all because the alpha should be 100% transparent for every background pixel of your decal. $\endgroup$
    – risingfall
    Jan 23, 2018 at 22:56
  • $\begingroup$ @risingfall Thanks for your comment! I want to display a png image with a symbol on a transparent background on a mesh that has a green background material like the surrounding mesh. I just want to see the symbol on the green background. I hope you understand my question better now. Any ideas how I can solve this problem? $\endgroup$
    – 3D-kreativ
    Jan 23, 2018 at 23:08
  • $\begingroup$ My question is, your PNG image - are you sure the alpha channel is correct, i.e., are you sure it is completely transparent in the places it should be transparent? $\endgroup$
    – risingfall
    Jan 24, 2018 at 0:25

2 Answers 2

4
$\begingroup$

I find this questions easier to understand if you don't think in terms of transparency and think in terms of Masks to control how elements mix.

Using the Alpha channel in a mix node will make White areas use one element, and Black areas use the other. Any shade of gray will be a partial mix according to its brightness.

enter image description here

What that means is that the alpha channel of a given image can be used as a Mask to control the mix of color or the mix of shaders.

When you use one or the other is something you have to decide.

  • If you want to use the color information of the image over the color of a given shader, in a way that all other properties of the shader are homogeneous, then use a color mix node and have the mask be the factor for the color of the shader.

enter image description here

(click on the image to enlarge)

  • Or you can use the mask to control the mix between two different shaders. Note that doing this will make the masked areas have different characteristics.

enter image description here

(click on the image to enlarge)

  • Lastly if what you really want is the mask to control the transparency of the object, then use the alpha information as the factor that controls the mix of a transparent and other kind of shader.

enter image description here

(click on the image to enlarge)

$\endgroup$
3
$\begingroup$

My node setup

Result

Here's an example of what I think you're looking for...

$\endgroup$

You must log in to answer this question.

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