Helix Toolkit SharpDX not rendering PBR material displacement map

36 Views Asked by At

I'm a complete novice at 3D modelling who is trying to model a metal building with painted corrugated panel PBR texture for the walls and roof. I want to control the color using RGB values so I'm only providing the displacement and normal texture maps. It looks like the normal map is being rendered correctly but there is no depth to the texture so it seems like the displacement map is not being rendered. The wall panel should look like as shown in the rendered sphere.

Example Image

Here is my code for the material definition:

material = new PBRMaterial()
{
    AlbedoColor = panelColor,
    RenderEnvironmentMap = true,
    DisplacementMap = TextureModel.Create(VisUtil.GetEmbeddedResource("Panel-PBR-DISPLACEMENT8-4K.png")),
    NormalMap = TextureModel.Create(VisUtil.GetEmbeddedResource("Panel-PBR-NORMALS8_DIRECTX-4K.png")),
    EnableAutoTangent = true,
    RenderNormalMap = true,
    RenderDisplacementMap = true,
    MetallicFactor = sliderMetallic.Value, // Set to 1 if using RMA Map
    RoughnessFactor = sliderRough.Value, // Set to 1 if using RMA Map
    AmbientOcclusionFactor = sliderAmbientOcc.Value,
    ClearCoatStrength = sliderClearCoatS.Value,
    ClearCoatRoughness = sliderClearCoatR.Value,
};

It also seems like the color is very washed out compared to the rendered sphere. I am using two light sources, an ambient light source and a directional light source that is bound to the camera's look direction if that makes any difference.

<hx:Viewport3DX
    x:Name="view1"
    Title="{Binding Title}"
    Grid.Row="1"
    Background="Black"
    BackgroundColor="Black"
    Camera="{Binding Camera}"
    CoordinateSystemLabelForeground="#434343"
    EffectsManager="{Binding EffectsManager}"
    EnableDesignModeRendering="True"
    FXAALevel="Medium" 
    EnableSwapChainRendering="False"
    ModelUpDirection="{Binding UpDirection}"
    SubTitle="{Binding SubTitle}"
    TextBrush="White"
    ShowCameraInfo="True"
    ShowViewCube="True">
    
    <hx:AmbientLight3D Color="{Binding AmbientLightColor}" />
    <hx:DirectionalLight3D Color="White" Direction="{Binding Camera.LookDirection}" />
    <hx:GroupModel3D
        x:Name="model"
        ItemsSource="{Binding Model}"/>
    <hx:EnvironmentMap3D Texture="{Binding EnvironmentMap}" />

</hx:Viewport3DX>

Does anyone have any suggestions for what I'm doing wrong?

0

There are 0 best solutions below