Ubershaders vs just-in-time compilation
Captain's Log: Stardate 78223.2
Today I spent some time figuring out why the new Filament renderer took a little longer to load than I wanted. It turns out that virtually all the loading time came from the fact that I was using the JIT shader system, which makes sense because it had to compile a shader for every different combination of material properties that I used. This is great for rendering efficiency, as the shaders only include the minimum code needed to support the given features, but it imposes a startup delay that cannot be avoided because Filament does not offer async compilation.
Anyway the solution for now is to use the "ubershader" model, which is a little bit less efficient on the rendering side, and loads almost instantaneously. I can't measure a performance difference for the shaders, probably because Anukari's scene is so simple. So this will suffice for now. Later I can always build my own materials that are both minimal and precompiled, to get the best of both worlds.
After getting the 3D renderer loading more quickly, I worked on getting the GUI elements that float above the 3D renderer to work. Initially I was planning to implement these in Filament, which would be ultra-fast. But I thought it about it some more, and realized there were issues, like font rendering, that I didn't want to have to deal with. So instead, I ended up implementing the floating GUI via native OS child windows that are displayed above the renderer.
This works great, and is efficient. The only drawback is that at least on Windows these OS windows can't have transparency, so I will have to redo the circular GUI buttons as square buttons. Which... will probably look better anyway. These buttons were always going to be replaced, so it is not a big loss.
All of this work means that I'm much closer now to releasing a new pre-alpha build of Anukari. Barring anything unforeseen, I think I can do that within a week. This is exciting, since this will be the first build that uses Metal for all the GPU work on MacOS (both audio and graphics), which I am hoping helps with the performance issues that some people are seeing.