Jump to content
  • Advertisement

Archived

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

PapaJosh

Depth Testing with a Particle Engine

This topic is 6280 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''ve been working on a simple screensaver that shows a rocket flying around the screen. In my DrawGLScene function, I render the particles for the particle engine, then render the rocket from the display list. My problem is this: This is basically what happens: glDisable(GL_DEPTH_TEST); ... ... glCallList(hList); and the glEnable(GL_DEPTH_TEST) is contained in the display list. This causes the particle engine to ignore depth testing and ALWAYS appear behind the rocket. My rocket has 3 fins, and I want it to appropriately render the particle engine (the engine "fire") between the 3 fins. How can I do this? "It''''s better to be though of as insane than to eat your next door neighboors and remove all doubt".

Share this post


Link to post
Share on other sites
Advertisement
Draw the rocket first like a normal 3D object. Then leaving the DEPTH_TEST enabled, turn off writes to the depth mask (glDepthMask(GL_FALSE) I believe). Your smoke will then behave properly in regards to infront of/behind objects, but will not self-occlude.

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!