View Full Version : Rendering atmosphere for a planet

03-28-2016, 04:11 AM
Let me premise my question by saying that I am fully aware that rendering atmosphere with any degree of accuracy is hard to do. I have done research and it looks daunting to say the least. I am aware of more than a few sources that explain how to render atmospheric scattering with different degrees of realism and right now I am not going to spend time trying to understand any of that ... yet.

I am building a space-flight simulator. I'm more interested in working on orbital and atmospheric flight physics right now than in making things look graphically realistic ... again ... for now. I'll work on making things look better later, after I make a good physics framework I can work with.

So I am looking for a very simple (it can be ugly and unrealistic) way to display some sort of atmosphere. From orbit I'd like to see a thin layer with a "gradient" that blends from blue to black around the planet. As the space vehicle enters the atmosphere the gradient changes to a brighter and brighter blue until it goes away and it becomes uniform blue (inside the atmosphere I'd just get rid of it and just paint the sky blue ... I don't even care about clouds for now).

I'm really just looking for a "placeholder" in my code so that first off, I can give the idea of the presence of some sort of atmospheric layer and second I can put in place the functions or framework for handling a skeletal atmosphere engine so that when later on I will work on making the atmosphere look realistic I can work on that section of the code independently from everything else.

Does anyone have any "tricks" to make something like this happen? is it possible maybe to build a "fuzzy" sphere or a sphere with a gradient of some sort that I can wrap around my planet? Any idea of how I would do that in OpenGL?

I hope my question makes sense.

Thank you!