Hello guys, I need to map Roughness, Metallic, and AO texture maps with single roughness/metalic map which are stored in a GLB how to do that I am using below lines of code
const mat = new THREE.MeshStandardMaterial({
roughnessMap: child.material.roughnessMap,
aoMap: child.material.aoMap,
metalnessMap: child.material.metalnessMap
})
console.log(child.material);
if (value === 'normalMap') {
if (child.material.normalMap) {
child.material.map = child.material.normalMap;
child.material.needsUpdate = true;
console.log('Normal map exist');
}
}
if (value === 'alphaMap') {
if (child.material.alphaMap) {
child.material.map = child.material.alphaMap;
child.material.needsUpdate = true;
console.log('Alpha map exist');
}
}
if (value === 'aoMap') {
if (child.material.aoMap) {
child.material.map = child.material.aoMap;
child.material.needsUpdate = true;
console.log('AO map exist');
}
}
if (value === 'emissiveMap') {
if (child.material.emissiveMap) {
child.material.map = child.material.emissiveMap;
child.material.needsUpdate = true;
console.log('Emissive map exist');
}
}
if (value === 'roughnessMap') {
if (child.material.roughnessMap) {
child.material.map = child.material.roughnessMap;
child.material.needsUpdate = true;
console.log('Roughness map exist');
}
}
if (value === 'metalnessMap') {
if (child.material.metalnessMap) {
child.material.map = child.material.metalnessMap;
child.material.needsUpdate = true;
console.log('Metalness map exist');
}
}
and also I created new mesh standard material and assign but it didn’t work, Thanks for your time