Commit Graph

30 Commits

Author SHA1 Message Date
Pär Winzell 70136c6f53
Fix iconv on mac (#208)
The FBX SDK is compiled against a regular libiconv on Windows on Linux (with symbols libconv_open() etc) but on Mac, they compiled it against Apple's modified libiconv, which renames those functions. Annoyingly this means we need to explicitly decline the Conan libiconv package, for that platform only.
2019-06-11 22:42:31 -07:00
Par Winzell ec98db9762 Strip nonsense include directories. 2019-06-11 14:31:30 -07:00
Pär Winzell 3afd9f3266 Get zlib, libxml2 and iconv all from Conan. 2019-06-04 22:44:50 -07:00
Pär Winzell 25ef9167ed Simplify build, document it somewhat. 2019-06-01 12:48:16 -07:00
Pär Winzell 4b501431fe
License -> BSD (#186)
Relicense FBX2glTF as BSD.
2019-05-03 16:13:18 -07:00
Pär Winzell 7dd8438c78
Embrace Conan, use it to grab boost::filesystem. (#180)
With this, we are able to get rid of all the increasingly broken file
system utility code, and trust boost::filesystem to handle all the
cross-platform complexity.

The first version of this PR centred around C++17 & std::filesystem,
but support remains too elusive; it seems works out of the box in
Visual Studio (especially 2019), but is entirely missing from the Mac
dclang, and even with GCC 8.0 it requires an explicit '-l c++fs'.

Luckily the std:: version is almost exactly the boost:: version (not
surprising) so when the world's caught up, we can ditch Boost and go
all stdlib.

Setting up Conan requires a bit of work; we'll want to document the
details in the README.
2019-04-19 23:54:11 -07:00
Par Winzell c6ed20a45a Commit JSON header-only dependency to our repo. 2019-03-29 20:05:01 -07:00
Par Winzell 9d4a599d0c Pin STB header files at working versions. 2019-02-22 17:11:34 -08:00
Par Winzell d451aa73f3 Delete obsolete classes, poke at Physical Material support.
Looks like I never did the required cleanup after my accidental commit back in August.
This deletes the materials classes that were obsoleted back then, and comments out the
large swathes of PhysicalMaterial code that's not currently doing anything (i.e. all the
materials properties that glTF can't currently represent.)
2019-01-16 13:52:33 -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 09089a7d79 Create a compilation database. 2018-12-16 12:41:40 -08:00
Par Winzell f71be404f4 Remaining fixes for 2019.2. 2018-12-07 09:52:38 -08:00
Par Winzell c1faf6b822 I'm going to stab someone. 2018-12-04 10:01:07 -08:00
Par Winzell 90e5bef116 Better iconv handling. Jeez, CMake... 2018-12-04 09:54:08 -08:00
Par Winzell 3e0aa3565c Don't require iConv; it can be builtin. 2018-12-04 09:29:39 -08:00
Par Winzell 073f06aa13 Do the right thing with ICONV. Needed for Mac now. 2018-12-04 08:56:05 -08:00
Par Winzell e990432ecf Require 2019.2 henceforth. 2018-12-03 22:19:25 -08:00
Par Winzell fe2aa11516 Mark third-party headers as such.
This avoids spammy compiler warnings in code we don't care about.
2018-12-02 19:03:02 -08: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
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
Par Winzell b475fbead4 Accept multiple SDK versions as valid. 2018-09-13 12:30:06 -07:00
Par Winzell 891cf668b9 Fix order of linked libraries. 2018-09-13 10:39:21 -07:00
Par Winzell d3f9a269ba Customisable Draco encoding options. 2018-05-08 09:01:58 -07:00
Par Winzell cb76a49b82 List all sources in CMakeLists.txt.
If nothing else, it helps IDEs do the right thing.
2018-04-08 15:47:27 -07:00
Par Winzell cbd2e3f00d Use newer Draco. 2018-02-02 06:58:17 -08:00
Pär Winzell fdf7bb3336 Support for Stingray PBS material definitions (#47)
This adds the first FBX PBR import path. Materials that have been
exported via the Stingray PBS preset should be picked up as native
metallic/roughness, and exported essentially 1:1 to the glTF output.

In more detail, this commit:
- (Re)introduces the STB header libraries as a dependency. We currently
use it for reading and writing images. In time we may need a more
dedicated PNG compression library.
- Generalizes FbxMaterialAccess to return different subclasses of
  FbxMaterialInfo; currently FbxRoughMetMaterialInfo and
  FbxTraditionalMaterialInfo.
  - FbxTraditionalMaterialInfo is populated from the canonical
    FbxSurfaceMaterial classes.
  - FbxRoughMetMaterialInfo is currently populated through the Stingray
    PBS set of properties, further documented in the code.
- RawMaterial was in turn generalized to feature a pluggable,
  type-specific RawMatProps struct; current implementations are,
  unsurprisingly, RawTraditionalMatProps and RawMetRoughMatProps. These
  are basically just lists of per-surface constants, e.g. diffuseFactor or
  roughness.
- In the third phase, glTF generation, the bulk of the changes are
  concerned with creating packed textures of the type needed by e.g. the
  metallic-roughness struct, where one colour channel holds roughness and
  the other metallic. This is done with a somewhat pluggable "map source
  pixels to destination pixel" mechanism. More work will likely be needed
  here in the future to accomodate more demanding mappings.

There's also a lot of code to convert from one representation to
another. The most useful, but also the least well-supported conversion,
is from old workflow (diffuse, specular, shininess) to
metallic/roughness. Going from PBR spec/gloss to PBR met/rough is hard
enough, but we go one step sillier and treat shininess as if it were
glossiness, which it certainly isn't. More work is needed here! But it's
still a fun proof of concept of sorts, and perhaps for some people it's
useful to just get *something* into the PBR world.
2017-11-30 22:23:50 -08:00
Pär Winzell f61814f7c9
Pin Draco at 1.2.0, for now
As @robertlong discovered, there are compilation errors in newer Draco patch releases under Win/VS 2017.
2017-11-21 19:10:45 -08:00
Par Winzell 423458a841 Construct JSON with explicit key order.
We are at liberty to order our JSON any way we like (by spec) and we can
improve readability a lot by doing so. By default, this JSON library
uses an unordered map for objects, but it's relatively easy to switch in
a FiFo map that keeps track of the insertion order.
2017-11-17 11:37:19 -08:00
Par Winzell c70ded31d5 Explicit versions of dependencies.
As we approach 1.0.0 we can't just download whatever someone's slammed
into the master branch of our various open source dependencies.
2017-11-16 18:19:52 -08:00
Par Winzell 276a0dfb86 Initial commit. 2017-10-13 01:55:11 -07:00