Jump to content
  • Advertisement
Sign in to follow this  
Duel93

Glow anomaly with glBlendFunc

This topic is 2608 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 have a visual anomaly that is stumping me.
If I draw 2 particles, one which glows, the non-glowing particle will also glow depending on how I view it.

If the 2 particles are drawn in this order...

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
DrawQuad() // non glow particle
glBlendFunc(GL_SRC_ALPHA, GL_ONE)
DrawQuad() // glow particle

...the non glow particle also glows.

Thanks for any help

Share this post


Link to post
Share on other sites
Advertisement
The correct screen shot (right image), drawn in this order.

glBlendFunc(GL_SRC_ALPHA, GL_ONE)
DrawQuad() // glow particle
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
DrawQuad() // non glow particle

The incorrect screen shot (left image), drawn in this order, which causes the first particle to glow also

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
DrawQuad() // non glow particle
glBlendFunc(GL_SRC_ALPHA, GL_ONE)
DrawQuad() // glow particle

Share this post


Link to post
Share on other sites
Did you even call glEnable(GL_BLEND)? Post a picture of the particle image cuz to me you aren't using blending which is why everything is white instead of white + some alpha at points.

Share this post


Link to post
Share on other sites
Blend is enabled.

The glow particle is the little 'spark' or ball centered. The other particle is just a smoke particle, positioned slightly behind the glow ball. I used these two only to demonstrate the problem I am having.

If the spark is in front, both glow. If it's behind the smoke particle, only the spark glows, which is correct.

Share this post


Link to post
Share on other sites
It is a material problem, not a glBlendFunc problem. When removing setting materials by display lists, the issue went away.

Share this post


Link to post
Share on other sites
Display lists? There's your problem. You do realize they're clunky, slow, obsolete, and likely to actually hamper your progress, right? Just use vertex buffers instead.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!