KHR_Materials warning

I made a charecter with makehuman exported to fbx then exported a gltf from that fbx in blender then i added to jme i got this error i also used some charcters from sketchfab i got same error too

WARNING: Could not find loader for extension KHR_materials_specular
Feb 08, 2023 2:47:25 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_ior
Feb 08, 2023 2:47:25 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_specular
Feb 08, 2023 2:47:25 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_ior
Feb 08, 2023 2:47:26 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_specular
Feb 08, 2023 2:47:26 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_ior
Feb 08, 2023 2:47:26 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_specular
Feb 08, 2023 2:47:26 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_ior
Feb 08, 2023 2:47:26 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_specular
Feb 08, 2023 2:47:26 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_ior
Feb 08, 2023 2:47:26 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_specular
Feb 08, 2023 2:47:26 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_ior
Feb 08, 2023 2:47:26 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_specular
Feb 08, 2023 2:47:26 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_ior
Feb 08, 2023 2:47:26 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_specular
Feb 08, 2023 2:47:26 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_materials_ior

Error = bad, must deal with.

Warning = you might care, you might not.

If your model loads and looks ok then don’t worry. If your model does not load or does not look ok then post that… since the warning may or may not have anything to do with that.

no model load with no materal just plain model

So, to rephrase your question for anyone trying to help:
“I made a charecter with makehuman exported to fbx then exported a gltf from that fbx in blender then i added to jme and they fail to load any material. i also used some charcters from sketchfab i got same problem. Here is an example of what they look like when loaded (insert picture here). I don’t know if it’s related but I get a bunch of these warnings (insert warnings from above). I’m using version (insert version JME or SDK or whatever)”

Please fill in the blanks.

1 Like

Note that afaik JME only supports loading pbrMetallicRoughness, KHR_materials_pbrSpecularGlossiness, and KHR_materials_unlit materials.

Edit:

For using pbrMetallicRoughness make sure the model is using the “Principled BSDF” node in Blender before exporting to gltf.

2 Likes

imugur images don’t appear to me
So pbrMetallicRoughness is the default converted to pbrlighting, KHR_materials_pbrSpecularGlossiness must be converted to phong lighting, and KHR_materials_unlit must converted to unshaded material… right?

No, it uses Spec gloss pipeline of PBRLighting

Right

You can find those extension loaders here:

3 Likes

By the way, I did a quick google search and found out they have an extension (KHR_materials_common) to support common Phong material.

In case someone is interested to create a loader for KHR_materials_common in JME we would welcome the contribution.

Edit:
Oops, this seems to be only for Gltf v1, not v2!

2 Likes

Hey, Sorry for late update I had several problem, I didn’t have light probe, and also model had problems i use modo mainly so i found the way to the problem in this video

it is for mixamo but pretty much applicable to makehuman models too, also in blender by changing opaque to alpha hashed you can make it work.
and also i found some tools to change specular workflow to metalic if you needed ever,
https://gltf.report/ you upload model to here it tells it need to change spec to metalic then export and also this nodejs tool:

# install
npm install --global @gltf-transform/cli

# convert
gltf-transform metalrough input.glb output.glb

@Ali_RS can i use pbr models with phong material in case for android dev what i do??

Note, PBR should work on Android as well technically but performance might be a problem.

You can convert the PBR material to Phong material. This is how I do it in my asset-convert tool:

    private Material convertToPhongMaterial(Material pbr) {
        Material phong = new Material(assetManager, Materials.LIGHTING);
        phong.setName(pbr.getName());
        phong.setBoolean("UseMaterialColors", true);

        phong.setTexture("DiffuseMap", pbr.getParamValue("BaseColorMap"));
        phong.setColor("Diffuse", pbr.getParamValue("BaseColor"));

        if (pbr.getParamValue("NormalMap") != null) {
            phong.setTexture("NormalMap", pbr.getParamValue("NormalMap"));
        }

        if (pbr.getParamValue("EmissiveMap") != null) {
            phong.setTexture("GlowMap", pbr.getParamValue("EmissiveMap"));
            phong.setColor("GlowColor", pbr.getParamValue("Emissive"));
        }

        phong.setColor("Ambient", ColorRGBA.White);
        phong.setColor("Specular", ColorRGBA.Black);
        phong.setFloat("Shininess", 0);  // [0,128]
        phong.setBoolean("VertexLighting", true);

        phong.getAdditionalRenderState().setFaceCullMode(pbr.getAdditionalRenderState().getFaceCullMode());
        phong.getAdditionalRenderState().setBlendMode(pbr.getAdditionalRenderState().getBlendMode());

        Float alpha = pbr.getParamValue("AlphaDiscardThreshold");
        if (alpha != null && alpha > 0) {
            phong.setFloat("AlphaDiscardThreshold", alpha);
        }
        return phong;
    }
3 Likes

wow thank you :slight_smile:

2 Likes