Apply a pixel shader to a single texture in a scene?
-
יום שני 26 מרץ 2012 17:28
I am trying to render a few layers of content on my screen - specifically - some image, a couple of video frames transferred to my swapchain texture using IMFMediaEngine::TransferVideoFrame(), maybe some sprites. I need to apply a pixel shader to only one of these layers. How can I do it? It seems like if I want to use a pixel shader - I need to call ID3D11DeviceContext::PSSetShader, but this applies globally to the device and not a texture (which is something I guess I am used to being a spoiled WPF developer), so I guess I need to somehow switch a texture the device is rendering to for the time I am going to apply that shader and then somehow copy that texture to the swapchain, but I am not really sure how to get there.
I am also worried that my pipeline that does all the rendering on a vsync event will take too much time resulting in some tearing if I spend too much time running shaders and copying bitmaps...
Filip Skakun
כל התגובות
-
יום שלישי 27 מרץ 2012 09:44מנחה דיוןHello ,
Thank you for your question.
I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
Thank you for your understanding and support.
YiYi Feng Li [MSFT]
MSDN Community Support | Feedback to us
-
יום שלישי 27 מרץ 2012 16:08Thanks for looking into this.
Filip Skakun
-
יום חמישי 05 אפריל 2012 23:52מנחה דיון
Hello Filip,
I'm just trying to get caught up. Are you still having problems with affecting a pixel shader on your video? If you still need help on this please let me know and I will see what I can do to help.
Thanks,
James
Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/
-
יום שישי 06 אפריל 2012 00:51Yes, I do and thanks for checking.
Filip Skakun
-
שבת 07 אפריל 2012 00:57מנחה דיון
Hey Filip,
I *think* what you are looking to do is use a ID3D11ShaderResourceView and assign your texture to it. Check out the following links for more information. I know that this isn't necessarily a great answer but as you have found working with shaders is extremely complex notion. We are certainly trying to make it easier in VS 11 though.
If you did through these links and still don't have a good solution let me know and we can work together to figure this out.
How to: Create a Basic Texture Shader
http://msdn.microsoft.com/en-us/library/windows/apps/hh315732(v=vs.110).aspxHow to: Apply a Shader to a 3-D Model
http://msdn.microsoft.com/en-us/library/windows/apps/hh315739(v=vs.110).aspxAssembling the rendering framework - Shows how to use ID3D11ShaderResourceView
http://msdn.microsoft.com/en-us/library/windows/apps/Hh780565.aspxID3D11ShaderResourceView
http://msdn.microsoft.com/en-us/library/windows/apps/ff476628.aspxI hope this helps,
James
Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/
- סומן כתשובה על-ידי Jesse JiangMicrosoft Contingent Staff, Moderator יום שני 09 אפריל 2012 01:36
-
שבת 07 אפריל 2012 01:48Thanks, I understand this is step-by-step learning. I think these should let me move me forward in my research.
Filip Skakun