Skip to content

Getting started with WPF and SharpDX

Huajiang Wei edited this page Mar 15, 2023 · 14 revisions

Tutorial

  1. Creating the 3D Viewport in XAML
  2. Adding contents into Viewport

Project Solution

Main solution file: HelixToolkit.SharpDX.sln.

Project Build

Requirement:

Windows 10. Or Windows 7 with Windows Development Kit 10 (needs d3dcompiler_47.dll from the kit)

For Windows 7. Depends on your program build with X86/X64/AnyCPU, add C:\Program Files (x86)\Windows Kits\10\Redist\D3D\x64 or C:\Program Files (x86)\Windows Kits\10\Redist\D3D\x86 into the system environment path. Or copy corresponding d3dcompiler_47.dll into your program bin folder.

For Windows 7, your program may fail to run due to lack of update KB2670838 (https://www.catalog.update.microsoft.com/Search.aspx?q=KB2670838)

Build:

Open HelixToolkit.SharpDX.sln with Visual Studio 2019.

Build Solution using Visual Studio.

Laptops with Nvidia Optimus (Dual graphics card)

Auto adapter selection in EffectsManager does not guarantee to use external Nvidia graphic card for rendering. To make sure using the Nvidia graphic card, add static NVOptimusEnabler nvEnabler = new NVOptimusEnabler(); in MainWindow.xaml.cs.

Graphics Debugging

Using RenderDoc for SharpDX render profiling

To use RenderDoc, following settings must be set on Viewport3DX.

EnableSwapChainRendering = true;
EnableD2DRendering = false;
Clone this wiki locally