Rendering a planet?

I have a problem that I can’t find a solution to, rendering a planet in the blender game engine, something like this.


I have come up with two possible solutions, one is copying the planet and having a second sphere surround the entire planet, you lower the alpha on the material and add some kind of texture. Then you get something like this:


There is no sense of that being light though, looks more like glass, also it adds a lot to the polygon count in the scene, slowing down the game. Another way would be to use a plane as a halo at the centre of the planet facing the camera at all times. I tried this and while the result looked quite nice I discovered that when you got closer to the planet you can’t see the halo anymore, the atmosphere dissapears. Also the atmosphere has to be dark on the side of the planet where the sun is not shining.

Since the halo is a plane the atmosphere doesn’t appear at the sunrise. I’m stuck and wonder if anyone knows how to render this in the blender game engine. I don’t know anything about python so don’t ask me to play around with that.

Thank you

Both of those shaders/filters look good, python is chinese to me though. Maybe it’d be better to leave all the “effects” for later til one has someone that can do all the python stuff, because it’s beyond me how to get all that to work properly. Thanks for the help though, I’ll remember this for later.

These shaders not are in python, are GLSL, the first is a fragment shader and the second is a vertex/pixel shader.

Here is something I just threw together: https://dl.dropboxusercontent.com/u/38384163/planet.blend

It doesn’t use any GLSL shaders and has a pretty good result. Somewhat unrealistic and could probably be done better, but it works and has far less performance impact. It’s all just alpha planes and spheres with some node materials for the atmosphere.

You just need a sphere and lots of lens flares. Some need to be 3d lens flares and some as screen space. Check Martinish’s example , the one with lens flare playground. That one looks almost the same if not way better.

Attachments

Compositor. 002.blend (372 KB)

I just noticed that some of the shadows are not working properly anymore in 2.70 and the star field generator is missing in the world options.

Attachments

Compositor. 006.blend (117 KB)