Commit Graph

60 Commits (c25a2dfc22ef47088d44f7dc83c3302ecc794168)

Author SHA1 Message Date
gstanlo 74e8200a49
Merge branch 'master' into master 2018-08-17 14:12:15 -07:00
gstanlo 82f3d40d60 Fixes crash when importing invalid glTF/2.0 files
Skips some glTF/2.0 uv processing if the count of uvs in the attribute stream doesn't match the vertex count.

This happens with some malformed glTF/2.0 files, and the change will allow them to be processed properly.
Without the change, an access violation will occur several lines below if uv count is less than the position count.
2018-08-17 13:49:01 -07:00
Alexandre Avenel 3c37fbdc6b Remove try catch(...) on gltf2 importer
Better to throw exception than hide it ?
2018-08-04 12:47:37 +02:00
Alexandre Avenel ae0f82d5b7 Fix #2077 : GLTF segfault using triangle strip 2018-08-04 12:47:37 +02:00
Kim Kulling a4533770f4
Merge branch 'master' into issue_2046 2018-07-14 19:25:07 +02:00
Sebastian Matusik 992194b1b9 Removed signed int vs unsigned int comparison in for loops 2018-07-05 15:15:50 +01:00
Sebastian Matusik 0cc9240886 Build fix 2018-07-05 14:46:15 +01:00
Sebastian Matusik 3e3a785750 glTF v2 importer morph targets support 2018-07-05 14:28:29 +01:00
Paul Arden e43e30b726 Slight rework for fix to issue #2046 to remove some duplicated code. 2018-07-05 09:49:08 +10:00
Paul Arden e7699ca585 Added support for non-indexed meshes in glTF importer. Addresses issue #2046. 2018-07-05 09:37:57 +10:00
gstanlo 97cecc858a Properly reads in glTF/2.0 sampler address modes.
Assimp was returning glTF/2.0 values as address modes instead of aiTextureMapModes.
Also modified text glTF/2.0 model's sampler uv address modes to mirror/clamp respectively, and tests for them in the unit test.
2018-05-24 17:25:26 -07:00
Stanlo Slasinski a1a17c1dda Read and write the KHR_materials_unlit glTF/2.0 extension. 2018-05-18 14:52:02 -07:00
kimkulling f2833539d7 closes https://github.com/assimp/assimp/issues/1784: change so.name to keep track of the minor version of the lib. 2018-04-19 08:52:21 +02:00
kimkulling da073f1270 closes https://github.com/assimp/assimp/issues/1893: fix mem leak in glft2Importer. 2018-04-11 17:22:31 +02:00
Kim Kulling b049933d2f update license dates. 2018-01-28 19:42:05 +01:00
Christian Meurin 925be5e983
Merge branch 'master' into master 2018-01-11 13:13:46 -08:00
Kim Kulling 88df886bcc
Merge branch 'master' into issue_1605 2018-01-11 11:39:14 +01:00
Christian Meurin 538bc95499
Merge branch 'master' into master 2018-01-10 20:10:54 -08:00
Axel Wefers 3e127bebff glTF 2.0: Import scale for normal textures and strength for occlusion textures
resolves #1693
2018-01-10 16:45:17 -08:00
Kim Kulling 936eb26dde
Merge branch 'master' into issue_1605 2018-01-11 00:54:35 +01:00
awefers bb71f2ba64
Merge branch 'master' into issue_1605 2018-01-10 12:04:41 -08:00
Kim Kulling 45d5f2eec8
Merge branch 'master' into issue_1691 2018-01-10 20:50:37 +01:00
Axel Wefers 901b981260 glTF: Always check signature
Always check signature for glTF 1.0 and glTF 2.0 files to select the correct importer. Fixes #1605
2018-01-09 09:37:57 -08:00
Axel Wefers dc79b572cf glTF 2.0: Assign default material to meshes with no material reference.
fixes  #1691
2018-01-08 14:57:55 -08:00
Axel Wefers 4235765856 glTF 2.0: Set camera "look at" to (0.0, 0.0, -1.0). 2018-01-08 14:19:30 -08:00
BuildTools 66171de915 Successful lib build, unit testing still WIP 2018-01-05 16:18:33 -08:00
Daniel Hritzkiv 98e98dc40c
Fix node names sharing same name
Uses node name if it is set, and globally unique id otherwise.

This may still break in some models (glTF2 spec doesn’t guaruntee name values to be unique). However, I couldn’t cause it to break any further using gltf2 models on hand.

Closes #1600
2017-11-29 12:20:44 -05:00
Kim Kulling 7a395e274f
Merge branch 'master' into fix/gltf2-transforms 2017-11-28 08:48:19 +01:00
Kim Kulling 8ce5985aa0
Merge branch 'master' into fix/gltf2-preserve-node-names 2017-11-28 00:50:07 +01:00
awefers 0031165789
Add support for tangents in glTF2.0 import
Closes #1562
2017-11-27 13:45:40 -05:00
awefers 0b04ae1d91
Preserve node names when importing glTF2.0
Closes #1522
2017-11-27 11:58:19 -05:00
awefers e53d4735b0
Fix transform matrices multiplication order per glTF2.0 spec
Closes #1568
2017-11-27 11:32:05 -05:00
Patrick Dähne 6cbfd5b977 [glTF2] Implemented reading binary glTF2 (glb) files 2017-11-20 14:59:05 +01:00
Thomas Lemaire 5b76a31485 fix trivial warnings
mainly unused parameter and unused function
some parameters are indeed used in a debug built, I used the
(void)(param) trick
warnings reported by clang 4
2017-11-02 11:13:52 +01:00
Daniel Hritzkiv 89358458f0
Approximate specularity / glossiness in metallicRoughness materials
Before, models (of traditional lighting models) with specularity/glossiness would be completely flat when exported to metallicRoughness. These changes approximate glossiness (as an inverse of roughness, with specular intensity as a multiplier) both reading from gltf2 and writing to gltf2.
2017-10-19 16:21:29 -04:00
Daniel Hritzkiv a898c1f2d1
SpecularFactor import and export improvements
The changes here (which only apply to reading from or writing to pbrSpecularGlossiness) will:

- store and read specular color on `AI_MATKEY_COLOR_SPECULAR ` rather than `AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_SPECULAR_FACTOR`
- store and read specular texture from `aiTextureType_SPECULAR` rather than `AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_SPECULARGLOSSINESS_TEXTURE`. Even though pbrSG’s specularGlossiness texture uses the alpha channel for glossiness, it will still work well enough with just the RGB channels of the image
2017-10-19 16:21:29 -04:00
Daniel Hritzkiv c71790c78d
Diffuse color and diffuse texture import and export improvements
These changes do a better of importing and exporting baseColor colors and textures, as well as diffuse colors and textures (in the case of pbrSpecularGlossiness)

- baseColorFactor will be stored on both `$clr.diffuse` and `$mat.gltf.pbrMetallicRoughness.baseColorFactor`, and will be extracted from `$mat.gltf.pbrMetallicRoughness.baseColorFactor` first, and falling back to `$clr.diffuse`. The behaviour for baseColorTexture is similar
- pbrSG’s diffuseFactor will now only be store on `$clr.diffuse` (overwriting any previous assignments to `$clr.diffuse`, e.g. from metallicRoughness’ baseColorFactor, as diffuseFactor is more analogous to diffuse color than baseColor), and will only extract from `$clr.diffuse`
2017-10-19 16:21:16 -04:00
Kim Kulling 81b94a1dca Merge pull request #1445 from Matter-and-Form/gltf2-alphaMode-fix
Fix glTF2 alphaMode storage and reading
2017-09-19 15:40:53 +02:00
Daniel Hritzkiv de0bf2ea96
Fix alphaMode storage and reading
alphaMode is now converted from a std::string to an aiString and back to std::string, since aiString is easier to store and retrieve from aiMaterial properties than std::string

Fixes issues of alphaMode being written out as `\fOPAQUE\0\0\0\0\0\0…`
2017-09-18 12:19:55 -04:00
Daniel Hritzkiv 5147acfe65
Revert "store node mesh vs. meshes"
This reverts commit a0d97505e5.
2017-09-18 11:16:04 -04:00
Jeremy Cowles c207e74534 Fix glTF 2.0 multi-primitive support
Previously, only one primitive was supported, in fact memory was corrupted
when more than one primitive was found per glTF mesh.

In this change, each primitive is unrolled as a new Assimp Mesh, resulting
in multiple Assimp meshes per node when multiple primitives exist per
glTF mesh. This is required in the general case, since glTF primitives can
have different material bindings and primitive modes.
2017-09-17 10:08:49 -07: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
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
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 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