Commit Graph

10 Commits

Author SHA1 Message Date
Par Winzell 39cb6bd789 Merge branch 'master' into feat-morph-targets 2017-11-04 20:13:47 -07:00
Pär Winzell 5e0f05261c
Sort triangles with vertex transparency separately. (#32)
Lean on the excellent pre-existing support for creating multiple glTF
meshes from a single FBX mesh based on material type. All the triangles
with (at least one) non-opaque vertex get flagged as transparent
material. They will all go separately in their own mesh after the
CreateMaterialModels() gauntlet.

Fixes #25.
2017-11-04 20:10:28 -07:00
Par Winzell 9520c26649 Drop 0-100 assumptions. Let influences go wild. 2017-11-03 23:36:59 -07:00
Par Winzell 91a783dc2d Much progress with morph targets.
Everything's in place to drop the progressive morph calculations into
readAnimations(). Shouldn't be hard.

Normals are proving trickier. I'm not convinced they make it into the
FBX at all. The SDK reports the existence of normals in the primary
layer, but they seems to consist exclusively of zeroes.

We may have to compute them.
2017-10-29 22:25:14 -07:00
Par Winzell 77470e236e First functional morph shape export.
- This does not support progressive morphs. Still evaluating whether
  that's required functionality. It's really just a little bit of more
  work. An example implementation is available in the SDK samples.

- We're blithely ignoring NORMALs and TANGENTs. This almost certainly
  has to change.
2017-10-29 01:59:51 -07:00
Par Winzell 1829f6d6a6 RawSurface.skinRigid not used. 2017-10-27 15:31:32 -07:00
Pär Winzell 8cf7f446b7 Further improvemens to texture resolution. (#16)
* Further improvemens to texture resolution.

- Move towards std::string over char * and FbxString where convenient,
- Make a clear distinction between textures whose image files have been
  located and those who haven't; warn early in the latter case.
- Extend RawTexture so we always know logical name in FBX, original file
  name in FBX, and inferred location in local filesystem.
- In non-binary mode, simply output the inferred local file basename as
  the URI; this will be the correct relative path as long as the texture
  files are located next to the .gltf and .bin files.

Primary remaining urge for a follow-up PR:

- We should be copying texture image files into the .gltf output folder,
  but before that we should switch to an off-the-shelf cross-platform
  file manipulation library like https://github.com/cginternals/cppfs.
  When we make that transition, all this texture resolution code will
  undergo another refactoring.
2017-10-20 09:42:39 -07:00
Par Winzell b44d3b19a8 Fix build across all platforms. 2017-10-17 17:56:21 -07:00
Par Winzell e6cd0f012b Propertly transform UV coordinates.
We were mapping v to -v rather than 1-v, with fairly catastrophic
results. While fixing, take the trouble to introduce a more general
transformation mechanism than just an affine matrix.
2017-10-16 23:02:46 -07:00
Par Winzell 276a0dfb86 Initial commit. 2017-10-13 01:55:11 -07:00