Wednesday, 25 February 2015

UNDONE Engine Update: Added per-vertex lighting and a debug terminal.

Yes, work is on on the UNDONE Engine. I am actually trying to balance between my studies and development,(and failing at it badly) that is why I was not able to make too much progress on any project. Today, I finished another feature of the UNDONE Engine. I added a Debug Terminal so that I can log what the engine is up to while debugging. Guess what? It already showed me a two bugs out there, and made me increase the frame rate by 100 fps! Here's a GIF showing what the engine is able to do:
I am not very good at making GIFs, but you can see that the cubes rotate. There are some problems
with the transformation matrix in the engine, which I tried to fix, but it looks like I need some more fiddling with the maths to get things right.

In the GIF, you can also make out the console window I added. It is truly helpful.

The other thing I did was to add a vertex-lighting shader, so that now your cubes look slightly more real as the different faces are shaded according to how much light they are getting. It was a very easy feature to add.

A clearer view of the cubes.
There is another thing I added which is not really visible anywhere- I converted the engine's design to have a Component-Object Model. That is why in the console you will see logs of components getting constructed and released, as I was testing how the components behave (and found out that I was wasting a huge number of clock cycles copying whole lists of those around many times).

A formation with shaded cubes!
After this, I plan to get the transformations right. The maths out there is really messy. Well, that is not only because I am very bad at math, but more because the maths code was imported from a DirectX application I was making earlier. Direc3D and OpenGL use very different types of mathematical conventions. Direct3D uses the left handed co-ordinate system for specifying its geometry, while OpenGL, the library UNDONE uses, has the completely opposite right handed system. Moreover, matrices in D3D were row-major, while in OpenGL, its column-major instead, so that needs me time to get used to first. Once I sort that out, I will work on getting more interesting geometry into the scene - loading models from file.  

No comments:

Post a Comment