Custom rendering
#6
If you are rendering objects with the same geometry (mesh), then it is recommended to use object instancing - this gives you by far the best performance. Also, you can simply set the transformation matrix into the InstanceData array. 

For the next version of DXEngine I have prepared a sample that shows animated instanced arrows - on my computer it can show 1 million (!!!) animated 3D arrows with almost 60 FPS (the most time is spent to calculate new world matrix for each arrow and each frame). The sample shows that with instancing it is possible to achieve incredible performance.

I am attaching the two files for the sample to this post. To test the sample, add the files to the DXEngine samples project into the DXEngine folder. The open the Samples.xml file on the root folder and add the following line (for example into line 14):

  <Sample Page="DXEngine/InstancedArrowsSample.xaml" Title="InstancedArrowsSample" IsNew="True" Description="" />



If you will not use instancing, you can still update Transform for each SceneNode before you call Render on DXScene (you said that you are not using DXViewportView and are calling Render manually). This should not be a serious performance problem. A bigger problem is to have 10k objects where each is defined by its own SceneNode - this requires 10k DirectX draw calls and this limit your performance because of required work on the CPU (again use DXEngineSnoop to see how much time is spent in DrawRenderTime).


Attached Files
.xaml   InstancedArrowsSample.xaml (Size: 4.73 KB / Downloads: 2)
.cs   InstancedArrowsSample.xaml.cs (Size: 22.82 KB / Downloads: 4)
Andrej Benedik
  


Messages In This Thread
Custom rendering - by Hamish - 02-27-2018, 02:22 AM
RE: Custom rendering - by abenedik - 02-27-2018, 10:20 AM
RE: Custom rendering - by Hamish - 02-27-2018, 10:26 AM
RE: Custom rendering - by abenedik - 02-27-2018, 11:00 AM
RE: Custom rendering - by Hamish - 02-27-2018, 12:19 PM
RE: Custom rendering - by abenedik - 02-28-2018, 11:04 AM
RE: Custom rendering - by Hamish - 03-01-2018, 04:22 AM
RE: Custom rendering - by Hamish - 03-01-2018, 05:56 AM
RE: Custom rendering - by abenedik - 03-01-2018, 10:05 AM
RE: Custom rendering - by Hamish - 03-01-2018, 10:38 AM
RE: Custom rendering - by abenedik - 03-01-2018, 10:21 PM
RE: Custom rendering - by Hamish - 03-01-2018, 11:37 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)