PhysicallyBasedMaterial with Transparency
#1
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.

   

   
#2
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.
Andrej Benedik
#3
(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
#4
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).
Andrej Benedik
#5
Great!
Thank you!
  


Forum Jump:


Users browsing this thread:
1 Guest(s)