Sunday, November 15, 2009

Gas Giant Shadows

More shaders: gas giant shadows. You can see in the screenshot below the shadow of the rings on the planet surface, and the shadow of the planet on the rings (to the right).

It is done by ray-tracing from the pixel position to the light direction. Since there are only spheres and a plane to intersect, it is feasible to do it in the GPU and it is fast.

In case you were thinking about gas giants flatteness: yes, in Antares all the planets are perfect spheres. Flateness won't add much to the gameplay (and if I don't mention it, almost nobody will notice)

Tuesday, November 10, 2009

While I'm coding the gui for travel between stars, I've decided to implement shaders in the engine with the OGLSL languaje. It was easy to implement, but coding and debugging shaders is so hard! It took me one day to make the support for shaders in the engine, and two days to code and debug the shader for rocky planets with bump (or normal map). If the user doesn't have a shaders-capable graphics card, the graphics will be as before.

This is the previous rocky planet without bump:


And this is the one with bump. Click the image to see the details:


Rocky, uh?