[Demo link removed, shares too much code with closed source repo]
Trick: "cache side effects that construct three.js graph nodes, then compose those effects into one larger effect (monoid operations permitted)"
The reused three.js nodes keep the vertex buffer ID numbers to vertices already uploaded to the graphics card. So via reusing the three.js node you are reusing the vertex data on the card.
Buttons working atm: properties on 1st tab, and 1st 3 buttons in 2nd tab.
Trick code: https://gist.github.com/clinuxrulz/f9f20e7a7b61f8ca81f9a88f78f51466
Basically you construct a bunch of Cell<MkModelEffect>
together declaratively into one Cell<MkModelEffect>
and use it in the back end to create and maintain the model.
With the constructed models there is also an initCallback that returns a dispose callback. That is used for wiring up FRP sub-graphs for things like highlighting a model by changing its material rather than reuploading the model to the graphics card.
I image the same trick could be done with the DOM too. class DOMRef { hasChanged: bool; . . .}