Jump to content
  • Advertisement
Sign in to follow this  
daviddoria

OpenGL make the sun glow?

This topic is 3614 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 can get a decent "glow" effect by drawing slightly larger, slightly more translucent copies of an object at the same position as the actual object. glScalef(1,1,1); glColor4f(1.0f, 0.0f, 0.0f, 1); DrawSphere(); glScalef(1.1, 1.1, 1.1); glColor4f(1.0f, 0.0f, 0.0f, .5); DrawSphere(); glScalef(1.2, 1.2, 1.2); glColor4f(1.0f, 0.0f, 0.0f, .2); DrawSphere(); where DrawSphere() is GLUquadricObj *quadratic; quadratic = gluNewQuadric(); gluQuadricNormals(quadratic, GLU_SMOOTH); gluSphere(quadratic, 1.0f, 32, 32); However, this makes perfect circles and looks very fake. See this image: http://www.photoshoptalent.com/photoshop-picture/480f1bb99c1fe/Glowing-Planet.html The red part is like what i'm getting (perfect cirlces) What I'm interested in doing is the white (rays) that are emanating in a non-uniform kind of way. How would you do this using opengl? Thanks, Dave

Share this post


Link to post
Share on other sites
Advertisement
If what you want is something like this:



I think I would go with a GLSL shader to "cast" rays sparkling from the sun.
An other cool technique is to pre-render your sun in a Frame Buffer Object, draw your scene normally and them blend the FBO with the Framebuffer with a shader based on gaussian blur.

Check out the free online GPU gems 1 & 2, there is a tutorial about bloom effect.

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!