With this, we are able to get rid of all the increasingly broken file
system utility code, and trust std::filesystem to handle all the cross-
platform complexity.
Unfortunately std::filesystem support remains a little elusive; it is
well supported in Visual Studio (especially 2019), but not by default
in Mac OS X, and even in GCC 8.0 it requires an explicit '-l c++fs'.
This also silences some of the more egregious compiler warnings, mostly
by being explicit about where we cast to the uint32 types glTF prefers.
Alright, less haphazardly now after the two previous botched commits,
this fixes mistakes and bugs made a year or more in the past:
- We now always pass the metallic and roughness factors through all
the way to the glTF layer. They should not be multiplied into the
generated textures, and so they should be present as-is in glTF
output.
- We only generate the AO/Rough/Net combined texture if at least two
of the constituent textures are present.
- We only reference the generated texture as an occlusionTexture if
there really was an occlusion map present (and it had non-trivial
pixels).
It's also now ridiculously clear that:
- The material conversion section is long and tortured and it's very
easy to screw up. It should be broken into functions and classes.
- We urgely need a real regression suite, and we need to model some
artificial FBX files that test both realistic scenarios and edge-
case permutations.
Did not mean to commit/push the current state of master. But rather than
mess up source control history with a force push, I'll just try to hurry
to a stable point.