Jump to content
  • Advertisement

Archived

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

Malchivus

who knows where the z-buffer is documented

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

ok, i found out theres this wicked cool sounding thing called the z buffer. this could be much fun for me as it would allows images to be draw ata anytime and avoid painful hand made oclusion/dithering stuff. i''m using direct draw cause i''m too lazy to do 3d models at this point. soooo since ever search i try here crashes and says to contact thesystem admin, i htought i''d post here and ask does anyone know anything better than the "z-buffers are used for pixel depth" line thats in the sdk documentation? specificaly i want a link or an example. I just wanna get this done.

Share this post


Link to post
Share on other sites
Advertisement
You can''t use the z-buffer with DirectDraw. Its a D3D thing. And its all in the SDK docs and samples. To use z-buffering in D3D you first have to create a device that has a z-buffer attached (see any of the samples), and then you control the z-testing with the renderstates.

D3DRS_ZENABLE,
D3DRS_ZWRITEENABLE,
D3DRS_ZFUNC

Share this post


Link to post
Share on other sites
First of all, hardware z-buffers don't work with pure 2d applications. Just draw the sprites in the correct order yourself.

Secondly, there's nothing "magical" about z-buffers, they store the per-pixel depth so that 3d hardware knows which new pixels should be drawn in front of the old geometry.

Thirdly, the sdk does explain it a bit more deeply than you've stated

Conclusion: if you really want to use z-buffering in your pure directdraw app, then you must write your own z-buffer capable blitter (prerequisite of which is that you must understand the concept of z-buffering).

-Nik

EDIT:
Laziness is never a good reason not to do something.

[edited by - Nik02 on October 15, 2003 6:59:57 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
if you want to use zbuffer in directrdraw, make it you, make a buffer, and call it zbuffer , now you can store/test here pixel depths

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!