<p dir="auto">The current implementation of GLTFExporter is caching textures as it processes the scene but other parts of three js (e.g. TextureLoader and ImageLoader) cache the image.</p>
<p dir="auto">This creates problems when, for instance, you load various model files (via FBXLoader etc) that have references to the same image files and you try to export the resulting scene via GLTFExporter with embedImages = true and binary = true. Essentially, it packs duplicate image data into the glb, which bloats it considerably.</p>
<p dir="auto">The problem seems to centre around the fact that TextureLoader creates a new texture (with a potentially cached Image) every time you call load() but GLTFExporter is basing it's image caching on the texture when you try to process the scene. You end up with a list of textures all referring to the same image but GLTFExporter will go through each texture and write out the corresponding cached image.</p>
<p dir="auto">NOTE: I could solve this by hacking in something to patch/reformat all the textures in my scene to work with GLTFExporter but I think handling this in the exporter would be better and more user-friendly.</p>
<h5 dir="auto">Three.js version</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Dev</li>
<li>[x ] r92</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ...</li>
</ul>
<h5 dir="auto">Browser</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Chrome</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Firefox</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Internet Explorer</li>
</ul>
<h5 dir="auto">OS</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Windows</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> macOS</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Linux</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Android</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> iOS</li>
</ul>
<h5 dir="auto">Hardware Requirements (graphics card, VR Device, ...)</h5>
<p dir="auto">I'm attempting to debug a shading issue that occurs on my meshes when animated via skeletal animation.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/f8c85fce2dae71bc80ddad4f0b3ed23decc47891aae6ef67d62ed35ff4bcb781/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313532393338372f323331353832352f32633435306338612d613332392d313165332d386165652d6638663932643033346664352e706e67"><img src="https://camo.githubusercontent.com/f8c85fce2dae71bc80ddad4f0b3ed23decc47891aae6ef67d62ed35ff4bcb781/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313532393338372f323331353832352f32633435306338612d613332392d313165332d386165652d6638663932643033346664352e706e67" alt="screen shot 2014-03-03 at 11 40 53 am" data-canonical-src="https://f.cloud.github.com/assets/1529387/2315825/2c450c8a-a329-11e3-8aee-f8f92d034fd5.png" style="max-width: 100%;"></a></p>
<p dir="auto">As far as I can tell, the mesh is being applied correctly, as are the skins. The only thing left that I could think of that would be influencing it is the normals. The mesh appears to be shading correctly in the bind pose, though it's difficult to tell for sure. Upon applying and updating the vertex normals helper, this was the result:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/92623a3327e6b7127fa4ca42c03b0124df022f3523cd414bb208dea1fcb6dd6a/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313532393338372f323331353834342f36643565343438652d613332392d313165332d383639342d3764656133643165656164342e706e67"><img src="https://camo.githubusercontent.com/92623a3327e6b7127fa4ca42c03b0124df022f3523cd414bb208dea1fcb6dd6a/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313532393338372f323331353834342f36643565343438652d613332392d313165332d383639342d3764656133643165656164342e706e67" alt="screen shot 2014-03-03 at 3 53 38 pm" data-canonical-src="https://f.cloud.github.com/assets/1529387/2315844/6d5e448e-a329-11e3-8694-7dea3d1eead4.png" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/3ba6dda654ff714ac1bd28fdf9814203bbd8bb474508a79b1de597122c44e0de/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313532393338372f323331353834362f37303031396262652d613332392d313165332d383331632d6363623739313766613936322e706e67"><img src="https://camo.githubusercontent.com/3ba6dda654ff714ac1bd28fdf9814203bbd8bb474508a79b1de597122c44e0de/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313532393338372f323331353834362f37303031396262652d613332392d313165332d383331632d6363623739313766613936322e706e67" alt="screen shot 2014-03-03 at 3 54 09 pm" data-canonical-src="https://f.cloud.github.com/assets/1529387/2315846/70019bbe-a329-11e3-831c-ccb7917fa962.png" style="max-width: 100%;"></a></p>
<p dir="auto">Is this the intended behavior? Should they be moving with the mesh during skeletal animations? If so, what could be causing them to remain static?</p>
<p dir="auto">Thanks for your time.</p>