High Performance Rendering Using C# and XAML in Windows 8 1

Preview:

Citation preview

High Performance Rendering using

C# and XAML in Windows 8.1

Patrick Steger

Who am I?

Patrick Steger www.patchsteger.com

Twitter: @StegerPatrick

LinkedIn: www.linkedin.com/in/patricksteger

Software Engineer @ Lenovo

Contextual Computing Group

BS in Game Design and Development

Full Sail University ’06

High Performance Rendering

Why bother?

Different methods

Pros and Cons

Demos

High Performance Rendering

You have a GPU, use it!

Save the CPU for computing, not rendering!

Can save battery life

Why bother?

High Performance Rendering

XAML Canvas element

Pros EASY!

Lots of samples online.

Works for most things.

Did I mention EASY?

Cons Quickly changing elements render

slow.

CPU rendering can use up CPU

resources.

Children.Add is SLOW

High Performance Rendering

Win2D

Pros Uses GPU

Open source (on Github)

Looks to be a great long term

2D GPU solution for Windows

8+.

Don’t need to know DirectX!

Integrated well with XAML

Supported by Microsoft

Cons Relatively new

Very few samples.

HUGE pain to setup (for now).

Supported by Microsoft

High Performance Rendering

SharpDX

Pros Uses GPU

Open source

API is 1:1 generated off C++

DirectX SDK.

Performance loss isn’t bad

(~35%)

Great C# only DirectX library

Cons Need to know DirectX

Few samples

Possibly overkill?

High Performance Rendering

C#/XAML with C++ DirectX renderer

Pros Uses GPU

Fastest renderer (without using

only C++)

A very good sample to get you

started

Cons Modern (“Metro”) Interop stinks

Have to know DirectX

Possibly overkill?

High Performance Rendering

Demo Time!

Resources

http://msdn.microsoft.com/en-us/library/ms747393(v=vs.110).aspx

http://stackoverflow.com/questions/4846502/wpf-canvas-performance-children-

add-called-many-times

http://sharpdx.org/

http://channel9.msdn.com/coding4fun/blog/Sharpening-your-Metro-CXAML-

projects-with-DirectX-and-SharpDX

https://github.com/Microsoft/Win2D

http://blogs.msdn.com/b/uk_faculty_connection/archive/2014/09/05/win2d.aspx

http://blogs.windows.com/buildingapps/2014/09/05/introducing-win2d-gpu-

accelerated-2d-graphics-programming-in-the-windows-runtime/

https://code.msdn.microsoft.com/windowsapps/XAML-SwapChainPanel-00cb688b

Thank you for Attending!

Contact Info

Patrick Steger www.patchsteger.com

Twitter: @StegerPatrick

LinkedIn: www.linkedin.com/in/patricksteger

Recommended