mirror of https://github.com/CesiumGS/obj2gltf.git
573cdc244f
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. |
||
---|---|---|
.. | ||
ArrayStorage.js | ||
Texture.js | ||
createGltf.js | ||
getBufferPadded.js | ||
getJsonBufferPadded.js | ||
gltfToGlb.js | ||
loadMtl.js | ||
loadObj.js | ||
loadTexture.js | ||
obj2gltf.js | ||
outsideDirectory.js | ||
readLines.js | ||
writeGltf.js |