0

Light problem in Helix Sharp DX

Amit Pathak 8 years ago updated 8 years ago 1

Hello,

I am trying to build an obj file viewer using Helix Toolkit with SharpDX. So far I am able to load an object file and render it's contents to Helix Viewport3DX. Model looks good with some obj files but for others there are some lightning problem and back surfaces are always black. I am not sure what am I doing wrong. Is this light problem due to the fact that SharpDX does not support back materials??


Problem using Helix Sharp DX:

Image 21


Original model looks like this in Adobe DC Reader:

Image 22


Viewport3DX settings are:


<Window.Resources>

<DataTemplate x:Key="Template1">
<hx:MyMeshGeometryModel3D Geometry="{Binding Geometry}" Transform="{Binding Transform}" Material="{Binding Material}"/>
</DataTemplate>
<hx:RenderTechniqueConverter x:Key="RenderTechniqueConverter"/></Window.Resources>

<hx:Viewport3DX x:Name="helixViewport"

Camera="{Binding Camera}" CameraRotationMode="Trackball"
RenderTechnique="{Binding RenderTechnique}"
RenderTechniquesManager="{Binding RenderTechniquesManager}"
EffectsManager="{Binding EffectsManager}"
BackgroundColor="{Binding BackgroundColor}"
UseDefaultGestures="False">
<hx:Viewport3DX.InputBindings>
<MouseBinding Gesture="LeftClick" Command="hx:ViewportCommands.Rotate"/>
<MouseBinding Gesture="MiddleClick" Command="hx:ViewportCommands.Zoom"/>
<MouseBinding Gesture="RightClick" Command="hx:ViewportCommands.Pan"/>
</hx:Viewport3DX.InputBindings>
<hx:AmbientLight3D Color="{Binding AmbientLightColor}"/>
<hx:DirectionalLight3D Color="{Binding DirectionalLightColor1}" Direction="-1,-1,-1"/>
<hx:DirectionalLight3D Color="{Binding DirectionalLightColor2}" Direction="1,-1,-0.1"/>
<hx:DirectionalLight3D Color="{Binding DirectionalLightColor3}" Direction="0.1,1,-1"/>
<hx:DirectionalLight3D Color="{Binding DirectionalLightColor4}" Direction="0.1,0.1,1"/>
<hx:ItemsModel3D x:Name="itemsModel3d" ItemTemplate="{StaticResource Template1}" ItemsSource="{Binding Items}/">
</hx:Viewport3DX>
-1

I am still stuck with the same problem? Any suggestions, what am I doing wrong? Thanks.