Skip to main content
gamedev.net
🔒 Locked

Rendertarget error

Started by CastorX Jul 9, 2006 at 8:23 AM 1 replies 900+ views
Original Post
CastorX
CastorX
Hi! "Direct3D9: (ERROR) :MultiSampleType between DepthStencil Buffer and RenderTarget must match." What can I do now? I would like to create blooming effect. And fullscreen multisampling. How can I create multisampled rendertarget, I create it with D3DUSAGE_RENDERTARGET option (CreateTexture & GetSurfaceLevel). Please help. THX!
jollyjeffers
jollyjeffers
I'm pretty sure the depth buffer implicitly created via CreateDevice() has no MSAA. Thus it doesn't match and is invalid.

Instead you need to use CreateDepthStencilSurface() and then manually manage it via SetDepthStencilSurface() when rendering.

Be sure to enumerate the supported MSAA modes [wink]

hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
CastorX
CastorX
thanx, I did it. I got the message again. But the problem (I think) is not with the zbuffer, but with the render target:

//////////////////////////////////
HDR_Downsample_S = NULL;

D3D_DEV->CreateTexture( ScreenWidth/2 ,ScreenHeight/2 ,1,3DUSAGE_RENDERTARGET,
D3DFMT_A16B16G16R16F,D3DPOOL_DEFAULT,&HDR_Downsample_T,NULL);

HDR_Downsample_T->GetSurfaceLevel(0,&HDR_Downsample_S);
///////////////////////////////////

That's the code. And I think here is the problem. This surface will be a rendertarget too. And I don't know how to make this surface multisampled.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.