I was thinking why not use some render library like bgfx bgfx – Cross-platform rendering library
Diverting some maintenance of the render could save you work and you could focus on different tasks.
Here some quotes from author:
“bgfx is made to be portable without sacrificing performance. For example, if you made game with bgfx for mobile (using GLES2 backend) and used ETC2 textures for you content, and you want to port your game to desktop and use DX11, you don’t need to change anything about those textures, because bgfx internally handles them properly. So even DX11 doesn’t support ETC2 textures, it will display them correctly. That allows you to do port as quickly as possible, and then deal with content if that’s necessary. It works the same in other direction too. For example you compress something with DXT5 and mobile GPU doesn’t support it, texture will be uncompressed and used that way.
bgfx uses single shader source which is written in GLSL style syntax, and then it gets translated to ESSL, HLSL, GLSL, etc.”
“Major differences between other rendering engines is that bgfx is not trying to be engine, but rather just rendering library (bring your own engine). It doesn’t do lighting, it doesn’t do shadows, object culling, loading assets, or any of higher level concepts.”
“It’s on higher level than GLES, GL, DX, but on lower level than Ogre.”
“-Rendering can be run in a thread, all of it:
Yup, that’s exactly how bgfx works, it has API thread, and rendering thread, or all can be single-threaded on platforms that don’t support it. And it’s all implemented inside library so running multi-threaded or single-threaded is completely invisible to user of library.”
“bgfx philosophy is to be graphics API agnostic. So if someone wants DX9 for any reason, like shipping games on XP in 2015, they can do that.”
“But other than that, if it lacks any extension you’re using in GLES2, or you need some feature to support your feature set, just let me know and I’ll add support for it.”
“Another feature of bgfx is that it’s not just sending things in order you submit, but rather it sorts primitives before rendering. This allows engine to go thru scene only once and submit rendering for all passes at once (f.e. no separate shadow, and rendering pass, just submit both passes at the same place). There is no need to go thru scene multiple times for multiple passes, which lowers amount of data that needs to be loaded from RAM to cache when processing scene, and in most of cases also makes scene code simpler.”
“bgfx shader language is closest to GLSL, and it uses subset compatible with HLSL. If you seen SteamDevDays talk from Valve about their cross platform shader solution, bgfx’s shader language is very similar, they just use ANTLR parser to enforce correctness, bgfx uses some preprocessor magic stuff. Which is not as robust as Valve’s solution, but bgfx supports lower end shaders than Valve, and making shader language more robust in bgfx is ongoing effort.”