Commit Graph

11 Commits

Author SHA1 Message Date
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