• Advertisement


This topic is now archived and is closed to further replies.

Problem with z-buffer

This topic is 6685 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Clear your z-buffer.

g_pD3DViewport->Clear2(1UL, &ViewportRect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x000000ff, 1.0f, 0L);

Share this post

Link to post
Share on other sites
Hi everybody!

I am just starting to learn Direct3D (Immediate Mode) and did the first tutorial in MS DirectX SDK 6 (The triangle tutorial).

Besides the fact, that this tutorial is worse than anything I have ever seen before (I liked the DirectDraw tutorials much better), I went through it. I made some changes (Fullscreen mode with backbuffer and flipchain).

Then I tried the second tutorial (z-buffer) and everything went fine until I started what I coded. If I turn on the z-buffer with g_pD3DDevice->SetRenderState() I can just see some lines moving across the screen. When I turn it off all is fine except that z-buffering is off and so the output is without hidden surface removal.

(Maybe this can be helpful: Like in the first tutorial I made some changes like fullscreen mode, backbuffer in VIDMEM and a flipping chain)

I can't get, what I did wrong, so I am trying my luck in this message board. As posting my sourcecode would be not such a good idea (it's simply too long) I put a link in here, where you can find it.

If someone has the time to have look at it and could analyze it, I would be very glad. (I can understand, if you don't want to, since my coding style is not the best )

Many thanks in advance...


Share this post

Link to post
Share on other sites

  • Advertisement