04-05-2020, 08:40 PM
Maximum number of items?
04-06-2020, 04:21 PM
Your question is way to generic to be able to answer it. There is no number that represents the amount of items that can be rendered.
You should investigate the memory usage to see why you got the Out of memory exception. Maybe you were using x86 process and are limited to 2 GB per app. Or you tried to render to many TextBlockVisual3D objects where each TextBlockVisual3D would create its own RenderTargetBitmap and this would eat up all the memory. From your screenshot, it is hard to say what happened. Please provide more information about what you were trying to render.
Anyway, performance-wise, if you want to render a much more complicated 3D scene with many 3D objects, then you should add Ab3d.DXEngine to your application. When you are using only Ab3d.PowerToys, then you are using WPF 3D rendering this is fine for simpler 3D scenes, but cannot render a complex 3D scene. With adding the Ab3d.DXEngine your scene will be rendered with a much faster DirectX 11 rendering engine.
04-06-2020, 06:02 PM
Ok thanks for the tips, The code does this a few thousand times (can be up to 60 000 times) :
_eventManager3D.RegisterEventSource3D(visualEventSource3D) // for each boxVisual3D
I will try without the textboxes.
Excuse my ignorance, are there any code changes needed to switch to using Ab3d.DXEngine ?
I don't feel like re-writing a year's worth of code!
04-08-2020, 10:25 AM
Ab3d.DXEngine is designed in such a way that you can preserve the existing code that you used for Ab3d.PowerToys and WPF 3D rendering.
You can try it with just a few simple changes. See https://www.ab4d.com/DirectX/3D/QuickStart.aspx
Also, if you have so many objects, do not use EventsManager3D and register each one of them. Instead use standard WPF 3D hit testing (see "EventManager3D / Standard WPF hit testing" sample in the standard Ab3d.PowerToys samples project).
When using Ab3d.DXEngine you can use the hit testing that is build into Ab3d.DXEngine - it is much faster than the one in WPF 3D - see samples in the "Ab3d.DXEngine hit testing" section in the Ab3d.DXEngine samples project.
|Users browsing this thread:|
Powered by: MyBB (NetPen theme by Mishar DESIGN)