Sunday, July 22, 2018

Right, Then

So anyway, blogging is now completely forgotten, so I'm just going to use this as my random hobby diary.

I'm building a game, or game engine, or some kind of thing, using obsolete technology on old hardware, for the hell of it. It's fun, for me, and gets me weird looks from my wife and kids.

I have a vision for a kind of space game, a bit of KSP, a bit of Minecraft, but not really either of those things. And since it has space, and planets, I've been trying to make planets that look reasonably good for a while now. One feature that's been in a long time has been atmospheric scattering, based on an old GPU Gems article (here). Works well enough. Indeed, it was a real eye-opener about how much math I could do in the GPU, even on an older system, and get away with it.

A separate trick I picked up in some game development article I've forgotten about, is using the color of the sky overhead as the ambient light value. This makes the insides of shadows blue lit in the daytime and reddish at sunset, for example.

Now, when out in space the ambient light value doesn't take this sky overhead thing into account, which is correct if you really are out in space, since the sky should be black. There's still ambient light, but that's a problem for another day. Anyway, I thought it might be a good idea to simulate the ambient light on the surface of planets as seen from space. They should be illuminated by the sky as well as direct light from the sun.

Turns out, the effect is very subtle. You might even say invisible.



Never mind the light positioning and lack of clouds. Unless you know exactly what to look for (the area along the north edge of the Arabian peninsula is a little brighter, but that might be affected by other factors too), you would never notice.

On the other hand, even the additional math to do this doesn't seem to have too much effect, so I'll probably leave it in. See it in motion on my YouTube channel.

Now, clouds, that would be cool.

No comments: