Saturday, October 9, 2010

Experimenting with bump mapping techniques

The "Mountains" demo scene recently got improved by adding the Sibenik cathedral mesh from Ogre's samples. I was not satisfied with its look:
Sibenik cathedral, original material
The original material has black ambient and specular lights so the first change was to set ambient and specular to 1 1 1 so the light is not completely absorbed, but soon I realized it might be improved with some bump mapping.

Here's the result:

Sibenik cathedral with bump mapping
This is just the beginning, there are many bump mapping techniques out there, for example steep parallax mapping, so stay tuned for the news.

Improved outdoor lighting

Finally, outdoor lighting has been improved although I'm still not sure it's done the right way.
Two directional lights are used (sun and moon) and SkyX's sun direction is given to the first while its opposite vector is given to the second light.

Sun's specular and diffuse colours are taken from SkyX's sun and ambient gradients and multiplied by some colour values to make it better looking.

Also, ambient light gets changed so it's darker and blueish at night and yellowish at sunset.

Sunrise
Sunset
Night is coming
Moon light

Thursday, September 30, 2010

Next on the list

In these days I'm working on an AngelScript interpreter that will be integrated with the Console and probably the Properties system.

Code base clean up
  • Code style cleanup: I'm not satisfied with current astyle options so I would like to make the code pretty and separate methods with a line, and also separate different classes that lives in the same source file.
  • Use RapidXML instead of TinyXML: RapidXML is fastest and has just one header file.
  • Merge OIS with InputManager class.
Faster and better UI
  • Use new Gorilla 2D drawing library for console and FPS (either by including it or forking the code if it fits better my needs), instead of Ogre's overlay. Gorilla can draw formatted text as well.
  • Replace current Intro game state implementation using Gorilla instead of CEGUI.
  • Fix console typing.
  • Implement a simple GUI system with Gorilla in order to avoid CEGUI dependency.
  • Replace current MainMenu game state implementation using Gorilla instead of CEGUI.
Advancement in scene rendering
  • Correct sun and ambient dynamic lighting (including nice sunshine).
  • Improve sun colour gradient and ambient light gradient colour.
  • Avoid using terrain's lightmap when using a dynamic sky.
  • Disable terrain's composite map until glitches are fixed.
  • Fix terrain's composite map glitches.
  • Implement camera and viewport setup from dotScene files.
  • Use SkyX cloud layers until volumetric clouds work fine with OpenGL.
  • Fix SkyX volumetric clouds glitches when rendering with OpenGL.
  • Load procedural grass.
  • Experiment with Deferred Shading instead of Forward Rendering.
Scripting interpreter and console
  • Fully function AngelScript interpreter.
  • Integrate AngelScript with Console.
  • Integrate AngelScript with Properties system.
  • Blinking console cursor and history support.

Wednesday, September 15, 2010

Gorilla based FPS counter

Updated roadmap

Here it comes, the updated roadmap.


Code base clean up
  • Code style cleanup: I'm not satisfied with current astyle options so I would like to make the code pretty and separate methods with a line, and also separate different classes that lives in the same source file.
  • Use RapidXML instead of TinyXML: RapidXML is fastest and has just one header file.
  • Merge OIS with InputManager class.
Faster and better UI
  • Use new Gorilla 2D drawing library for console and FPS (either by including it or forking the code if it fits better my needs), instead of Ogre's overlay. Gorilla can draw formatted text as well.
  • Replace current Intro game state implementation using Gorilla instead of CEGUI.
  • Fix console typing.
  • Implement a simple GUI system with Gorilla in order to avoid CEGUI dependency.
  • Replace current MainMenu game state implementation using Gorilla instead of CEGUI.
Advancement in scene rendering
  • Correct sun and ambient dynamic lighting (including nice sunshine).
  • Improve sun colour gradient and ambient light gradient colour.
  • Avoid using terrain's lightmap when using a dynamic sky.
  • Disable terrain's composite map until glitches are fixed.
  • Fix terrain's composite map glitches.
  • Implement camera and viewport setup from dotScene files.
  • Use SkyX cloud layers until volumetric clouds work fine with OpenGL.
  • Fix SkyX volumetric clouds glitches when rendering with OpenGL.
  • Load procedural grass.
  • Experiment with Deferred Shading instead of Forward Rendering.

Sunday, September 12, 2010

Gorilla 2D graphics and console

Betajaen's Gorilla 2D library has been integrated with Ainur.

It's a nice and fast 2D graphics library that I'm going to use in order to replace Ogre's overlays and maybe in the future it will also be useful for a GUI library to be used in place of CEGUI.

Ainur needs a lightweight GUI library and I'm not a friend of too many external dependencies, also CEGUI is a bit hard to build due to its build system.

Thanks to Gorilla, we now have a new nicer Console with coloured output.


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...