Jump to content
  • Advertisement
Sign in to follow this  
Dave Blake

Using blending and alpha transparency for glowing disks

This topic is 3247 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

Have completely confused myself over the best use of GL_ALPHA_TEST and/or GL_BLEND, with appropriate glBlendFunc or as an environment setting with glTexEnvi. The (2D) effect I want to achieve is lots of small "glowing" white disks with glows of different colours. I have tried to do this with a single alpha channel enabled texture rendered in numerous GL_QUADS, but either the colour of the glowing edge gets blended with the background colour, or the whole disk gets coloured. Somehow I want to white to remain white, the glow to be a specified colour but translucent and the remainder of the texture to be transparent. So far I have failed to achieve this, although I have produced some interesting effects. Could someone put me out of my mystery.

Share this post


Link to post
Share on other sites
Advertisement
ignore alphatest cause that only gives two results, pass/fail

I think its best done with having the colors in a texture or with two passes, i.e. draw white dot + then draw the glow color over it (for old opengl i.e. <2.0 texenv == GL_MODULATE)

blend modes?
try this
http://www.zedzeek.com/APPS/opengl_blending.rar

Share this post


Link to post
Share on other sites
So I was trying to do too much with just one image/pass, thanks for clearing that up. I had become convinced I was missing something.

I guess it comes down to how many different glow colours I want - either a few variants in a texture, or two passes and colour the glow as I render.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!