Commit Graph

20 Commits

Author SHA1 Message Date
Par Winzell 95063ba9f1 Move to C++17 and std::filesystem.
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.
2019-04-07 16:21:24 -07:00
Par Winzell 910a8bfdd0 Left-over debug line. 2019-04-03 10:37:13 -07:00
Par Winzell 1f21a50cc9 Fix the previous fixes.
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.
2019-03-29 19:56:33 -07:00
Par Winzell 46f6234af5 Fix previous fix. 2019-03-29 10:29:59 -07:00
Par Winzell d2f7d0e270 Generally repair old broken logic around aoMetRough texture. 2019-03-29 09:59:57 -07:00
Michael Tostenson 9c114ffa49 Only create aoMetRoughTex when metalnesss or roughness texture provided 2019-03-26 17:28:10 -07:00
Par Winzell a596073f04 Identify materials by unique ID, not name.
At the end of the various material/mesh transformations we do, we were still using a ridiculously simplistic method of mapping RawMaterial to glTF MaterialData.

This switches to using FBX's GetUniqueID(), which should be the law of the land in general. Other model entities may need further investigation as well.
2019-02-24 19:32:13 -08:00
Par Winzell e83d495fdc Fix Draco. How long was this broken? 2019-02-22 23:02:14 -08:00
Par Winzell ffd6af3142 Fixes to lights. Oops. 2019-01-25 15:14:37 -08:00
Par Winzell ce2a9f8d85 Handle 'inverse roughness' flag. 2019-01-25 14:33:53 -08:00
Pär Winzell 5730d1c301
Apply clang-format to all our source. (#149)
Apply clang-format to all our source.
2018-12-18 23:30:29 -08:00
Pär Winzell be1b75431d
Switch from CXXOPTS to CLI11. (#148)
We want to move to auto-formatting all our code, and it just seemed impossible
to make cxxopts usage tidy under clang-format's dominion. While trying to work
out its quirks, I realised that CLI11 did everything I wanted much better, and
so we've switched.

We're also going to chuck the usage of ExternalProject_Add(), at least for the
simplest use cases such as single-header include files. We'll just commit them
directly; that's kind of the whole point.

The one discipline we'll maintain is that commits that involve third_party/
should be as self-contained as possible (without breaking the app).
2018-12-17 16:13:53 -08:00
Par Winzell 5389d848e2 Implement KHR_lights_punctual. 2018-12-17 10:21:43 -08:00
Graham Wihlidal f2cb6a1010 Fix various tabs vs spaces formatting inconsistencies 2018-12-13 23:00:05 -08:00
Graham Wihlidal 8b081a5fc3 Implemented support for exporting user properties assigned to materials 2018-12-13 23:00:05 -08:00
Pär Winzell 319c0fe460 Wrap user properties in a command line option. 2018-10-14 21:46:49 -07:00
Pär Winzell bbbba646de Massive reorganisation.
This finishes the first phase of the FBX2glTF refactor, breaking utility classes out where things were getting too monolithic.

There is an equally important cleanup phase coming where we wrench all the various parts of this code, including the historical ones that we've rarely touched as yet, into a single C++ style paradigm, and modernise everything to C++11 at least.

But for now, we're just picking the pieces back on the floor so we can push 0.9.6 out. It's been far too long since a release.
2018-10-13 20:15:12 -07:00
Michael Ranieri 2e03a3cdea Transcribe FBX Custom Properties 2018-10-13 19:23:48 -07:00
Artem Titoulenko 5282f693f9 Blend shape keys to accessor names (#122)
Map blendshape keys to accessor names
2018-09-25 16:09:18 -07:00
Par Winzell f988cb7aa7 Missing bits, oops.
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.
2018-09-13 17:21:57 -07:00