• Advertisement

Archived

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

z-buffering woes

This topic is 5508 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

For some reason Z-Buffering isn''t working, polygons appear in the order they are drawn, regardless of depth. Does this code properly set up the Z-Buffer or am I missing something: someDevice->SetRenderState( D3DRS_ZENABLE, TRUE ); and then every frame I call: someDevice->Clear( 0, NULL, D3DCLEAR_ZBUFFER | D3DCLEAR_TARGET, 0x00000000, 1.0f, 0 ); there''s probably some stupid omission on my part, but I''ve been looking for about an hour and I haven''t been able to find anything. _sudo

Share this post


Link to post
Share on other sites
Advertisement
Make sure that you create your device with Z-buffering by setting the D3DPRESENT_PARAMETERS EnableAutoDepthStencil to TRUE.

Also, remember that not every video card can support Z-buffering. You should use CheckDeviceFormat() and CheckDepthStencilMatch() to find out whether Z-buffering is available for the current video card and settings.

Share this post


Link to post
Share on other sites
Did you set EnableAutoDepthStencil in the D3DPRESENT_PARAMETERS setup? Without that (and the accompanying AutoDepthStencilFormat), depth buffering won't work.

EDIT: I love it when posting errors out 2 or 3 times. You wind up looking like an idiot.


[edited by - Dave Hunt on January 23, 2003 12:05:27 AM]

Share this post


Link to post
Share on other sites

  • Advertisement