Material binding in gltf2

Issue #45 resolved
Former user created an issue

Hey, I am trying to create a gltf material using assimp. I wanna set the necessary pbrMetallicRoughness and pbrSpecularGlossiness parameters as following:

"materials": [
    {
        "name": "gold",
        "pbrMetallicRoughness": {
            "baseColorFactor": [ 1.000, 0.766, 0.336, 1.0 ],
            "metallicFactor": 0.37,
            "roughnessFactor": 0.51  
           },
        "extensions": {
            "KHR_materials_pbrSpecularGlossiness": {
                "diffuseFactor": [ 0.0, 0.0, 0.0, 1.0 ],
                "specularFactor": [ 1.0, 0.766, 0.336 ],
                "glossinessFactor": 0.9
            }
        }

    }
]

The c/c++ Version has the two corresponding structs PbrSpecularGlossiness and PbrMetallicRoughness containing the parameters, however the Assimp.Material class does not implement any of those properties. It seems like a combination of Material.ColorSpecular and Material.Shininess sets the roughness parameter but not sure how its calculated.

Commit 1a21f82 in 5.0.0.rc1 seems to address this PBR workflow, but unfortunately build still fails, so I am trying to know if this is work in progress and if/when there is a planned release.

The Metalness and Roughness description is referring to PBR texture property but I assume it refers to corresponding factors right? The necessary AI_MATKEYs would be in pbrmaterial.h file.

Thank you for helping out!

Comments (2)

  1. Nicholas Woodfield repo owner

    All the properties in Material are just convenience methods that use the well-known AI_MATKEYS and the Material API. You still can set those GLTF PBR matkeys yourself.

    And yeah, I haven’t yet done a 5.0 native build for the branch, last week I was just focused on API changes. TBH It’s really confusing now in native assimp, but it seems like they have two different sets of PBR material keys, one that is “generic” (but only used by the FBX importer/exporter…it’s the stingray/maya PBR material) and the other that is GLTF only.

    Consider what I currently have in the 5.0 branch for the convenience methods on Material to not be the final state (I was hoping to have a nice workflow where you can easily check if the material is PBR or not, then I discovered there were the GLTF mat keys in addition to the other stuff… 😕 )

  2. Nicholas Woodfield repo owner

    5.0.0 has been merged to master and all the native binaries have been updated to the newest assimp release.

  3. Log in to comment