3

To my disappointment I found out that one of the applications I'm working on renders rather poorly on certain computers. The UI static graphics and text suffer from a severe case of tearing without doing any kind of animations. This makes text unreadable and of course, the graphics look poor.

I've noticed this problem on different computers but the one that really made me think was a newer Toshiba laptop with a Radeon Mobility video card: when this laptop runs on battery, there is no tearing - but when it runs plugged-in everything is a mess. So this looks like a problem with power line noise which apparently affects the video card - I'm guessing hardware accelerated graphics. However, non-WPF graphics render fine so how do you tell users: "It's not my app, it's your power supply!" ?!

Have you ever run into this? And is there anyway to fix it?

The app is .NET 4.0, and the laptop was running Windows 7.

2
  • Video drivers are notoriously problematic once you start using hardware accelerated graphics; this is a major problem that game engine developers face when it comes to getting compatibility on a wide range of hardware. Failing a driver update, you can try disabling hardware accelerated graphics: msdn.microsoft.com/en-us/library/…
    – Dan Bryant
    Oct 5, 2010 at 15:55
  • 1
    On a side note, I doubt this is power line noise; most likely the system simply turns off hardware acceleration when running on battery to save power.
    – Dan Bryant
    Oct 5, 2010 at 15:56

3 Answers 3

2

I've run into this same thing on my Acer laptop. It was actually a driver issue with the screen driver, and a vendor update completely solved the problem.

I would recommend contacting Toshiba directly regarding this problem. Point them to some public, easy to find WPF application that demonstrates the issue.

In the meantime, the only "solution" I know of is to have WPF disable hardware acceleration entirely. This post describes how to force software rendering for all WPF applications, which should correct the tearing (at the cost of dramatically reduced rendering perf.).

2

The issues are normally caused by drivers for ATI video cards. NVidia cards (while they have their own issues) generally don't display these problems.

The easiest way to fix it is to disable hardware rendering. This can cause performance issues, but often won't make a noticeable difference and can sometimes even improve performance. You'll need to test it for your own app to see. To set from a Window's code:

(PresentationSource.FromVisual(this) as HwndSource).CompositionTarget.RenderMode = RenderMode.SoftwareOnly;
1

As Reed said, this is quite possibly a driver issue. However, I've seen this before on some cards with up-to-date drivers, so it's not always a fixable problem, depending on your hardware. If this is a graphics problem caused by a particular graphics card, you might be able to try this workaround...

In regedit, you can create or edit the following DWORD value to "1" to force software rendering of all WPF applications:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DisableHWAcceleration

I've found in the past that on low-end machines (netbooks and integrated-graphics machines) this can often noiceable improve the performance of WPF apps, because it reduces memory contention between the GPU and CPU.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.