Particle engine tutorial

Started by
7 comments, last by endo 22 years, 3 months ago
I have just finished the particle engine tutorial and have been using my own bitmap image as a texture (a simple white circle on a black background). However, when the particles are flying about I can still see the black part of the texture when it comes in front of a different particle. Is this down to the blending used? Can it be rectified so that I can only see the circle in the texture? It is a cool effect but this is really annoying me...
Advertisement
Yea, It''s most likey your blending. Try this:

glBlendFunc(GL_SRC_ALPHA,GL_ONE);.

If you use:

glBlendFunc(GL_SRC_ALPHA,GL_ZERO);,

you should get the same effect that you have now.

Take Care,
Nyko

glBlendfunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) also looks good in some situations.
Thanks for the suggestions people, but neither of these seem to help the problem. I have downloaded the actual source from the site and it looks better.

More investigation is required, guess I cant even copy the code exactly
Using blendin will only work if the texture that you are using has an alpha channel. You might want to check and make sure that you are correctly loading/generating the alpha channel for the texture that you were using with your code. That might be your problem.

j.w.
Make sure you disabled depth testing.

Nitzan

-------------------------
www.geocities.com/nitzanw
www.scorchedearth3d.net
-------------------------
i believe depth testing should be left on, but depth writes should be disabled...

ie
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_FALSE);

otherwise, your particles will appear in front of other geometry that should occlude them and look all screwy
Indeed.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
Actually it appears I was so keen I mistook a glDisable(...) for a glEnable(...), after changing that all my troubles have been solved. But it had to be disabled in the init function and not just before the rendering, why is that?

This topic is closed to new replies.

Advertisement