Debugging

1) Make sure that you have DirectX debug layer enabled. The debug layer is installed or enabled when you install Visual Studio. If it is not yet installed or enabled, then it can be installed with Windows SDK for Windows prior to Windows 10. On Windows 10, debug layer is installed with adding \"Graphics Tools\" system feature: Settings panel -> System -> Apps & features -> Manage optional Features -> Add a feature -> Select "Graphics Tools".

2) Change reference from release Ab3d.DXEngine.dll and Ab3d.DXEngine.Wpf.dll to debug versions of assemblies

3) Set PresentationType property to DirectXOverlay on DXSceneView (this will allow using graphics debugging tools)

4) Set IsDebugMode property to true on DXSceneView

5) Copy file "NLog.config" from sample project to root folder of your project and set its build action to Content and use "Copy if newer" for Copy to output directory value. Open the NLog.config file. You can change the location of the log file with changing the value of fileName in the target element. To enable logging, you need to change the minlevel attribute any logger element (near the end of the file) from "Off" to any other log level - for example to "Trace" to get the most detailed log file. If you will enable "fastDetailedFile" logger, you will have less performance impact but if your application will crash, some of the log files could be lost (the application could crash before the log entries are written to the file). When "reliableDetailedFile" is used, logging will slow down the application significantly, but in case of a crash, all the log files should be written to disk.

6) Use debug shaders (allows debugging shaders). Add the following before DXSceneView is created:

Assembly shadersAssembly = Assembly.Load("Ab3d.DirectX.Shaders.Debug"); // reference to Ab3d.DirectX.Shaders.Debug must be added
Ab3d.DirectX.EffectsManager.RegisterShaderResource(new AssemblyShaderResources(shadersAssembly, "Ab3d.DirectX.Shaders.Debug"));