none
Poor performance using ModelVisualBase and Viewport3D

    Question

  • I'm new to 3D and also new to WPF and not sure if I’m going down the correct path…

    I have created a 3D app to display a technical drawing which can be made up of 1000s of items. I have a classes inherited from ModelVisualBase to create the shapes needed. These are then added to a viewport3D control. The problem I have been facing is the number of items that I have to generate and add to the viewport3D can seriously degrade the performance and on some drawings it will run out of memory before it even displays. Also if I have managed to display a drawing I have controls for the user to move/navigate around the image which on a large drawing is painfully slow.

    I have used, looked at and played around with lots of examples on creating individual 3D items such a cubes, cylinders etc and the all work great so does my app on a drawing that contains relatively small amount of items but as soon as I increase the number of items in the example apps and my app it just dies. Dose anyone have any ideas that I can try to implement to improve performance or guide me on a different approach.

    If more info is required then please ask as at the moment I’m not sure if its just a general problem with what I’m using rather than the actual code.

    Thanks in advance, 

    Richard.

    Monday, September 07, 2009 4:13 PM

All replies

  • What machine (GPU and drivers, OS, DirectX, etc.) are you on?

    WPF "3D engine" tries to dispatch 3D rendering to the GPU but on failing to do so, uses the CPU for rendering. This is what usually causes this kind of behavior.

    Having said that WPF, although providing 3D features, is meant to deal with a small quantity of big controls. I'd say "1000s of items" is pushing it a little bit.
    Bigsby, Lisboa, Portugal - O que for, quando for, é que será o que é... http://bigsby.eu
    Monday, September 07, 2009 5:47 PM
  • The machines are all different and a mixture of Vista and XP. I have checked the rendering tier on a selection of machines and they all are using tier 2 so as far as I'm aware they are using the GPU. My machine has DirectX 10 and Vista sp1.

    I thought that WPF was a layer above DirectX, does anyone know if I used the DirectX API instead of WPF would this have a performance enhancement? Bit concerned about the time to convert the project to this approach and then finding out it is the same.

    Tuesday, September 08, 2009 7:50 AM