Ab3d.DXEngine and 2D (Viewport2DVisual3D)
I have a WPF application that makes extensive use of Viewport2DVisual3D (renders 2D elements within 3D viewport). Themes are heavily customised as well. Basically, most of the content is 2D, but the 3D viewport is used to create the look of an angled panel.

Is Viewport2DVisual3D supported by Ab3d.DXEngine? What performance gain/loss could I expect?
Found this in the history for Version 2.2:
  • Added basic support for rendering 3D object defined with Viewport2DVisual3D - note that because Viewport3D is not visible (from WPF's perspective), the Viewport2DVisual3D is not interactive.
That doesn't tell me an awful lot, though. I guess it's supported to some extent. Not sure why it wouldn't be interactive.
Viewport2DVisual3D is only partially supported in DXEngine. This means that DXEngine can render its content but does not support interaction. The problem is that for the interaction to work the Viewport2DVisual3D needs to be shown on a Viewport3D that is visible in the WPF visuals tree (when Viewport3D is rendered with DXViewportView, it is not visible).

I have checked the source code of Viewport2DVisual3D object to see if there is another way to enable interaction with somehow passing mouse data to the object but there seems to be no way around this.

A similar limitation exists for UIElement3D objects. There it is also not possible to get mouse events from the object.

Therefore, if you need interactive Viewport2DVisual3D, you will need to use WPF 3D rendering (Viewport3D without DXViewportView). 

To show 2D WPF controls in DXEngine, it is possible to use VisualBrush for a material. But you will need to manually update the material when the 2D controls are changed. See the "VisualBrush Test" sample that comes with DXEngine for more information.
Andrej Benedik
Thank you for the response, Andrej. I downloaded and built your samples. It was on a rather old laptop so GPU performance isn't that great. The 3D performance gains were quite impressive, though. Other tests (like the VisualBrush) shows little perceivable difference from the standard WPF rendering engine.

What I really need to do is some testing specifically with my app. Hopefully I'll be able to do this soon.

Forum Jump:

Users browsing this thread:
1 Guest(s)