<p dir="auto">If THREE.CubeTextureLoader is used <strong>scene.toJSON()</strong> crashes</p>
<p dir="auto">function getDataURL(image)</p>
<p dir="auto">line 3737 context.drawImage(.. // param is an array of the 6 images of the CubeTexture</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 class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> r93</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>
<p dir="auto">so this file here has some 120K tris and 3 x 2K textures, however when I drop it into 3js editor fps goes out the window. I get much better performance in <a href="https://sandbox.babylonjs.com/" rel="nofollow">https://sandbox.babylonjs.com/</a> with the same model.</p>
<p dir="auto"><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>  could it be related to the fact that, for some reason, 3js loader duplicates the textures for each map in every material across the model? here, we have 4 identical materials with 5 maps, 3 of them being same texture, but 3js creates 20 textures for this:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/242577/117990031-11539780-b33d-11eb-8bea-e0ff9bb5a577.png"><img src="https://user-images.githubusercontent.com/242577/117990031-11539780-b33d-11eb-8bea-e0ff9bb5a577.png" alt="Screen Shot 2021-05-12 at 16 06 17 " style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/242577/117990039-131d5b00-b33d-11eb-98c1-881c56920fba.png"><img src="https://user-images.githubusercontent.com/242577/117990039-131d5b00-b33d-11eb-98c1-881c56920fba.png" alt="Screen Shot 2021-05-12 at 16 06 36 " style="max-width: 100%;"></a></p>
<p dir="auto">glb file in zip below:<br>
<a href="https://github.com/mrdoob/three.js/files/6466747/three_js_problem_model.glb.zip">three_js_problem_model.glb.zip</a></p>