<p dir="auto">Hi,</p>
<p dir="auto">We are currently implement <a href="https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/TileFormats/Batched3DModel">b3dm</a> (a format that encapsulates glTF) support in our project and have encountered a few problems with the current GLTFLoader implementation.</p>
<p dir="auto">We need to support addition attribute (<code class="notranslate">batchid</code>, used to identify the different objects packed in the geometry), extensions (<a href="https://github.com/KhronosGroup/glTF/blob/master/extensions/Vendor/CESIUM_RTC/README.md">CESIUM_RTC</a>) and potentially additional uniforms. However, there does not seem to be any way to add these new features without modifying the GLTFLoader file itself.</p>
<p dir="auto">So my question is: how to support the extensible nature of glTF? Do we contribute directly to the source and add the attributes/extensions/uniforms that we need? Or does the loader need to be modified so extensions can be "plugged in" without changing the source?</p>
<p dir="auto">Related question: when loading glTFs in a scene rendered using a logarithmic depth buffer, the model's shader are not modified to account for it, resulting in depth issues: <a href="http://jsfiddle.net/x6ufnz3y/" rel="nofollow">http://jsfiddle.net/x6ufnz3y/</a>. I implemented a <a href="https://github.com/iTowns/itowns2/commit/d3e2456d36ca1799d72cc4393291c2228895ce09#diff-4c76f3570ec49d62d5e66e22e861662aR87">small hack</a> to fix the problem. Should this process be added to the loader natively? Or could Three provide a helper function to patch the materials?</p>
<p dir="auto">After introducing support for texture repeat and offset in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="894609103" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/21852" data-hovercard-type="pull_request" data-hovercard-url="/mrdoob/three.js/pull/21852/hovercard" href="https://github.com/mrdoob/three.js/pull/21852">#21852</a>, the ambient occlusion map is repeated many times, despite the fact that we are setting the scale separately for each texture:<br>
<code class="notranslate">float2 inputs:scale = ${ buildVector2( texture.repeat ) }</code></p>
<p dir="auto"><strong>To Reproduce</strong></p>
<p dir="auto">Steps to reproduce the behavior:</p>
<ol dir="auto">
<li>Have a model with tiled diffuse map and (obviously not tiled) AO map.</li>
<li>Export to USDZ</li>
<li>unzip USDZ archive and open USDA file</li>
<li>notice different scaling for each textures, diffuse texture may have scale major/minor from (1,1) and AO map should have a scale of (1,1)</li>
<li>Transfer USDZ file to iPhone/iPad</li>
<li>Open it in QuickLook and see AO map being tiled multiple times (probably as many as diffuse)</li>
</ol>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">AO map should not be tiled/repeated.</p>
<p dir="auto"><strong>Screenshots</strong></p>
<p dir="auto">from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="898238184" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/21871" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/21871/hovercard" href="https://github.com/mrdoob/three.js/issues/21871">#21871</a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/28507944/119883060-01d07300-bf27-11eb-8951-139dfce3e014.png"><img src="https://user-images.githubusercontent.com/28507944/119883060-01d07300-bf27-11eb-8951-139dfce3e014.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Platform:</strong></p>
<ul dir="auto">
<li>Device: [Desktop, Mobile]</li>
<li>OS: [Windows, MacOS, Linux, iOS]</li>
<li>Browser: [Chrome, Firefox, Safari, Edge]</li>
<li>Three.js version: [dev, r129]</li>
</ul>