Click or drag to resize
AB4D logo

DXViewPresentationType Property

Gets or sets an enum that specifies how the 3D scene is presented to the WPF rendering engine. Default value is DirectXImage.

Namespace: Ab3d.DirectX.Controls
Assembly: Ab3d.DXEngine.Wpf (in Ab3d.DXEngine.Wpf.dll) Version: 7.0.8865.1045
Syntax
C#
public DXViewPresentationTypes PresentationType { get; set; }

Property Value

DXViewPresentationTypes
Remarks

PresentationType gets or sets an enum of type DXViewPresentationTypes that specifies how the DirectX 3D scene is presented to the WPF layout engine.

The possible values for PresentationType are:

DirectXImage:
3D scene is rendered with DirectX 11 and than "sent" as shared resource to WPF rendering engine (to D3DImage) that combines the 3D scene with other WPF objects. DirectXImage allows WPF objects to be drawn on top of DXView. DirectXImage renders the scene directly to the back buffer. A disadvantage of this mode is that DXEngine needs to wait until the graphics card fully finishes rendering the 3D scene before the image can be sent to WPF. When rendering a very complex scene (and with lots of 3D lines that require geometry shader) this can be significantly slower then using DirectXOverlay that does not wait for GPU to complete the rendering. This mode does not work correctly with graphics debugging tools (see below).

DirectXOverlay:
3D scene is rendered with DirectX 11 and shown on top of any WPF objects with using HwndHost. Because in this mode the DirectX has its own part of the screen (defined by a HwndHost), the graphics card can continue to render in the background after the DXEngine has sent all the scene data to the graphics card (executed all draw calls and then calls Present DirectX method). When the graphics card completes rendering the scene, it can show it it the specified part of the screen. This means that when rendering very complex 3D scenes this mode can be significantly faster because DXEngine does not need to wait until the scene is completely rendered - DXEngine engine can continue execution after it passes all the data to GPU (calling Present method). A disadvantage of DirectXOverlay is that it does not allow WPF objects to be drawn on top or below of DXView (the 3D image cannot be composed with other WPF objects). DirectXOverlay also allows using graphics debugging tools (see below).

When using graphics debugging tools like Visual Studio Graphics Debugger, NSight or similar, the DirectXOverlay mode must be used. This mode uses SwapChain and Present method. Using Present method on SwapChain is required by the the graphics tools to determine when the frame was rendered.

By default the DirectXImage is used.

Note that when using WPF 3D rendering, than PresentationType does not have any effect because the 3D Scene will be rendered with WPF's Viewport3D which also allow other WPF objects to be drawin on top of 3D Scene.

PresentationType also does not have any effect in design time because DXView is using WPF 3D to show the 3D Scene there.

See Also