Commit Graph

5610 Commits (455ff4ab813c875be9a09323b8db2dcd69cefa3a)

Author SHA1 Message Date
Daniel Hritzkiv b0da0796c8
Fix Segfault caused by losing pointer to std::string
Keep std::string alive
2017-09-12 10:07:15 -04:00
Daniel Hritzkiv 023cb27784
Revert "Remove simple gltf2 export unit test"
This reverts commit 4b01ecaf10.
2017-09-12 09:57:58 -04:00
Daniel Hritzkiv 4b01ecaf10
Remove simple gltf2 export unit test
Segfaults on Linux for some reason. No other tests test exporting, so it’s fine
2017-09-11 16:31:40 -04:00
Daniel Hritzkiv 86a8a58d12
Exclude glTF2 Exporter test when ASSIMP_BUILD_NO_EXPORT 2017-09-11 11:02:16 -04:00
Daniel Hritzkiv cde29c937c
Formatting 2017-09-11 11:02:16 -04:00
Daniel Hritzkiv b1a5ca4516
Use `forceNumber` argument of `WriteAttrs` to write correct attribute names, instead 2017-09-11 11:02:16 -04:00
Daniel Hritzkiv 990fe143a1
Fix mesh primitive’s attributes’ names
Per spec

TEXCOORD -> TEXCOORD_0
COLOR -> COLOR_0
JOINTS -> JOINTS_0
WEIGHTS -> WEIGHTS_0

Remove JOINTMATRIX since it’s not supported (and doesn’t seem to be output, anyway)

TANGENT should be added at a later date
2017-09-11 11:02:16 -04:00
Daniel Hritzkiv 816e6909ca
Remove KHR_binary_glTF code
Binary glTF is now part of the glTF2 spec. However, it’s implemented incorrectly, so will be temporarily removed
2017-09-11 11:02:16 -04:00
Daniel Hritzkiv b4f5033d89
Remove compresssed file format flag 2017-09-11 11:02:16 -04:00
Daniel Hritzkiv ed2b699c4b
Add gltf2 basic unit test 2017-09-11 11:02:15 -04:00
Daniel Hritzkiv d518289e72
more specific token search for Collada Loader
collada can appear in many files, such as glTFs via the “generator” field (in the form of collada2gltf)
2017-09-11 11:02:15 -04:00
Daniel Hritzkiv 5cb13aa4b3
Load gltf .bin files from correct directory 2017-09-11 11:02:15 -04:00
Daniel Hritzkiv a438ece655
Remove premultipliedAlpha from gltf2 2017-09-11 11:02:15 -04:00
John Senneker 140b903d7a
Fix parsing of glTF version
Handle version as int in gltf
Fix format specifiers in glTF version parser
2017-09-11 11:02:15 -04:00
John Senneker 19876e9822
Add support for importing both glTF and glTF2 files 2017-09-11 11:02:15 -04:00
John Senneker 2ee7991558
Restrict search for OFF header to first 3 bytes 2017-09-11 11:02:14 -04:00
Daniel Hritzkiv a5e8e0b2bd
Remove commented out code 2017-09-11 11:02:14 -04:00
Daniel Hritzkiv 0a8183531e
Set alphaMode, baseColorFactor opacity when model’s opacity isn’t 1 2017-09-11 11:02:14 -04:00
Daniel Hritzkiv 37582131f4
Set the metallicFactor to 0 if source file doesn’t have metallicFactor
Otherwise, the models have full metallic materials and appear very dim
2017-09-11 11:02:14 -04:00
Daniel Hritzkiv da6a252efb
Fix METALLIC_FACTOR typo 2017-09-11 11:02:14 -04:00
Daniel Hritzkiv 3ba00ca421
Define gltf material property names as constants 2017-09-11 11:02:14 -04:00
Daniel Hritzkiv 54dd4804cd
Fix indentation 2017-09-11 11:02:14 -04:00
Daniel Hritzkiv 44757af34a
Implement pbrSpecularGlossiness property as Nullable 2017-09-11 11:02:13 -04:00
Daniel Hritzkiv 03cfa04ee4
Define default material values as static constants
for reuse
2017-09-11 11:02:13 -04:00
Daniel Hritzkiv 1a5823700f
Remove need for Has by returning an empty Ref in Get 2017-09-11 11:02:13 -04:00
Daniel Hritzkiv 21259e0835
Use different form of index accessor 2017-09-11 11:02:13 -04:00
Daniel Hritzkiv 37527849b7
Export material names properly 2017-09-11 11:02:13 -04:00
Daniel Hritzkiv a9c4fa84b5
Sampler improvements; Add new LazyDict method
Samplers are now imported into assimp internal format from textures;
Samplers have defaults as per spec;
Sampler enums are strongly typed with UNSET values;
Samplers are exported properly;
Sampler filters are exported as well;
Samplers are re-used across textures on export
Default sampler values are not written
2017-09-11 11:02:12 -04:00
Daniel Hritzkiv 7245cceead
Set default values on Sampler 2017-09-11 10:55:51 -04:00
Daniel Hritzkiv 2abdbdb55e
Fix unused CopyValue 2017-09-11 10:55:51 -04:00
Daniel Hritzkiv 63ef19d9ad
Export extensions 2017-09-11 10:55:51 -04:00
Daniel Hritzkiv d277995a97
Formatting 2017-09-11 10:55:51 -04:00
Daniel Hritzkiv 7f01e3f48f
Only export byteStride if not 0 2017-09-11 10:55:50 -04:00
Daniel Hritzkiv a0d97505e5
store node mesh vs. meshes
glTF nodes can only hold one mesh. this simply assigns to and check’s a Node’s Mesh
2017-09-11 10:55:50 -04:00
Daniel Hritzkiv ab08a7c3cb
reenable animation and skins exports
Currently incorrect, however. May need to be removed
2017-09-11 10:55:50 -04:00
Daniel Hritzkiv f09892ab63
Write specularGlossiness textures on the specularGlossiness object 2017-09-11 10:50:39 -04:00
Daniel Hritzkiv feee7528d6
Make sure `on` flag for specularGlossiness is being persisted 2017-09-11 10:50:39 -04:00
Daniel Hritzkiv 8bef546b41
mention pbrSpecularGlossiness support 2017-09-11 10:50:39 -04:00
Daniel Hritzkiv 2d54019b8f
Remove OPEN3DGC and compression references 2017-09-11 10:50:39 -04:00
Daniel Hritzkiv 562920fbb8
Changes to GLTF2 materials
pbrMetallicRoughness and pbrSpecularGlossiness as structs; persist textureinfo properties from start to finish; persist pbrSpecularGlossiness (via extensionsUsed) usage from start to finish
2017-09-11 10:50:39 -04:00
Daniel Hritzkiv 7532d6aac1
Remove Light, Technique references 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 863458cd4a
Start removing materials common, and adding pbrSpecularGlossiness 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 7615a97cd3
Remove redundant function 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 0cf69479c3
Use `!ObjectEmpty()` vs. `MemberCount() > 0` 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 11cb9ac139
Working read, import, export, and write of gltf2 (pbr) material 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 6b4286abf6
check in gltf2 models to test directory
Remove un-needed test models
2017-09-11 10:50:38 -04:00
Daniel Hritzkiv b42d785afe
Start managing and importing gltf2 pbr materials 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 67eb3b0608
temporarily disable gltf exporting of animations and skins 2017-09-11 10:50:38 -04:00
Daniel Hritzkiv 39172feb3e
Start reading pbr materials 2017-09-11 10:50:37 -04:00
Daniel Hritzkiv 4d59dee5ea
Cache retrieved items via an original index map 2017-09-11 10:50:37 -04:00