Graphics Refactor Plans

Instead of the current setup in which rendering for an object fails if the drawable, texture, or material have any sort of mismatch, there would be only one structure: a Renderer.

The Renderer structure would contain that which is currently split across 3 different structures. Its job would be to take all of the components (each VBO making up the mesh, all of the texture resources, constants such as ambient light levels, and the effect file) and create a working way to draw any given positionable. This will not be as efficient as the previous setup in terms of bind/unbind calls, but it will be more powerful.

This would coincide with the addition of an effect file parser, and a simple preprocessor for shaders. (example) Effects can be created for multiple GLSL versions, with or without major engine features such as HDR, MSAA, deferred shading; and with or without other resources within the render, such as the presence of texture coordinates or specular maps.

This will also allow very simple live-editing of in-game options, making it so the engine will almost never need to be restarted. In addition, it will simplify in-game shader recompilation, and hot reloading of shaders. It will also simplify the object tracker, and the overall rendering path, as well as implementing most of what's necessary for render clusters.

In addition to splitting rendering into external threads, it will make it vastly simpler to support multiple OpenGL versions - there will be a very confined area where all of the OpenGL calls are done. The following file list is, roughly, where all the calls would be located:

The scene graph hierarchy, after all of my planned refactors, will be something along these lines:

Scene Graph