Sunday 31 July 2011

Develog, Late July, 2011

Changes are highlighted.

  • Renderer:
    • Programming interface: updated
    • Documentation: ongoing
    • Camera function (formerly perspective projection and zoom): done
    • Gamma Correction: done
    • Update rotation algorithm: to-do
    • Lighting: ongoing, Blinn-Phong model, Gaussian model done, adding more algorithms
    • Texturing: to-do, basic functionality due 25/8
    • HDRR: to-do, due 15/8
    • Shadow: to-do, due 20/8
  • Game Logic:
    • Main loop: done, for now
    • Mouse movement and key detection: done, for now
    • Key mapper: to-do, due 23/8
  • Network:
    • Everything: currently not on schedule
  • Modelling:
    • Simple Wavefront .obj loader: updated
    • Simple material property loader: to-do
    • Everything else: to-do
  • Physics:
    • Everything: currently not on schedule
  • Sound:
    • Everything: currently not on schedule
  • Optimisation:
    • Everything: currently not on schedule
  • Debug:
    • For all components: never ends

Details:

Lighting did not work properly. It turns out, when I import normals from the Wavefront .obj file, I forgot to append a 0.0 (the w component) to the normals. So, complying with the GLSL specification, the compiler appends a 1.0 to the normals, turning them into positions instead of directions. That's why the computations all go wrong. After updating the Wavefront .obj file loading code, the normals turn back to directions, and the resulting rendering is pretty.

In the above screen shot, Gaussian specular model (a quite expensive one) is in action. Shading for the capsule is not good (look at the abrupt brightness changes and rough edges), not because the shading algorithm is bad, but because the mesh data is badly constructed. The cylinder on the left looks perfect. That is the power of more than 500 triangles.

Texturing has been postponed, again. As I don't have any texture by now, there is no incentive. Even if I have done it, there is no way to debug and ensure functionalities. Anyway, with shaders, we can achieve lots of wanders, even without textures. So I will focus on lighting computation in the not-so-distant future.

For HDRR to work, frame buffer, which is what I'm studying, is required. Once the mechanics is clear, implementing it should not be very hard. Moreover, with frame buffer, many post-rendering effect and in-engine (I won't call it in-game for now) screen shot could be achieved.

IELTS is coming; therefore working progress of early August will be very slow, if not totally halted.

The previous Develog.

Wednesday 20 July 2011

Develog: Mid July, 2011

Changes are highlighted.

  • Renderer:
    • Programming interface: updated
    • Documentation: ongoing
    • Perspective projection: done
    • Zoom ability: done
    • Update rotation algorithm: to-do
    • Lighting: ongoing, bug-free basic functionality due 23/7
    • Texturing: to-do, basic functionality due 31/7
  • Game Logic:
    • Main loop (formerly the exit function): done, for now
    • Mouse movement and key detection: done, for now
    • Key mapper: to-do
  • Network:
    • Everything: currently not on schedule
  • Modelling:
    • Simple Wavefront .obj loader: done, for now
    • Everything else: to-do
  • Physics:
    • Everything: currently not on schedule
  • Sound:
    • Everything: currently not on schedule
  • Optimisation:
    • Everything: currently not on schedule
  • Debug:
    • For all components: never ends

Details:

Perspective projection is just matrix multiplication. After setting up the matrix and importing the code that actually does the maths, it's basically done (no, I'm not going to reinvent the wheel here). All left is the tweaking. One of the outcome of tweaking the numbers that go in the matrix is that, you get different zoom effect; so the zoom functionality is a by-product. Nonetheless, this functionality is crucial for navigating in the vast space that I'm going to make.

Currently, the rotation algorithm is based on matrix. Yet, due to how floating point numbers work in computers, errors will accumulate, and rotations will eventually become something more than just rotations. Unwanted transformation and scaling is expected when the programme runs for a long time. Planing to move to quaternion-based algorithm.

Lighting works, if totally flawed:

Not particularly convincing. In fact, it looks awful. Both the per-vertex (directional) and per-fragment [or per-pixel, in Direct3D parlance] (point light) lighting are enabled. Apparently, neither of them function properly. I'm still investigating whether it is the surface normals or the algorithms, or both, that get wrong.

The previous Develog.

Sunday 10 July 2011

Develog: Early July, 2011

  • Renderer:
    • Programming interface: done, for now
    • Error handling: done, for now
    • Documentation: ongoing
    • Perspective projection: to-do, due 14/7
    • Lighting: to-do, basic functionality due 20/7
    • Texturing: to-do
  • Game Logic:
    • Exit: done, for now
    • Everything else: to-do
  • Network:
    • Everything: to-do
  • Modelling:
    • Everything: to-do
  • Physics:
    • Everything: to-do
  • Sound:
    • Everything: currently not on schedule
  • Optimisation:
    • Everything: currently not on schedule
  • Debug:
    • For all components: never ends