• entries
234
427
• views
114632

# Is it the Stencil buffer?

116 views

I'm still having the a problem with my mesh rendering.

To try to figure it out I posted a thread on both Game Dev and Indie Gamer.

One response I received from the Indie Gamer post indicated that my problem was because I was not setting my stencil buffer when I switched my render target. So in order to fix the problem I created a global surface called g_pStencilSurface. I then did called the following line to retrieve my stencil from the device:

g_pDevice->GetDepthStencilSurface( &g_pStencilSurface );

Then whenever I set my render target to my back buffer I use the following line:
g_pDevice->SetRenderTarget( g_pBackSurface, g_pStencilSurface );

However, this seems to create an entirely different problem with the stencil buffer as you can see in the follwoing screenshot:

In my presentation parameters during the initialization of my code I call:
g_SavedPresParams.EnableAutoDepthStencil = true;g_SavedPresParams.AutoDepthStencilFormat = D3DFMT_D16;

I will continue to investigate.

There are no comments to display.