Reputation: 31
I want to render to a texture using multisampling, then render that to the back buffer 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++
Upvotes: 3
Views: 4287
Reputation: 1436
-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
Upvotes: 0
Reputation: 17278
You can't, not directly anyway. Here is the regular workaround:
Upvotes: 3