Wpf: Add the ability to render a XAML tree to a direct3d texture (offscreen rendering)

Created on 10 Dec 2018  路  7Comments  路  Source: dotnet/wpf

Currently WPF offers the ability to render a xaml tree to a bitmap via RenderTargetBitmap.
Yet this API forces the client to do a copy of the render target to system memory (and back).
It would be much better if it would be possible to gain access the Direct3D9 render target.

There could be various applications to this feature. 3D game overlays, Heads up displays etc.

Here are several discussions on this issue:
https://stackoverflow.com/questions/10376016/rendering-from-wpfs-internals-to-a-directx-application
https://stackoverflow.com/questions/18881683/how-to-display-wpf-overlay-on-top-of-directx?noredirect=1&lq=1
https://stackoverflow.com/questions/52918039/is-it-technically-possible-to-render-a-wpf-xaml-element-to-a-direct3d-texture

issue-type-api-suggestion

Most helpful comment

Would this allow for then grabbing the direct3d texture into a bitmap (basically, avoiding the costly RenderTargetBitmap on a XAML tree)?

If so, that would be INSANELY USEFUL!
How soon could we expect this? My app would benefit immensely from this. Probably a 10x improvement in speed or so.

All 7 comments

97 Bring win2d to WPF

And you may use D3DImage.

https://github.com/dotnet/wpf/issues/85 Extensible rendering pipeline

@lindexi

And you may use D3DImage.

How can D3DImage help in this case? it only allows rendering DirectX content to an exisiting WPF UI, not the other way around.

But it can add in xaml

Would this allow for then grabbing the direct3d texture into a bitmap (basically, avoiding the costly RenderTargetBitmap on a XAML tree)?

If so, that would be INSANELY USEFUL!
How soon could we expect this? My app would benefit immensely from this. Probably a 10x improvement in speed or so.

As a user of WPF, I'd be happy, if RenderTargetBitmap would allow expose its own DXGI surface, or allow me to supply my own.

@lostmsu I've given up on this entirely. I've switched to UWP almost a year ago (which comes with its own huge bag of gotchas, but that's an entirely different story).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bugproof picture bugproof  路  3Comments

poke picture poke  路  3Comments

h82258652 picture h82258652  路  3Comments

Pzixel picture Pzixel  路  3Comments

skanvk15 picture skanvk15  路  3Comments