<p dir="auto">Some reference code: <a href="https://glitch.com/edit/#!/occlusion-roughness-metalness" rel="nofollow">https://glitch.com/edit/#!/occlusion-roughness-metalness</a></p>
<p dir="auto">Retrieving old discussion from : <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="361804875" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/14940" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/14940/hovercard" href="https://github.com/mrdoob/three.js/issues/14940">#14940</a></p>
<blockquote>
<p dir="auto">Merging metal/rough/AO textures on the same texture on different channels is something we had in our plan for features to support in the GLTFExporter since the beginning. Actually I had it on my backlog but I have not had time yet to take a look at it :)<br>
So I agree with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/donmccurdy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/donmccurdy">@donmccurdy</a> on the proposal as something we should support soon:</p>
</blockquote>
<blockquote>
<blockquote>
<ul dir="auto">
<li>If metal/rough textures are different and have different sizes, use one, skip the other, and log a warning.</li>
</ul>
</blockquote>
<ul dir="auto">
<li>If metal/rough textures are different and have the same size: combine them</li>
</ul>
<blockquote>
<ul dir="auto">
<li>If only one of metal/rough is present, export that.</li>
<li>If AO has the same size as the (combined) metal/rough, merge its red channel into that image.</li>
</ul>
</blockquote>
</blockquote>
<blockquote>
<p dir="auto">And I'll add to the wishlist two things:</p>
<ul dir="auto">
<li>An option as <code class="notranslate">convertSizeWhenCombineTextures</code> so it will try to combine them by reescaling the ones with different size.</li>
<li>Comparing images to detect duplicates. This could be added on the exporting process itself or as a postprocess action including it on GLTFEXporter.Utils</li>
</ul>
</blockquote>
<p dir="auto">There're duplicate code:</p>
<ul dir="auto">
<li><a href="https://github.com/mrdoob/three.js/blob/dev/examples/jsm/postprocessing/EffectComposer.js#L246-L316">https://github.com/mrdoob/three.js/blob/dev/examples/jsm/postprocessing/EffectComposer.js#L246-L316</a></li>
<li><a href="https://github.com/mrdoob/three.js/blob/dev/examples/jsm/postprocessing/Pass.js#L8-L78">https://github.com/mrdoob/three.js/blob/dev/examples/jsm/postprocessing/Pass.js#L8-L78</a></li>
</ul>
<p dir="auto"><strong>Describe the solution you'd like</strong></p>
<p dir="auto">Re-export Pass and FullScreenQuad in EffectComposer.js</p>