Archived

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

Cass

Lesson 19, Particle Engine

Recommended Posts

Cass    122
Mk, I have this problem here with the particle engine tutorial. The bitmaps? When they are spraying out of my compilation of the code, you can see the black squares which define each bitmap. In Nehe''s compilation, You can not see that black haze around each texture. I just skimmed through our code checking for differences, and I couldn''t actually find any. Would anyone know what the deal is?

Share this post


Link to post
Share on other sites
XaOs    122
    
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);

glColor4f (part[loop].r, part[loop].g, part[loop].b, part[loop].life);

(...Draw Triangle Strip...)

glDisable(GL_BLEND);


That should do it i think....

Take Care!

- -- ---[XaOs]--- -- -

[ project fy ]



Edited by - XaOs on October 17, 2001 8:28:59 AM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Well you can actually draw the particles with depth testing on, you just have to do it like this:

glDepthMask(0); /* this will remove the black square */

glColor4f..blablablaa

glDepthMask(1);

Without depth testing things would start to look quite crappy since your particles would ALWAYS be drawn on top of everything and that''s not what you want, is it?

Share this post


Link to post
Share on other sites
lmv    122
Damn.. the above post was by me, I just forgot to fill in my login stuff.. as if anyone cared :D

Edited by - lmv on October 17, 2001 10:54:56 AM

Share this post


Link to post
Share on other sites