08-06-2019, 09:57 AM
You are right, the DXEngine automatically calculates the near and far plane distances so that they are as close together as possible. This increases the depth resolution and minimizes the z-fighting artifacts. Anyway, if you want to manually control the near and far plane values, you need to set the OptimizeNearAndFarCameraPlanes to false (this is a property on th DXScene object).
If you are using DXViewportView, then you can get the DXScene from its DXScene property. The property is set when the DirectX device is initialized - you can subscribe DXSceneDeviceCreated event to be notified when this happens:
If you are using DXViewportView, then you can get the DXScene from its DXScene property. The property is set when the DirectX device is initialized - you can subscribe DXSceneDeviceCreated event to be notified when this happens:
Code:
_dxViewportView.DXSceneDeviceCreated += delegate(object sender, EventArgs args)
{
if (_dxViewportView.DXScene != null) // Can be null in WPF 3D rendering (used as fallback by default)
_dxViewportView.DXScene.OptimizeNearAndFarCameraPlanes = false;
};
Andrej Benedik

