This tiger model is displaying correctly in Blender.
But when I render this in Three.js, it is coming up as black.
In Gltf viewer, it is coming up as full white.
Textures seem to be okay since it is getting rendered correctly in Blender
What could be the possible issue here?
There should be a warning like this appearing in your JS console:
THREE.GLTFLoader: Unknown extension âKHR_materials_pbrSpecularGlossinessâ.
This model uses the spec/gloss PBR workflow, which is no longer supported by THREE.GLTFLoader. You can convert the model to a metal/rough PBR workflow instead, using one of the methods mentioned in this thread:
mrdoob:dev
â donmccurdy:cleanup/gltfloader-remove-specgloss
opened 02:43AM - 14 Nov 22 UTC
The Khronos Group archived the `KHR_materials_pbrSpecularGlossiness` extension (⌠"no longer recommended for creating new files") about a year ago. I think it would be reasonable for us to remove support at this point, and focus efforts on the metal/rough workflow instead. All new and upcoming PBR features â volumetric refraction, iridescence, clearcoat, subsurface scattering, ... â are authored around the metal/rough model. With support for `KHR_materials_ior` and `KHR_materials_specular`, there is no particular advantage left to the spec/gloss model.
Existing spec/gloss models can be converted losslessly to metal/rough with:
```shell
npm install --global @gltf-transform/cli
gltf-transform metalrough in.glb out.glb
```
Related:
- https://github.com/mrdoob/three.js/pull/23630
Migration guide:
- [Converting glTF PBR materials from spec/gloss to metal/rough](https://www.donmccurdy.com/2022/11/28/converting-gltf-pbr-materials-from-specgloss-to-metalrough/)
@donmccurdy this is crazy man, thanks a lot!!!
Worked like a charm.
One more thing, is there any way to detect if spec PBR was used?
1 Like
Two quick ways would be:
(A) drop the file into https://gltf.report/ , youâll immediately get a pop-up about it.
(B) run it through this CLI and check the extension list for KHR_materials_pbrSpecularGlossiness
npm install --global @gltf-transform/cli
gltf-transform inspect path/to/scene.glb
1 Like