• Advertisement
Sign in to follow this  
  • entries
    234
  • comments
    427
  • views
    114771

Is it the Stencil buffer?

Sign in to follow this  

120 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:

Epoch Star - Sci-Fi Space Adventure



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.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement