Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/extras/exporters/usdz-exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,14 @@ class UsdzExporter extends CoreExporter {
addTexture('normalMap', null, 'normal3f', 'normal', 'normal');
addTexture('emissiveMap', material.emissive, 'color3f', 'emissiveColor', 'emissive', false, true);
addTexture('aoMap', null, 'float', 'occlusion', 'occlusion');
addTexture('metalnessMap', material.metalness, 'float', 'metallic', 'metallic');
addTexture('glossMap', material.gloss, 'float', 'roughness', 'roughness');

// only export metalness for metalness workflow materials
const metalness = material.useMetalness ? material.metalness : 0;
addTexture('metalnessMap', metalness, 'float', 'metallic', 'metallic');

// convert gloss to roughness (they are inverse of each other)
const roughness = material.glossInvert ? material.gloss : 1 - material.gloss;
addTexture('glossMap', roughness, 'float', 'roughness', 'roughness');

// main material object
const materialObject = `
Expand Down