I want to render to a texture using multisampling, then render that to the back b开发者_如何转开发uffer using a textured quad (passing it through a pixel shader.) Everything works fine without multisampling but I just can't figure out how to set it up to use multisampling.
I tried CreateDepthStencilSurface() but I don't really know what to do with that surface, or if tat's even what I should be doing.
Please help.
PS - I'm using DX9, Win32 and C++
You can't, not directly anyway. Here is the regular workaround:
- Create a multisample render target using IDirect3DDevice9::CreateRenderTarget
- Create a simple texture
- Render to your multisample render target
- Use IDirect3DDevice9::StretchRect to blit your multisampled content into one of the surfaces of your texture
- Now proceed to use that texture as planned.
-Create a RenderTarget and DepthStencilSurface - these must have the same multisampling options set (same SampleDescription)
-Set the DepthStencilSurface as your DepthStencilView
-DepthStencilSurface must have at least as much resolution as the RenderTarget
-Highest SampleDescription-setting most card's support as of today is 8 Samples and Quality 32
-To blit the RenderTarget use StretchRect on DX9 and ResolveSubresource on DX10 an DX11
精彩评论