|
Dec
6
Written by:
Jeremiah Morrill
12/6/2009 12:21 AM
This one isn’t for the faint of heart, but if you are a Direct3D guru and always wanted some more low level access…here is a good start. This hack does a overwrites IDirect3DSwapChain9::Present method in memory to hook into the call WPF makes. In that hook, I also pull out the IDirect3DDevice9 pointer. What can we do with this? Well for one, it would be possible to render WPF to a texture in a Direct3D scene. You can also fiddle with the WPF rendering process. And if you are really tricky, you can probably even do something even more amazing. Given the time, I’d like to make a few examples, but for now, here is what I got. You need the DX and Winders SDKs
Tags:
18 comment(s) so far...
Re: How to get access to WPF’s internal Direct3D guts
I love this article , Very good collection of information,thanks.
By replica fendi scarf on on
1/5/2010 11:47 PM
|
Re: How to get access to WPF’s internal Direct3D guts
百度 [url=http://www.sina.com]sina[/url] [url="http://www.baidu.com"]baidu[/url] [url=www.google.com]google[/url] [link=http://www.yahoo.com]yahoo[/link] [a/]http://www.yahoo.com[a]yahoo[/a]
By chi flat iron on
1/30/2010 12:40 AM
|
Re: How to get access to WPF’s internal Direct3D guts
Very grateful to God, so I saw this article, let me learn a lot.ugg boots saleonline,cheap ugg bootsanduggs,Feeling very excited:ugg boots sale|gucci shoes|gucci handbags|mbt shoes|cheap mbt shoes.Welcome to our site,thank you.
By chi flat iron on
1/30/2010 12:41 AM
|
Replica scarf
aqian100208 Cheap Wholesale Designer Sunglasses|Replica Sunglasses| Wholesale Women Fashion scarves|Replica Scarf| replica hermes birkin and kelly handbagsHermes Handbags|
By ReplicaScarf on
2/7/2010 6:39 PM
|
Re: How to get access to WPF’s internal Direct3D guts
Do you know if this would make it possible to render wpf content out to a directshow playout device like the DeckLink playout cards? could this be used to call GetRenderTargetData on a wpf window?
By stewart johnson on
2/17/2010 9:21 AM
|
gucci shoes
if you want to buy here is some good Website for another you can see this any more jordan shoes air jordan shoes michael jordan shoes
By gucci shoes on
2/23/2010 10:17 PM
|
Re: How to get access to WPF’s internal Direct3D guts
This is the best thing I've ever seen, Jer! I converted the C++ implementation to C#, works fine: sichbo.ca/Files/WpfHack2.rar
Next up I'm going to see if we can't fix this god forsaken framerate problem rhnatiuk.wordpress.com/2008/12/21/wpf-video-playback-problems/) and write a proper video presenter once and for all. Now that we have an IDirect3DDevice9 handle, I'm hoping we can push through strict 40ms Present() timings with a DirtyRect of the video texture. Also hopefully avoid the "washed out" video texture that we get from the regular MediaElement.
- Simon
By Sichbo on
2/24/2010 7:02 PM
|
Re: How to get access to WPF’s internal Direct3D guts
So I've been toying with trying to make a video presenter which does a StretchRect() of the WPF surface scene ontop of a beautiful and flawless looking FULL FRAMERATE VMR9 d3d scene. Comparing WPF and this other d3d scene side by side you really appreciate just how choppy (rubbish) WPF video presentation really is.. anyway here are the issues;
1. WPF will never give you a "transparent" surface. Obviously the first call in the WPF Present() method is going to be Device->Clear(..,WindowColour,..); This means the plan for a nice alphablend overlay is dead in the water, because the swap chain backbuffer is always going to be a solid colour. If you set WindowStyle="None" AllowsTransparency="True", our vTable swap chain hack no longer works, I think because probably there is an additional swap chain added to the graph in this scenario.
2. When you make a second device and try StretchRect() the WPF surface directly, you get errors because we're not allowed to share surfaces between devices (unless you use newer dx10 surface sharing features which is not really suitable/worth it given most folks will be running the app on XP.)
3. On account of problem #2, this means we have to do a nasty and resource-intensive surface copy into the "SYSTEMMEM" pool. +30% hit right here.
4. The other obvious approach is to be injecting your own scene rendering into WPFs device - but it's not working out so great. You end up just flickering the screen since WPF will clear your drawing if you're trying to draw underneath it. So then I tried to "hook" the WPF Device->Clear(..) function pointer, and do the work in here. That sort of almost works in that I'm able to clear the background with my own colour, but if you try do anything fancy like SetTexture and draw a video quad, WPF clears it still, probably because it's present function is only doing a small "dirty region". But either way, all of that effort to hook into the wpf scene graph is going to be moot because we're once again rendering with WPF's crappy Present() intervals. Invoking the wpf's Present() continually I think will kill performance similar to the whole systemmem surface copy issue.
Bit bored now, think I'll give up.
- Simon
By Sichbo on
2/28/2010 11:21 AM
|
|
Re: How to get access to WPF’s internal Direct3D guts
thank you for your great post, and I did want to share this. I hope you will also like it, if you think it is spamming, please kindly delete it. thank you!abercrombie see what is this? abercrombie and fitch uk abercrombie and fitch abercrombie fitch uk abercrombie mens abercrombie london
By abercrombie on
3/11/2010 6:52 AM
|
|
|
ed hardy
ED Hardy Hoodies ED Hardy Hoodies Ed Hardy Swimwear Ed Hardy Swimwear ed hardy tops ed hardy tops ed hardy shoes ed hardy shoes ed hardy t shirt ed hardy t shirt ed hardy shirts ed hardy shirts christian audigier christian audigier ed hardy kids ed hardy kids Ed Hardy Sunglasses Ed Hardy Sunglasses ED Hardy belts ED Hardy belts ed hardy Bags ed hardy Bags ed hardy purse ed hardy purse ed hardy mens ed hardy mens ed hardy womens d hardy womens ed hardy mens shirts ed hardy mens shirts ed hardy mens tops ed hardy mens tops ed hardy mens hoodies d hardy mens hoodies ed hardy mens swim trunks ed hardy mens swim trunks ed hardy mens shoes ed hardy mens shoes ed hardy womens swimwear ed hardy womens swimwear ed hardy womens t shirt ed hardy womens t shirt ed hardy womens tops ed hardy womens tops ed hardy womens pants ed hardy womens pants ed hardy womens hoodies ed hardy womens hoodies ed hardy womens shoes ed hardy womens shoes ed hardy womens clothing ed hardy womens clothing
By ed hardy on
3/15/2010 9:46 PM
|
Re: How to get access to WPF’s internal Direct3D guts
An Ugg boot is made from the skin of an Australian merino sheep most commonly. The wool part of the skin faces into the inside of the boot and so lies against the leg.
By UGG boots sale on
3/16/2010 12:23 AM
|
cheap nike shox
There are wide variety of Nike Shox for both men and women's selection.The Nike Shox Sale are best selling nowadays.Get your own Cheap Nike Shox now.It's definitely time for you to buy womens nike shox and wens nike shox, Wearing them will keep you in a perfect condition.
By nike shox on
3/16/2010 10:35 PM
|
Re: How to get access to WPF’s internal Direct3D guts
I agree with you, there are some things that you would love: jordan shoes cheap jordan shoes jordan air shoes air jordans In addition to these, there is also very good: mbt shoes mbt shoes sale mbt sport shoes
By uggs sale on
3/16/2010 11:30 PM
|
UGG Boots UK | Classic UGG Boots Sale-To ensure your toes are in heaven,UGG Boots made by UGG Australia are your must-have boots.50-70% off.Love UGGs.
I more or less agree with you. classic ugg boots have become very popular among women and men all over the world. As a fashion statement, ugg boots uk is a great choice for people who want to give their boots an edge. you have my vote. chi hair iron is the Best For Hair Straightening and it will make your hair most good-looking and you will be high-handed of. Oh, I agree with you. A ghd hair iron Can Make It Easy To Style Your Hair. ghd hair straightener will make your hair get it looking its best.
By ugg boots sale on
3/16/2010 11:42 PM
|
Re: How to get access to WPF’s internal Direct3D guts
This article is very interesting, I like it. I will always come to visit after.I would recommend to friends more. [url=http://www.mbtwalkingshoesbuy.com/]mbt shoes[/url] and mbt walking shoes, [url=http://www.mbtwalkingshoesbuy.com/]mbt walking shoes[/url] the first physiological footwear that has a positive effect on the whole body. [url=http://www.mbtwalkingshoesoutlet.com/]discount mbt shoes[/url] Trustworthy online shopping store, 60% OFF. [url=http://www.mbtwalkingshoesbuy.com/]m b t[/url] Free Shipping and Fast Delivery. [url=http://www.mbtwalkingshoesoutlet.com/]mbt walking shoes[/url] Want to buy Cheap [url=http://www.mbtwalkingshoesbuy.com/]shoes mbt[/url] ? Discount [url=http://www.mbtwalkingshoesoutlet.com/]mbt shoes[/url] offered in our store now. Free Shipping & Save up to 85%. Get Now!
By bhreah on
9/26/2010 12:03 AM
|
|
|
|