OpenSAGE.BlenderPlugin
OpenSAGE.BlenderPlugin copied to clipboard
Importing textures with alpha
This is a very small issue. While Feliwir was explaining to me his attempt to add alpha it seemed like he missed the Blend Mode setting which I have circled in the screenshot.
Here is an example of the shader material nodes and settings that I use to display alpha in Blender. The default render engine in Blender 2.8 is Eeevee and this setting is only available for Eevee.
I recommend using either the Alpha Clip or Alpha Blend setting.
Should be fixed with 07186b80f99ef9ad6fb84264f8152071a5dcea39
Can not set the blend mode for all materials equal, since this causes issues with materials and textures without alpha. Need to track down a material/shader property that is responsible for this.

This is the node setup how we need to do it
blend mode is now set to alpha mode per default, but havent figured yet out how to set the alpha value from the texture properly, or use the texture as a alpha mask.
Setting the Alpha texture of the PrincipledBSDFWrapper does not really solve the problem, since then we have the same texture node twice in the shader instead of connecting the Alpha value of the first texture directly.
For reference: https://github.com/sobotka/blender/blob/master/release/scripts/modules/bpy_extras/node_shader_utils.py
this could work if we could extract the 'alpha mask' from a texture
this might be the corresponding shader value (Is Zero for other materials)