1

How do I get the Principled BSDF shader to display the base color alpha as transparency or without using nodes?

Most of the questions seek to interpret the alpha channel of an image texture as transparent, but my context is simpler: the Base Color of the Material has 0.3 alpha.

Yet, the object is not transparent in either the editor, the render (cycles or evee), but it is actually exported in collada.

Without success, I have tried:

  • Setting the base color alpha -> does carry out to a collada export, but is not transparent in the editor
  • Changing the Blend Mode -> does not carry out to a collada export
  • Changing the viewport display -> only displays as transparent in solid mode

Using nodes I've tried

  • Setting the transmission value -> doesn't do anything
  • Changing to Glossy or Glass -> doesn't carry out to collada

I think that's all I tried. I did get it to work in the render, but I do need it to carry out to a collada export.

Material without nodes

The transparency of the base color is ignored in the rendering and the editor. Is there a way to display it in the render or the editor like Blender displays the viewport display alpha?

quimnuss
  • 113
  • 1
  • 4
  • https://blender.stackexchange.com/questions/57531/fbx-export-why-there-are-no-materials-or-textures/ – Duarte Farrajota Ramos May 15 '19 at 11:03
  • How did you get it to work in the render if "the object is not transparent in ... the render (cycles or evee)"? The way which should work is setting color value to mix shaders (or plugging there texture consisting of solid color). Alpha channel in base color of Principled shader will work for this only if you set it to use Transimission. The reason it doesn't work outside of Blender might not be related to Blender at all. It should work in Blender though – Mr Zak May 15 '19 at 11:26
  • @DuarteFarrajotaRamos There is no texture. Is the referenced question rellevant? – quimnuss May 15 '19 at 13:07
  • @MrZak The glossy or glass do make the object transparent, that's what I meant by "work". The "mix shader" way to do it is the method used to make a color in a texture transparent, correct? you assign a color from the texture to transparency and then mix the nodes in a mix shader. But I intuitively think there might be a simpler way if the whole object material is a single RGBA value. The shader using the alpha channel? Ideally I'm not even using nodes. Collada, OBJ, they both have a parameter to represent a transparent material, at the moment I just add the value manually after exporting. – quimnuss May 15 '19 at 13:09
  • But feel free to post an answer if a mix shader is the way to do it! – quimnuss May 15 '19 at 13:14
  • You mention exporting to Collada, so what is the point of tweaking all this in Blender if non of it can be exported? – Duarte Farrajota Ramos May 15 '19 at 14:57
  • Exactly my point. I'm asking how do I have to set the material so that transparency is correctly written in the collada file as well as displayed in the editor/render as transparent. – quimnuss May 15 '19 at 15:26
  • At the moment blender exports the transparency value of the rgba base color and is displayed as transparent (in, e.g., sketchup) but blender doesn't display it as transparent in either the render nor the editor. – quimnuss May 15 '19 at 16:03
  • @DuarteFarrajotaRamos is correct. Whatever materials you use are not going to translate to other formats. The way to create a transparent material so that it can be used in other platforms would be to bake the material. In this case most likely it would be some kind of image mapping that could be assigned to the alpha channel in the target application. There is no "universal language" of shaders and materials, all application implement them in a different way. Related: https://blender.stackexchange.com/questions/52382/can-i-bake-glass-bsdf –  May 15 '19 at 16:23
  • That is not true. The RGBA material is being translated to collada and works outside of blender just fine. It's blender that doesn't render its base color RGBA as transparent. I understand the problematic with shaders and it's lack of universality, but here I'm talking of an object with a single RGBA color. I understand that the render will differ because is up to the shader to decide how to render the alpha, I'm fine with it, as long as it is transparent. What I gather from the comments is that blender doesn't use the alpha in its base color and there's no way to use it. Odd to me. – quimnuss May 15 '19 at 16:33
  • Note that what I'm looking for is the same that Blender already does with the Viewport Display RGBA color when using the Solid display mode. Or how the material looks if I change the blend mode to Additive. That's what I'm doing right now to know which materials are the transparent ones. – quimnuss May 15 '19 at 16:38

1 Answers1

0

Base color value can be used as a driver of transparency. It is depending on shader if it can read and interpret that information. Principled shader is one which can. Diffuse shader won't be able to do it without mixing it with Transparent shader and driving Mix shader factor.

If you open color picker of Principled BSDF and set its alpha to 0 and color to white you will get only white material because shader renders it as basic diffuse surface by default.

If you set Transmission value of the shader to 1 allowing it to happen shader will use alpha channel and will make your material as allowing light to come through it.

However at this point it will refract light because by default shader's IOR value is set to 1.45 (common case of usage for interface between air and glass). Set that to 1.00 so no refraction happens and light comes straight.

enter image description here

Roughness value can be also taken down to 0 so it doesn't try to create rough surface. Object will still cast shadow of course; you will need to add more complex node setup or to disable shadow in material setitngs.

R El Clein
  • 1,646
  • 7
  • 5
  • This sounds like the behaviour I was expecting! The cube now shows transparent with Cycles, opaque with the background color with Eevee, and it reflects a bamboo garden image (¿??) on the editor in Solid. What? I'm using 2.8. I think this is the answer. Eevee doesn't support it and the editor won't display it on solid. There's no way to show it on in the editor as Solid? – quimnuss May 16 '19 at 14:40
  • @quimnuss Solid mode in both 2.79 and 2.8 in Cycles and Eevee is supposed to show texture if enabled. Solid mode won't show properties of material except for basic settings which are changed separately. This answer was mainly written to address certain comments above - Blender can take into account alpha channel in the base color value of shader; it only depends which engine is used to render it. I still don't see a reason to preview namely pure shader result in Solid shading without using texture – R El Clein May 17 '19 at 13:35