I'm having trouble with tearing and flickering in WPF animations. I have a toy app that demonstrates the problems. The app animates squares across the screen. The edges of the squares show tearing and the animation as a whole does not feel smooth.
Perforator shows >60fps, ~10mb video memory, 0 IRTs.
I have tried this on two new high end computers and both show the same poor animation (>1gb vram, quad core etc).
SimpleWindow.zip
Are you absolutely sure your Code is running hardware accelerated? Please look into this list : http://blogs.msdn.com/b/jgoldb/archive/2010/06/22/software-rendering-usage-in-wpf.aspx.
If so - given that ubercool hardware you got - you could try running it on CPU instead of GPU. You can enforce that by setting the RenderMode to SoftwareOnly (Item 6 in the list linked to above)
I raised this question with WPF team and in summary they said that they believe that there are some glitches with animation smoothness that could be improved.
They also added:
We try very hard to schedule our scene updates in sync with the VBlank to get very regular, reliable animations. Any work on the UI thread can interfere tough. In this example, they are using DispatcherTimers which schedule work onto the UI thread to create new storyboards, remove old elements, etc.
They also demonstrated a purely declarative version of the animations, and it appeared smoother to me. Special thanks to Dwayne Need for this information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With