Achieving high performance 2D graphics with Direct2D

Download this episode

Download Video


Make it fast! Great performance is a huge motivator of satisfaction and user preference with apps. Direct 2D powers high-performance 2D graphics rendering in Windows 8. In this session, you will learn advanced techniques for optimizing your Direct2D code for maximum speed and efficiency in your apps.









Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • User profile image

      We are finding that the documentation for Direct2D is not sufficiently enough to develop complex graphics intensive applications. This is a good start but we need significantly more to enable us to be quickly productive as developers with Direct2D. 

      The application we are attempting to develop is for GIS - so we are basically pushing very large amounts of complex holed polygons (potentially thousands of points with thousands of polygons), polylines, texts and symbols. We are finding the performance of polygon rendering and the outlines to be insufficient with Windows 7.

      We suspect that the use case scenarios for Direct2D do not  consider this type of complex application (at least on Windows 7).

      We are achieving with OpenGL between 30 to 60 frames faster than Direct2D with the same architecture and geometry input. I do however need to review the performance tips in this video and apply these. Hopefully I will see a speed up.

      I hope that by knowing what we are attempting to achieve then you will consider this in performance testing/improvements.

    • User profile image

      @damiandixon: If you're doing complex 3D geometry you probably shouldn't be using Direct2D to do it. Direct3D will always always be faster at doing graphics than OpenGL on Windows because Direct3D is a thin layer to the graphics driver's HAL, and OpenGL on Windows thunks to Direct3D anyway.

    • User profile image

      While you may be correct about using Direct2D for complex geometry you are sadly mistaken about OpenGL.

      On Windows Vista/Windows7/Windows8 OpenGL does not call through to DirectX to implement the functionality. Microsoft originally proposed this but backed out under pressure from the IT industry.

      OpenGL is implemented by the Graphics Card manufacturers and has direct access to the hardware.

    • User profile image


      I was having the exact same performance problems you mentioned, as we also work with GIS and I was trying out Direct2D to see how it behaved. See here:

      At best Direct2D ended-up being a little faster than GDI, but not significantly, when working without anti-aliasing.

      OpenGL on the other hand allows for real-time rendering (~70fps on the same PC) of our geographic data with 4x anti-aliasing.

    • User profile image

      Good FAST overview of D2D.  Should be enough to get me going for what I need to do.  Thanks!

    • User profile image


      Thanks for the link. 

      My problem is I need the line joins and anti-aliasing as well as working on a Server.

      I suspect I will have to do Direct3D and OpenGL. A pity really as I also need to draw on a Server as a Service which means OpenGL and Direct3D can not normally be used (problems getting an Accelerated Context).

    Comments closed

    Comments have been closed since this content was published more than 30 days ago, but if you'd like to send us feedback you canĀ Contact Us.