Instanced .glb assets in new renderer
Captain's Log: Stardate 78206.5
Today I decided to focus on writing the code for the new renderer that loads assets, creates instances for them, and then does all the transformations to draw them on the screen. This was pretty straightforward, as most of it was just porting from glm:: vector/matrix operations to filament::math:: equivalents. The one tricky bit was figuring out how to efficiently add and remove entity instances from the scene, but ultimately that turned out to be pretty straightforward.
I started by re-exporting all of my Blender models as .glb. This gives me geometry, but because my old handmade OpenGL engine did textures separately, my Blender models don't have textures and thus the .glb files don't either. At some point I will go through them and add the textures, but I haven't done that yet. (This is slightly painful, because really I just want to pay someone to start over and redo all the models and give them really nice shapes and textures, which means that my texturing work will be wasted. But I'll probably do it anyway to get textures in the meantime.)
So everything is just a flat gray color for now. But one cool aspect is that Filament does shadows and ambient occlusion by default, so I magically get those, which you can kind of see below.
Another thing I'm quite excited about is to add a proper skybox, and have indirect lighting and reflection maps computed based on its irradiance. The "metal" masses have never looked metallic, and the lack of reflection maps and environmental lighting are the main reasons. So this should help a lot in terms of making metallic things look metallic.
At this point all the entities are displayed correctly (in terms of position/rotation/etc). However there are still missing renderer features, such as the 2D overlay for the selection box (and eventually hover-over GUI elements). And I don't yet know how I'm going to highlight the selected entities. I think I'm going to have to compile my own Filament material to give it a selection color uniform.
Another thing I am realizing I need to do now is asset caching. I had this working really well with my hand-written renderer, and now that's blown. It's really important because when running as a plugin in a DAW, every time you open and close the GUI it is completely loaded and destroyed. And if there are multiple instances of the plugin, they'll both load assets. So it's all just too slow and annoying to not cache them across instances / GUI loads.