Adding a lens flare to OpenGL

I want to create a lens flare in OpenGL C ++. I have referenced this video and star rendering .

double calculateGlowSize(double diameter, double temperature, double distance) {
    static const double DSUN = 1392684.0;
    static const double TSUN = 5778.0;

    // Georg magic formula
    double d = distance; // Distance
    double D = diameter * DSUN;
    double L = (D * D) * pow(temperature / TSUN, 4.0); // Luminosity
    return 0.016 * pow(L, 0.25) / pow(d, 0.5); // Size
}

      

but I want the result to be more like the image shown below.

enter image description here

How do I create a lens flare effect?

+3
c ++ opengl


source to share


No one has answered this question yet

See similar questions:

five
Is realistic modeling of n-body solar system possible in the area of ​​size and mass?
1
Finding the distance to the LED

or similar:

206
How do you make wireframe primitives in OpenGL?
187
What is the state of the art for text rendering in OpenGL since 4.1?
127
What does glLoadIdentity () do in OpenGL?
116
Using OpenGl with C #?
83
opengl: glFlush () vs. glFinish ()
77
How to use glOrtho () in OpenGL?
77
OpenGL ES vs OpenGL
66
What does "immediate mode" mean in OpenGL?
five
How to create openGL fisheye lens effect?
1
Camera lens distortion in OpenGL



All Articles
Loading...
X
Show
Funny
Dev
Pics