Jump to content
  • Advertisement
Sign in to follow this  

DirectX Sprite zbuffer/writes problem

This topic is 2832 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!