Archived

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

endo

Particle engine tutorial

Recommended Posts

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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Make sure you disabled depth testing.

Nitzan

-------------------------
www.geocities.com/nitzanw
www.scorchedearth3d.net
-------------------------

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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!"

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites