I suggest you ...

First-class Immediate Mode Graphics Support (Direct2D)

WPF's retained-mode graphics system is great for controls and is probably all you need if you are developing database forms applications. But there are classes of applications, particularly data-driven visualization apps, for which the overhead of retained mode makes it unusable. The current alternative of using WriteableBitmap is an okay workaround, but there are still many challenges, such as synchronizing your bitmap updates with WPF's rendering cycle. WPF v.next should be canning support for XP, so it can move to DX10 and so be on par with Direct2D/DirectWrite. WPF with first class support for immediate-mode graphics via D2D/DWrite will simply be unstoppable!

140 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Eric HillEric Hill shared this idea  ·   ·  Admin →

    7 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • d toppanid toppani commented  · 

        I too really want to integrate real-time visualization with WPF retained-mode. Direct2d is now available but is not directly part of WPF and only available on windows 7. The least would be a microsoft supported direct2d container control, without any air space restriction. It would be even better if one could choose retained or immediate mode for each control.

      • Eric HillEric Hill commented  · 

        @Ted - That's a great suggestion; in fact, we did just that a couple weeks ago and were quite happy with the memory savings. Our windows initially use InteropBitmap, but based on certain heuristics, we switch them over to WriteableBitmap (like if the user interacts with a window enough). This approach will allow us to have a shippable product, with the hope that for a later version of the product we will have a better solution.

      • Ted HuTed Hu commented  · 

        In the interim, instead of using WriteableBitmaps you use InteropBitmaps, your bitmap memory consumption will be halved, since InteropBitmap is single-buffered vs. WriteableBitmap’s double buffering. You may see tearing as a result, but that is the price of foregoing double-buffering”

      • Eric HillEric Hill commented  · 

        The WriteableBitmap workaround is beginning to fall of its own weight. WriteableBitmap uses massive amounts of memory for its two buffers apparently, and apparently there is no compression going on. So you get a couple hundred windows going using WriteableBitmap to simulate immediate-mode rendering and you start running out of memory. And 200 windows are not unheard of in our application because of scriptability. May have to drop back to HWND hosting . . . ack!

      • Eric HillEric Hill commented  · 

        @Pete - My application is statistical visualization, a.k.a., scientific visualization. Any visualization of large amounts of data that is not a summary cannot be done in retained mode. It consumes too much memory. Retained mode is great when you have a small number of objects (< 1000) that move around. Our product draws tens to hundreds of thousands of objects that sit still. We must have a graphics system that is O(1) in memory usage. Retained mode will always be O(n). We generate scatterplots with 100,000 plus points, and, with alpha blending, users can see where points are piling up on each other. I'll send you an e-mail with a link to our web site to preserve some semblance of anonymity.

      • Eric HillEric Hill commented  · 

        By the way, I am not suggesting replacing the current retained mode graphics. What I am looking for is some sort of control that I can put in a window that is expected to contain immediate-mode graphics, for which I get some soft of event when WPF is about to render it telling me to update its contents.

      Feedback and Knowledge Base