Questions on embedded GLTF PBR Texture
See original GitHub issueJust now, I exported GLTF material from Blender, and during conversion, I am getting this error:
Traceback (most recent call last):
File "gltf2usd.py", line 1126, in <module>
convert_to_usd(args.gltf_file, args.usd_file, args.fps, args.scale, args.verbose)
File "gltf2usd.py", line 1114, in convert_to_usd
GLTF2USD(gltf_file=gltf_file, usd_file=usd_file, fps=fps, scale=scale, verbose=verbose)
File "gltf2usd.py", line 70, in __init__
self.convert()
File "gltf2usd.py", line 1099, in convert
self._convert_materials_to_preview_surface()
File "gltf2usd.py", line 482, in _convert_materials_to_preview_surface
primvar_st1_output=primvar_st1_output
File "gltf2usd.py", line 1074, in _convert_texture_to_usd
texture_name = self.unpack_textures_to_grayscale_images(image_name, color_components)
File "gltf2usd.py", line 1035, in unpack_textures_to_grayscale_images
raise Exception('Unsupported image type!: {}'.format(img.mode))
Exception: Unsupported image type!: RGBA
So far, I have tested 3D GLTF from Sketchfab only and never had issue. Only today I am setting up the shader based on GLTF Blend example. Then I exported the object and getting an error. It does not seem to like RGBA, maybe I should change it to JPG?
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
GLTF Textures not binding · Issue #1 · TimLee9024/MCglTF
Another question, how can I use an embedded .glb without setting this extras parameters and having the textures binded in game ? Thank...
Read more >Crocotile3D, glTF and Hemispheric Lighting - Questions - Babylon.js
I created a fence post model in crocotile3d and exported it as glTF (also have the ... the material on an imported glTF...
Read more >dae to gltf pbr export not exporting textures not base64
What i need is to create GLTF from dae and as pbr textures use textures from the /texture folder. Not sure if i'm...
Read more >glTF 2.0 (GLTF/GLB) File – How can we help you? - CLO Help
Save textures as the glTF-Embedded format which includes texture files. Save with Zip Files (ZIP), Diffuse Color Combined on Texture. When color ...
Read more >Everything You Need to Know About glTF Files - Marxent Labs
You can also embed glTF files in documents like Microsoft Word or ... Descriptions of the PBR material textures used to define the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@enzyme69 yes what @ox says is correct since the logic initially assumes that you are using an ORM texture (occlusion: r, roughness: g, metallic: b). The texture logic definitely needs refactoring. I will look into that later today to make it more robust. But in the meantime, @ox solution should work.
So the texture it’s failing on is the Ambient Occlusion png, which has 4 channels. The
_convert_materials_to_preview_surface
function goes in expecting to use ther
component of theocculusionTexture
image as the occlusion map, sees a 4 channel image, which jumps to logic trying to unpack a glossiness map.I think if you change your ao.png to only be 3 channels, it should work