Patrick Klug
Patrick Klug

Reputation: 14391

Wpf Animation performance drops suddenly

I have a simple fade in animation on a large Rectangle inside a ScrollViewer and I notice a significant drop in performance when I increase my windows size past a certain size.

  1. resolution: 1650x1256 - still feels snappy and fluent (framerate between 50 and 60)
  2. resolution: 1820x1256 - stutters and is pretty much unusable (framerate between 7 and 15)

What surprises me is that there doesn't seem to be a linear decline in performance but a rather sudden drop.

Also using Wpf Performance Tool does NOT show any software rendering and indeed my CPU doesn't seem to be doing much when the animation runs.

I would like to understand the cause of this, any hints would be appreciated.

Upvotes: 0

Views: 749

Answers (2)

Ray Burns
Ray Burns

Reputation: 62919

Another possibility is that you are running out of dedicated video memory at that resolution, so DirectX is transferring a lot of data back and forth between video memory and main system memory on every frame.

Is there any way you can try a different graphics card, or one with more RAM, to see if the problem changes?

Also, does your GPU have a way to configure how much system RAM is reserved as video memory? Some do.

Upvotes: 3

Ray Burns
Ray Burns

Reputation: 62919

My guess is that you are running out of GPU memory at that point, so DirectX is dropping back to software rendering.

When you say a "viewport", do you mean a ViewPort3D, or do you mean a Viewbox? If it is a Viewport3D, is the animation really needing the 3D processing? If not, you could use 2D and use a transform to simulate 3D the way Flash applications have to do.

Upvotes: 1

Related Questions