Currently buildORMTexture() returns Texture.image if aoMap.image, roughnessMap.image, and metalnessMap.image are identical but it should return Texture. This PR fixes the problem by returning Texture.
@@ -695,7 +695,7 @@ class GLTFWriter {
const roughness = material.roughnessMap?.image;
const metalness = material.metalnessMap?.image;
- if ( occlusion === roughness && roughness === metalness ) return occlusion;
+ if ( occlusion === roughness && roughness === metalness ) return material.aoMap;
if ( occlusion || roughness || metalness ) {