<p dir="auto"><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/mrdoob/three.js/commit/7812b25cd842dabdbaf5dbeb4e05f814ead3a2e3/hovercard" href="https://github.com/mrdoob/three.js/commit/7812b25cd842dabdbaf5dbeb4e05f814ead3a2e3"><tt>7812b25</tt></a> broke the export of multiple actions for me. Instead, only the currently active animation of an armature will be exported.<br>
Isn't looping over <code class="notranslate">data.actions</code> and then checking for each action if it is identical to <code class="notranslate">armature.animation_data.action</code> the same as just exporting <code class="notranslate">armature.animation_data.action</code> in the first place?</p>
<p dir="auto">When working on the Multiview PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="436163421" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/16316" data-hovercard-type="pull_request" data-hovercard-url="/mrdoob/three.js/pull/16316/hovercard" href="https://github.com/mrdoob/three.js/pull/16316">#16316</a> I've noticed that updating array of matrices uniforms impact the performance quite a lot.<br>
This is mainly because of the cache, checking both elements are the same and then copying the array if not, seems to be a hot spot.</p>
<p dir="auto">I'll try to get some numbers to compare using cache vs not using for arrays. I believe it could be interesting to consider avoid caching arrays or maybe provide a way to define that you don't want to cache some uniforms if you already know they'll be changing per frame.</p>
<p dir="auto">Looking at the Babylon's sourcecode it seems they just cache simple data <a href="https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/effect.ts#L1113-L1122">https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/effect.ts#L1113-L1122</a> but not arrays <a href="https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/effect.ts#L1131-L1174">https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/effect.ts#L1131-L1174</a>.</p>
<p dir="auto">So some ideas:</p>
<ul dir="auto">
<li>Avoid using cache for Array uniforms</li>
<li>Allow the user to define which uniforms must not use cache</li>
<li>Add a new boolean param to <code class="notranslate">setValue</code> to force non-cache update, eg: <code class="notranslate">uniform.setValue(gl, 'name', [a,b], true)</code></li>
</ul>