views:

22

answers:

0

I have a simple scene with 64 ModelUIElement3D elements, every element3d Model is a model group with 8 simple geometries, every geometry contains 3 materials, diffuse, specular and emissive.

All materials use Solid Brushes since are the fastest.

The geometries, specular material and diffuse material are Freeze to improve performance.

The only thing not freeze are the emissive materials which I’ll be updating the brush with solid brushes periodically.

When I run the application and change the brush for only one emissive material from the 1536 materials in the screen (64*8*3) the performance goes down really really bad, and the FPS go down from 60 to 15FPS.

Even I have the solid brushes in a dictionary so they are cached and created once.

This change in the brush is to make the material “blink” (really it is a fast fade-in/fade-out) in the screen. The brush change in the emissive material is every 20ms.

I see changing the brush for one material or 500 materials doesn’t make any the difference in the performance.

I comment the line where I update the brush and I get a consistent 60FPS, when I uncomment the line the FPS goes down to +/-15FPS, tried 3 different machines, 4 cores/2 Cores, very good graphic cards or medium, almost doesn't make a difference, always between 15-25 FPS.

I’m using “Performance Profiling Tool for Windows Presentation Foundation” to measure the performance, and HW IRTs per frame doesn’t go above 1 at any moment. I see when I check the checkbox “dirty-region update” that the whole scene is render every 20ms just changing the brush for one small material.

I read that WPF viewport3d doesn’t support dirty region, so I’m assuming that the whole scene is render for a minimum change.

If that is the case, is there something I can do to improve that? Since I need to create an static scene with several thousand UIElements and 10 thousands materials, but the changes are going to be so minimal so I was expecting a good performance.

If the WHOLE scene is rendered every time without chance to do anything then it is useless think on WPF to create dynamic content and I have to go for another much more complex approach as DirectX.

Please any hint how to make this work is appreciated, since I can't believe it is not possible with WPF and is some mistake on my part.

Basically I need a big scene with minimal changes, those changes happen frequently in the order of 5 to 20ms and still get the 60FPS since there are few triangles material that really change.

Thanks,

Gustavo.