Jump to content
  • Advertisement
Sign in to follow this  

DirectX Sprite zbuffer/writes problem

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

I am working on a Foliage engine, which i adapted from a particle engine I made, (Its very similar).

with the particles i used a lot of additive blending so depth wasn't a massive issue. I did encounter some problems when I didn't use additive, my smoke for example used normal alpha blending.~

The way i found worked best was to draw my scene 1st with z buffer enabled and z write enabled. then draw particles with z buffer on and z writes off. this isn't working for my grass.

Here as some screens:

This is with both Z buffer enabled, and Z writes enabled


And here is with Z buffer enabled, and Z writes disabled.


I dont know how to set it up to make them draw properly, other than re ordering the array myself before every draw call, so they draw from back to front. Even then because of the random rotation i may get a particle that is further from the camera in its position but part of it (due to rotation) is actually in front of a nearer particle.

Help appreciated. hope i was clear enough.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!