make the sun glow?

Started by
0 comments, last by nicolasbol 15 years, 4 months ago
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
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.

This topic is closed to new replies.

Advertisement