Saturday, June 7, 2014

A better reflectance model for the moon

Here is my second post on my recent activities on planets rendering in Stellarium.

One thing I always disliked in Stellarium was the rendering of the Moon. It always looked like a giant 3D sphere with a "computer graphics style".

The reason for this is that we were until now using a basic Lambertian reflectance model. In other words, it means that we assumed that the light coming from the sun was reflected equally in all directions by the Moon's surface. The Moon being a sphere, this implies that the center of the full moon was brighter than the edges, because the light coming from the Sun comes perpendicular to the moon surface. And this produces something like that:

Notice how the center of the moon is brighter than it's edges
For comparison here is a beautiful picture of the moon taken from earth:

Image from this Wikipedia page - Copyrights Luc Viatour - CC BY-SA 3.0

Notice the "flat design" look & feel? (At least something Apple won't be able to patent because of prior art ;) )

The reason of this is that the Moon's surface is composed of a rough material, and that rough materials are not well modelized by Lambertian model. For such surface, one option is to use an Oren-Nayar reflectance model. Based on this article I was able to quickly implement something, and here is the result:

OK, it's still ugly, but it's already better..

What's next? Maybe try to add normal mapping, to simulate relief and adopt nicer textures.

Friday, June 6, 2014

Planets rendering in Stellarium

This week I spent some of my evenings working on planet rendering in Stellarium.

One of the long standing task which was in my TODO list was to properly integrate the great work done by Jörg Müller during the Google Summer Of Code 2012 (yes that's about 2 years now!).

Although his code was producing a satisfying rendering, it had never been permanently integrated because of several reasons: the code was very slow, was making use of floating point textures, which is not supported by many OpenGL implementations, and most importantly, the code was not well integrated with the rest of the rendering, mostly because the rendering code of Stellarium was and is still on some aspects very messy.

So, after a good refactoring and a large shader simplification, we now reached a point where we have a rendering as good as in Jörg's branch, with only a few FPS drops, and without using any exotic OpenGL features.

Here is the result:

Saturn as seen from Iapetus. Notice the ring shadow cast on the planet


Io in front of Jupiter

What's next? The recent switch to shader-only based OpenGL code and shader cleanup done this week will allow me to improve the currently poor rendering of planets.

To be continued..

Tuesday, April 23, 2013

Voxel Invaders on iOS!



Good news for iPhone or iPad owners: we have finally made it through the Apple store procedure: Voxel Invaders, our last video game is now available on iOS!

The game is now available on the main mobile plateforms and we are looking forward to compare sells on both :)

For techies, it is interesting to note that all versions of the game use the exact same C source code with the exception of thin wrappers for each plateforms. Even the online JavaScript version was generated from the pure C code using the powerful emscriptem!



Monday, September 24, 2012

Space Invader + Voxel Graphics = Voxel Invaders!


This week we (noctua software) released our new video game for android phone: Voxel Invaders.

This is the sequel of our previous game Retrocosmos and it follows the same principle of making a fun space invader game for touch screen devices. Only this time we used 3d voxels (the equivalent of pixels in 3d) for all the graphics! My brother Guillaume did a very good job coding the voxel graphic engine which delegates most of the computing on the graphic card allowing surprisingly fast rendering even on small devices.


The game is overall much more mature than the previous one, with more levels and more efforts put into graphics and gameplay. I also spent some nights creating retro sound effects with my good old Roland SH-101 analogic synthesizer and managed to compose 4 original soundtracks with my favorite tracker (OpenMPT). You can hear all of those in the demo video:


From a marketing point of view, we did two versions of the game: a free demo and a full paid version. We didn't put ads in the free version but simply limited the number of levels. Let's hope our users will find the game fun enough to buy the extra 20 levels!

Sunday, August 12, 2012

Alien Skull on Mars

I just spent some time looking at the amazing first full res pictures of mars taken by Curiosity, and I stumbled on this:
Yes, an alien grave with a skull! It's amazing how the human brain can see things it's looking for in random pictures :)

Friday, July 22, 2011

Stellarium in SOCIS 2011

Are you a student looking for an exciting summer job? Get paid this summer to work on Stellarium!

The Stellarium project was selected to be a mentoring organization for the ESA Summer of Code in Space 2011: a program funding european students for working on astronomy open source projects. Please review our ideas page and submit your application here.

The stipend consist in 4000 EUR (upon project completion), and is available for students from European universities (see this page for more details).

Hurry up! The application deadline is on July 27th at 11am UTC