Jump to content
  • Advertisement
Sign in to follow this  
Rainer K

Lesson 19: Particle engine

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

hi folks To draw the Particles in lesson 19, depth testing is disabled (glDisable(GL_DEPTH_TEST);) Lets say, we do have a landscape with some hills or mountains, or even just a wall. Now if i stand in front of the hill, and the particle effect is behind the hill, the particles will draw through the hill. How can i do particles, that wont shine through other, solid objects?

Share this post


Link to post
Share on other sites
Advertisement
lets say you have one big display list with the landscape, 2 hills and the particles between it, now if you draw the particle, then the hills, it won't be visible at all...

Share this post


Link to post
Share on other sites
instead of setting depth test to false, i set glDepthMask to false, this works as it should

[Edited by - Rainer K on June 24, 2007 4:00:46 AM]

Share this post


Link to post
Share on other sites
The other way to handle this is to sort your particles from furthest to closest to the camera and draw them with depth-testing and the depth mask enabled. There are some interesting performance tradeoffs, related to each method, that I could write about if you (or anyone) are interested.

Share this post


Link to post
Share on other sites
It also depends on the nature of the particles.
there are two types of particles that does not need sorting.
1. glowing particles that are blended with (GL_ONE,GL_ONE).
2. single color alpha textured particles with regular alpha blending

All other types of particles needs to be sorted in some way to not produce many artifacts.

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!