Commit Graph

50 Commits

Author SHA1 Message Date
Janusz Bossy 573cdc244f Adds texture overrides for independent materials
Allows passing a `materialOverrides` option to the `loadMtl` function.
When generating a new material parsed from the `.mtl` file the overrides
that are specific to this material are applied first before the global
material overrides already existing in the code. This allows the users
to specify different set of materials to override for a model. Following
is an example value for the `materialOverrides` key:

```
{
  "material1Name": {
    "alphaTexture": "path_to_the_texture_file",
    "ambientTexture": "path_to_the_texture_file",
    "diffuseTexture": "path_to_the_texture_file",
    "emissiveTexture": "path_to_the_texture_file",
    "normalTexture": "path_to_the_texture_file",
    "specularTexture": "path_to_the_texture_file",
    "specularShininessTexture": "path_to_the_texture_file",
  }
}
```

It's possible to define more than one material override. If the `.mtl`
file has materials that were not provided in the `materialOverrides`
option they are loaded from the `.mtl` file without any overrides.
2020-07-07 15:45:28 +02:00
Jesse Vander Does 876cbefe74 Restored lost code and fixed tests 2019-08-19 16:33:12 -07:00
Sean Lilley 3cf338107d Added up axis options back 2019-08-19 11:01:36 -07:00
Sean Lilley 075beb60d4 var to let/const 2019-02-05 22:03:42 -05:00
Omar Shehata 7e9a7a87b8 Cleanup 2018-12-04 14:34:04 -05:00
Omar Shehata e8fc8ab04e Replaced materialsCommon with unlit 2018-08-30 15:55:32 -04:00
Sean Lilley c5851f49ea Use coerce instead 2018-03-31 11:27:47 -04:00
Sean Lilley 96b8d17009 Handle -i -o without following name 2018-03-30 09:54:51 -04:00
Sean Lilley 260b3e67e3
Merge branch 'master' into alpha-texture 2018-01-19 10:44:37 -05:00
Sean Lilley 15d078f764 Fix output name 2018-01-11 13:32:30 -05:00
Sean Lilley 378479b8f1 Added alpha texture support 2018-01-03 21:01:10 -05:00
Sean Lilley 60a080be46 Reorganization of material loading and returning buffer rather than writing file 2017-08-08 15:09:00 -04:00
Sean Lilley 487eca91f8 Move incompatible argument checking to bin file 2017-07-28 17:34:56 -04:00
Sean Lilley 3da691df62 Cleanup overriding images 2017-07-28 17:01:45 -04:00
Sean Lilley e54f3af37f Async image reading/writing and other cleanup 2017-07-27 11:28:14 -04:00
Sean Lilley 8d491afc70 bin script tweaks 2017-07-24 21:32:51 -04:00
Sean Lilley 3b4e30d5e3 Supply images on the command line 2017-07-24 21:26:56 -04:00
Sean Lilley aaf44e75dc Fix incompatible byte strides 2017-07-19 17:56:24 -04:00
Sean Lilley ab6786e463 Remove dependence on gltf-pipeline and added gltfToGlb function 2017-07-19 13:23:06 -04:00
Sean Lilley 44e9d5fa3b Add back KHR_materials_common 2017-05-04 15:39:01 -04:00
Sean Lilley dc4ba7fc6a Merge branch 'master' into gltf-2.0 2017-05-04 14:34:33 -04:00
Sean Lilley c9ad66fcdb Add metallicRoughness and specularGlosiness output 2017-05-04 14:25:08 -04:00
Sean Lilley 93dac5ebdc Convert up axis 2017-04-20 14:43:59 -04:00
Sean Lilley d6d0d392c6 Remove occurences of khr_materials_common for code (not tests yet) 2017-04-20 10:23:00 -04:00
Sean Lilley 37febbcd93 Renaming files 2017-04-12 16:55:03 -04:00
Sean Lilley cc8fee19c4 Many updates 2017-04-11 17:38:03 -04:00
Sean Lilley 965402c535 Handle file path errors and better promise handling 2017-04-05 10:44:28 -04:00
Sean Lilley 02c3aa18db Support KHR_materials_common output 2017-04-04 17:55:00 -04:00
Sean Lilley 3c958e1d86 Add secure checking of paths 2017-04-04 16:45:21 -04:00
Sean Lilley e4b3ad5409 Style 2017-04-04 15:09:58 -04:00
Sean Lilley 83e7723b1c Transparency and other updates 2017-03-21 14:43:09 -04:00
Sean Lilley 05b1e3adbd Added flag checkTextureAlpha 2017-03-17 16:13:00 -04:00
Sean Lilley 41956dd70d Output separate resources even when --bypassPipeline is set 2017-03-14 16:42:42 -04:00
Sean Lilley b8b118bca0 Refactor and tests 2017-03-14 10:43:28 -04:00
Sean Lilley c79684b10e Added compress flag and updated version number 2016-08-25 13:48:34 -04:00
Sean Lilley 2d6e0d16c9 Added --cesium option and bumped version number 2016-07-25 19:12:41 -07:00
Robert Taglang b9e8079f76 Added catch to binary endpoint 2016-07-22 16:27:20 -04:00
Robert Taglang 68582967ac Changed callback code to promises 2016-07-22 14:09:13 -04:00
Sean Lilley 3169452ca0 Instead of -e command line flag, use -s or -t 2016-07-20 14:23:58 -04:00
Sean Lilley ad0866efde Added ao option 2016-07-12 18:14:56 -04:00
Sean Lilley d4131a956c Support quantize option 2016-06-24 14:04:12 -04:00
Sean Lilley 462c80fbc0 Use default values 2016-06-23 21:21:21 -04:00
Sean Lilley 1ae572bae8 Fixed require 2016-06-23 16:25:40 -04:00
Sean Lilley 4052ef1b77 Upgrade for gltf-pipeline 2016-06-10 17:43:30 -04:00
Patrick Cozzi 80522f46d4 Rename combine to embed 2015-10-20 09:55:15 -04:00
Sean Lilley 87c8d2efb2 Support absolute paths 2015-10-19 18:13:29 -04:00
Sean Lilley d38b3bc82f Updated readme with command line flags 2015-10-19 17:47:03 -04:00
Sean Lilley b37a582723 Auto-generate normals if they are missing 2015-10-19 17:03:50 -04:00
Sean Lilley 3708651148 Specular and texture fixes 2015-10-19 13:35:28 -04:00
Sean Lilley c8c4d56744 Convert obj to gltf 2015-10-18 23:15:28 -04:00