02-17-2020, 03:54 PM
I have problems getting shadows to work together with physically based rendering.
When a physically based material is set on an object in a scene that uses variance shadow rendering the whole object in rendered as if it were in shadow, even if it is not. See attached pictures which illustrates the problem.
[attachment=146]
[attachment=147]
The problem can be reproduced by setting a PBR material in method "CreateCustomScene()" in the file "ShadowRenderingSample.xaml.cs" that is part of the "Ab3d.DXEngine.Wpf.Samples" project:
Am I missing something here to get shadows and PBR materials to work together (they do work fine on their own), or is this a bug?
I also did a quick test with planar shadows, where I used a PBR material on the shadow plane, but I did not get that to work either. However, in that case the shadow plane seemed to not be rendered at all, instead of beeing rendered in complete shadow.
When a physically based material is set on an object in a scene that uses variance shadow rendering the whole object in rendered as if it were in shadow, even if it is not. See attached pictures which illustrates the problem.
[attachment=146]
[attachment=147]
The problem can be reproduced by setting a PBR material in method "CreateCustomScene()" in the file "ShadowRenderingSample.xaml.cs" that is part of the "Ab3d.DXEngine.Wpf.Samples" project:
Code:
var physicallyBasedMaterial = new PhysicallyBasedMaterial();
physicallyBasedMaterial.BaseColor = Color4.White;
physicallyBasedMaterial.Roughness = 0.0f;
physicallyBasedMaterial.Metalness = 0.0f;
var wpfMaterial = new DiffuseMaterial(Brushes.White);
wpfMaterial.SetUsedDXMaterial(physicallyBasedMaterial);
var grayCylinder = new CylinderVisual3D();
grayCylinder.BottomCenterPosition = new Point3D(200, 0, 100);
grayCylinder.Radius = 20;
grayCylinder.Height = 100;
grayCylinder.Material = wpfMaterial;// new DiffuseMaterial(Brushes.LightGray);
Am I missing something here to get shadows and PBR materials to work together (they do work fine on their own), or is this a bug?
I also did a quick test with planar shadows, where I used a PBR material on the shadow plane, but I did not get that to work either. However, in that case the shadow plane seemed to not be rendered at all, instead of beeing rendered in complete shadow.