Commit Graph

509 Commits

Author SHA1 Message Date
Par Winzell 70c3823eb7 Fix 'spot' light export. 2019-02-21 12:45:02 -08:00
Pär Winzell 5ec3184a8a
Mocha integration test suite (#150)
This moves ./npm to ./npm/fbx2gltf, and introduces a Mocha / TypeScript based testing harness. 

We're also adding a GIT LFS dependency, but only for people who want to run tests. We're using LFS to store the many FBX models we want to convert to GLB as part of the integration test suite.
2019-01-25 16:01:08 -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
Par Winzell d0883136d3 First cleaned-up, consistent physical material implementation.
There's still work to be done here, mainly:
 - Convert BUMP to NORMAL
 - Apply "roughness inversion" to roughness map

But it now informs the user of unsupported properties their model uses,
and generally works correctly!
2019-01-25 10:51:30 -08:00
Par Winzell a3bee2e42a Tiny order tweak. 2019-01-24 17:03:24 -08:00
Par Winzell 12025de179 Don't discriminate textures only by FBX logical name.
We don't want to use the logical texture name from the FBX to distinguish separate textures. It seems entirely valid for distinct textures to have the same name. It's not completely clear what's best to use instead, but adding fileLocation seems reasonable. It can be blank, for textures that don't exist on the filesystem –– but that's a pretty weird edge case, and even then we have both 'usage' and 'name' to distinguish.
2019-01-24 16:59:36 -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
Par Winzell 1328a4b96f Another, better argument parsing fix. 2019-01-11 20:47:08 -08:00
Par Winzell 5c07d274c3 Fix broken U/V flipping. 2019-01-11 19:38:33 -08:00
Par Winzell 1145defda3 Use case-insensitive matching on old shader types. 2018-12-19 14:22:58 -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
Par Winzell 09089a7d79 Create a compilation database. 2018-12-16 12:41:40 -08:00
Par Winzell 49892c5e83 Abstract out user property serialisation. 2018-12-14 00:05: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
Par Winzell 7374bcf34f No default argument in implementation. 2018-12-12 12:46:45 -08:00
Par Winzell f71be404f4 Remaining fixes for 2019.2. 2018-12-07 09:52:38 -08:00
Pär Winzell 62bb8710c0 Fix cross-platform path handling.
This is a recreation of the PR @robertlong submitted long ago here:
https://github.com/facebookincubator/FBX2glTF/pull/97

Refactors and whitespace conflicts made this easier.

There is still a substantial rewrite of the texture-loading and
file-path handling pending, for sometime soon.
2018-12-07 09:40:21 -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
Par Winzell 2029fa7277 Delete unused variable. 2018-12-02 19:02:24 -08:00
Par Winzell a65628f56f Specify that we want std::isnan().
Depending on platform, multiple versions of isnan() can easily be floating around, causing compilation headaches. Luckily we can always rely on the standard library implementation.
2018-12-02 19:00:42 -08:00
Pär Winzell c34f861f69 Don't force RTTI for one measly cast. 2018-10-28 16:03:52 -07:00
Michael Ranieri d38ccd935f fix fov computation from fbxsdk (#133)
* fix fov computation from fbxsdk
2018-10-22 18:32:20 -07:00
Michael Ranieri efd404764d Fix camera rotation from FBX, fix illegal memory access of binary data 2018-10-19 01:05:48 -07:00
Par Winzell 6e527563cd Add more Copyright boilerplate. 2018-10-15 15:24:07 -07:00
Par Winzell 0c94cb5706 Add Facebook's generic Code of Conduct file. 2018-10-15 15:19:36 -07: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
Par Winzell 2a4da70de0 Make the JSON library ambiently available. 2018-10-13 19:25:18 -07:00
Michael Ranieri 2e03a3cdea Transcribe FBX Custom Properties 2018-10-13 19:23:48 -07:00
Par Winzell f646be2e47 Both DIFFUSE and ALBEDO can dictate transparency. 2018-10-02 16:59:41 -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
Pär Winzell 52de0d20d8
Typo fix on Fbx2Raw.cpp
Thanks @fire for the report. Fixes #128.
2018-09-24 20:24:30 -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 7d36e7f4d7 Rearrange, extract, clean up.
Hopefully without unintentional changes to functionality. This renames header
files to .hpp, imposes a gltf/raw/fbx directory structure, extracts standalone
chunks of Fbx2Raw into distinct files, and undoes some particularly egregious
mistakes from when I knew even less C++ than I do now.

This is in anticipation of implementing 3ds Max's "Physical Material".
2018-09-13 16:55:24 -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
Pär Winzell 2fc254ed79
Update example command-line switch 2018-09-08 11:35:10 -07:00
Matt Brown 9c84e14ddc fixed typo in Describe function for specular 2018-08-19 18:24:52 -07:00
Pär Winzell bdcf16f042
Trivial typo fix.
Thanks to @ale64bit for pointing this out.
2018-08-19 18:24:16 -07:00
Pär Winzell 7995f7b341 Resolve _WIN32 isnan() fiasco completely. 2018-05-27 13:28:49 -07:00
Par Winzell d3f9a269ba Customisable Draco encoding options. 2018-05-08 09:01:58 -07:00