Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds texture overrides for independent materials #242

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Jul 7, 2020

  1. 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.
    YANOUSHek committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    573cdc2 View commit details
    Browse the repository at this point in the history
  2. Changes var to const

    YANOUSHek committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    4251c84 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b056b84 View commit details
    Browse the repository at this point in the history