Jump to content
  • Advertisement
Sign in to follow this  

Render states for particle systems

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

Am continuing to hack away at my particle-system but am at a loss as what basic renderstates to use. The basic form of the system is smoke which involves setting alpha-blend, alpha-test and z-tests but I can't wrap my head around some of the most basic things. Does anybody out there got the most basic settings for a particlesystem (primitive-drawn, triangle-list) that act as smoke? The thing I'm most stumped is the z-test: Since the particles use alpha-blending, they are transparent, so they should be seen though each other, z-testing prevents pixels behind getting drawn based on geometry which leaves big holes. Solution is to set test to "always", but then the sorting-order in which to draw the particles has to be calculated, idealy from the camera to the particle. I recon the length-test of the distance and then sorting of the list will be a _huge_ in terms of computer-resources. So I guess I'm not heading in the right direction when using the renderstates; can someone shed some light?

Share this post


Link to post
Share on other sites
Advertisement
Depth sorting when rendering alpha-blended objects is standard operating procedure. Using a dist-squared test and an efficient sorting algorithm makes this a fairly negligible expense for the most part unless/until you get into really huge numbers of particles.

Share this post


Link to post
Share on other sites
Yeah, that's pretty huge. In such cases you may have better results by "baking" a few particles onto a dynamic texture on the fly, e.g. with a shader, and rendering fewer polygons that way.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!