Fix T80684: Node shader wrapper: Tweak handling of alpha textures.

There is no ideal solution here, but we can assume by default that we should
use the Alpha output from a texture used for transparency data.

This will break people using a dedicated B&W texture for this alpha
pass, but we cannot really handle all cases properly in this wrapper, we
only try to support the most common ones to some extent.
This commit is contained in:
Bastien Montagne 2020-09-16 16:36:33 +02:00
parent 1a4fc6dcd6
commit 0696eaa3e8
Notes: blender-bot 2023-02-14 18:48:57 +01:00
Referenced by issue blender/blender-addons#83749, Obj Material transparencies not automatically connected correctly when using jpeg
Referenced by issue blender/blender-addons#83749, Obj Material transparencies not automatically connected correctly when using jpeg
Referenced by issue blender/blender-addons#80684, obj file import automatically connects the colour output of all png's into the principled's alpha input, needs to be the alpha output.
1 changed files with 1 additions and 0 deletions

View File

@ -486,6 +486,7 @@ class PrincipledBSDFWrapper(ShaderWrapper):
return ShaderImageTextureWrapper(
self, self.node_principled_bsdf,
self.node_principled_bsdf.inputs["Alpha"],
use_alpha=True,
grid_row_diff=-1,
colorspace_name='Non-Color',
)