3D Progress

Well... if you read the last post, that was a long week or two!

Though I was able to render 3D objects without any issue, I was not satisfied with the shadows and lighting. It took a fair amount of time, but eventually new shaders were completed that seem to do the job much better than any previous renditions of the engine! Take a look:

Demonstration of 3D lighting and shadows in the Third Eye Engine

Demonstration of 3D lighting and shadows in the Third Eye Engine

It doesn't look like much, but this lighting and shadow setup is much more natural than previous TEE projects, and does not have a number of issues that the previous engines and demos had. It currently supports unlimited lights, each of which can be configured as to whether they produce shadows or not. The lights themselves have many properties and work alongside the materials system which allows for a very high degree of customizability (which is not completely shown in the screenshot because the properties are not yet integrated into the editor).

This system means two things; on one hand, there is full control over 3D rendering at a low level, which will be advantageous if one wants things to look a very specific way. On the other, a customized low level framework is a major responsibility and really takes an additional leap towards the engine's independence of major libraries, for better or worse. I was prepared for this and decided early on that this was a potential outcome.

Here's what has been done on the 3D side of things:

  • Created a "chunk" based system that works behind the scenes to both render and otherwise manage objects, similar to what you would see on a never-ending, procedurally generated game such as Minecraft. I wanted to make this decision early so as to not limit the size of the worlds that will be supported with this engine. This allows for more efficient object rendering, querying and other functionality by only involving objects within a certain space instead of looping through every object in a scene. In the near future, there will be options for having all chunks loaded at once for smaller games, or loading/unloading based on proximity. One example of a use of this system is within the editor yourself. When you select a 3D object, it doesn't loop through every object in a scene to see if it was clicked, it instead finds which chunk was clicked within the scene and loops through only objects within that chunk. In an average scene with 20+ chunks loaded at once, this greatly reduces the CPU usage needed to figure out which object was in fact clicked.

    • Created a basic rendering system, which was eventually replaced with a more complex, shader based system (which I worked with outside help on). The engine now supports multiple shaders and you can select them on a per-object basis (for example, you could have an object drawn with no shadows, or vice versa). There are two default 3D shaders; "default" (which supports drawing 3D objects with lighting) and shadows (which calculates and applies shadows to the scene). This means that in the future it will be possible add other neat effects such as glowing, screen distortion, motion blur, bloom, rain, etc. There is also high potential for allowing custom shaders to be loaded in for mods.

    • Completed selections. Not much else to say about this outside of the fact that it's more precise than the previous, Irrlicht-based engine.

Here's what's left on the 3D agenda:

  • Dragging selections
  • Add all of the various properties to lights within the editor (there's a ton of control possible here)
  • Complete chunk based system (mostly cleanup, eg. remove chunks that no longer have objects, etc.)
  • Add camera culling so that chunks off-screen are not drawn
  • Add the mouse-based transformation tools (scale, rotate, position)
  • Complete "materials" that take advantage of all of the (already completed) shader features, and allow for texture application. Then add material selection to the existing Shape3D objects.
  • Add a mesh component that renders 3D meshes (eg. .obj files, etc.)
  • Particles

This may seem like a long list, but this is quite a bit easier than the rendering itself was. I look forward to seeing the 3D graphics in action, when we move on to physics. I'll likely update as this work gets done. 3D rendering and shaders were a serious battle. I'm glad we're on this end of it.