AB4D Forum

Full Version: PhysicallyBasedMaterial with Transparency
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I try the demo of DxEngine for rendering PhysicallyBasedMaterial with Transparency.
But adding an opacity file doesn't affect to result.


Code:
shaderResourceView = Ab3d.DirectX.TextureLoader.LoadShaderResourceView(device, oneFileName);
var texture = new TextureMapInfo(textureType, shaderResourceView, null, oneFileName);
physicallyBasedMaterial.TextureMaps.Add(texture);

Thanks for your support.

[attachment=159]

[attachment=158]
To use transparent textures you only need to set the HasTransparency to true:
physicallyBasedMaterial.HasTransparency = true;

This will use the alpha blending.

In the next version of the Ab3d.DXEngine the LoadShaderResourceView method will be updated so it will also get the hasTransparency parameter based on the loaded image.
(04-14-2020, 10:14 AM)abenedik Wrote: [ -> ]To use transparent textures you only need to set the HasTransparency to true:
physicallyBasedMaterial.HasTransparency = true;

HasTransparency already is set to true.
This doesn't help
I understand now - you wanted to provide a texture that would represent transparency.

This is not supported by the PBR shader in DXEngine.
If you check the description of the Transparency value in the TextureMapTypes enum, you will see that it is written as: "Transparency (not supported)". It is there if you would use that enum for your own shader.

So to use the transparency in the PBR, you will need to bake it into the base color texture's alpha channel (and also have the HasTransparency set to true).
Great!
Thank you!