Saturday, September 11, 2010

Nice day and night transition

The demo scene rendered by Ainur is getting better and better.

When using SkyX, the engine disables the terrain lightmap and delivers you a nice scene with day and night cycle. I also had to disable the composite map generated by Ogre, because it had some artifacts, this issue has still to be investigated.

To help me get nice sun and ambient colour lights, a simple C program was written. It reads a 64x1 PNG image (well width may change but height must always be 1 pixel) and prints C++ code of the gradient so that I can copy and paste in the engine source code.  The program will soon be rewritten as a part of the engine, using the Ogre API and loading those PNG images from the resources of the scene itself.

Sun gradient contains the light diffuse colour and it's taken from the Caelum resources, while the ambient gradient is made with GIMP.

Ambient gradient colours are multiplied by scene ambient light, it is usually RGB(1, 1, 1)  in order to make it full bright or RGB(0.5, 0.5, 0.5) in order to half the colour.

Obviously, there are still glitches: ambient gradient probably needs better colours and default SkyX yellow sun shine is really bad...

No comments: