Slowly but surely I am hacking away at a 3D engine for TidalWare. I started it just under a year ago as a personal project, originally named OGLE (OpenGL Engine). Recently I’ve been working non-stop, trying to bring it to a useable state. I heavily underestimated the difficulty of writing a well designed, sustainable engine.

I had a browse around the web to see if I could find any inspiration; after all, there are 3D OpenGL engines all over the place. I came across a few very nice engines, from personal projects to student finals. The features and visuals of these engines seemed astounding – XML shader system, dynamic water, static geometry, vertex buffers. Great. But, take a look at the source code and ouch. Hacky and GL-specific code everywhere. It’s as if they continued to add bits here and there without any particular structure.

Bad design is easy to implement in the short-term, but as for extending it in the long-term, well, it could turn into a bit of a nightmare. On the other hand, good design is painful at first, but once you’ve got the ball rolling you soon realise that it was the best decision you could have possibly made. I’ve opted for the latter.

Unfortunately that means I can’t add any juicy features until a solid framework is implemented.

Here is a lowdown of the current features:

  • Window creation, management and events
  • Camera with frustum
  • Viewport
  • Scene components
  • Abstracted OpenGL 2 with version 3 placeholder
  • Math functions: Vector4, Vector3, Vector2, Matrix4, Matrix3, Quaternion, Sphere, Plane, Ray, Colour, Box
  • Utilities: Logger, Exceptions, Timer
  • Occlusion query
  • Temporary fixed-function lighting and fog
Screenshot of TIDE

Screenshot of TIDE in its infancy.

Pretty basic stuff, and I know you’re thinking “what has taken him so long?” Well, apart from the fact that I’m the only one working on it, you’d be suprised at just how complicated it is to implement the core functionality. The engine is already beastly with over 30k lines of code. However, now that the basics are in, it is now very simple to add new features. It’s component-based design means that I can drop in a new class without changing much at all.

There is still a huge amount of work to do, however. It has no texture support, no materials, no model loading, no scene graph, no resource management and no shaders. Admittedly, some of those features will mean a number of framework changes. The first three especially will be a bumpy ride. But nevertheless, my good design decision will help immensely.