I used to make fog in a 3D scene with glEnable(GL_FOG).
Now, I'm working on a 2D scene. I have no idea if this would work. If not, are there some alternatives? I'd like fog turbulence in a 2D game like the screenshot below.
glOrtho(0.0, SCREEN_WIDTH, 0.0, SCREEN_HEIGHT, 0.0, 1.0);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GLfloat fLowLight[4] = { 0.7f, 0.7f, 0.7f, 0.1f };
glEnable(GL_FOG); // Turn Fog on
glFogfv(GL_FOG_COLOR, fLowLight); // Set fog color to match background
glFogf(GL_FOG_START, 0.0f); // How far away does the fog start
glFogf(GL_FOG_END, 0.0f); // How far away does the fog stop
glFogi(GL_FOG_MODE, GL_LINEAR); // Which fog equation do I use?
I'm just getting a gray screen, and my texture objects aren't showing up. Changing GL_FOG_END to 1.0f does show my textures, but there is no fog present.
The style I'm trying to go for is attached. Overall, I'm wondering how I can do something similar in a 2D environment possibly with GL_FOG.