Archived

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

Raptor_UK

Particle visibility

Recommended Posts

Raptor_UK    122
I''ve just used Nehe''s method of creating particles to create a fire effect, however since it disables the depth buffer it either renders in front or behind the rest of the scene. If I enable the depth buffer then all the particles have black boxes around them, is there a way of correcting this problem without masking the particles? Thanks

Share this post


Link to post
Share on other sites
Sander    1332
This question has been asked about a million times on the forum. Do a search first! but.... okay... here goes....

renderScene();
glDepthMask(GL_FALSE);
renderParticles();
glDepthMask(GL_TRUE);
glFlush();

when is someone going to do that depthmask/alphatest tutorial? O well, I guess i'm going to have a go at is

[edit:]switched the TRUE and FALSE. Me->Stupid=GL_TRUE; Or what that GL_FALSE

Sander Maréchal
[Lone Wolves Production][Articles][E-mail]

[edited by - smarechal on June 11, 2002 4:21:57 AM]

Share this post


Link to post
Share on other sites
miles vignol    122
Am I insane, or isn''t that backwards?


.
.
.

RenderScene();
glDepthMask(GL_FALSE); // disable z-buffer writes
RenderParticles(); // draw particles w/o writing to z-buffer
glDepthMask(GL_TRUE); // re-enable z-buffer writes

.
.
.

Share this post


Link to post
Share on other sites
LockePick    707
*laughs*
Not sure if you should make a tutorial based on that smarechal...
GL_FALSE first, GL_TRUE after.

------------
aud.vze.com - The Audacious Engine <-- It''s not much, yet. But it''s mine... my own... my preciousssss...
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155

Share this post


Link to post
Share on other sites