I have a discord I haven’t used in ages. I probably should install it again.
Edit:
My discord name is reddog
Had a look in your capx. Didn’t have “Rex function” or “polygon” installed so I removed them. Looks like one wasn’t used and the other, polygon was just another option from paster.
I will say the polygon plugin is probably your biggest bottleneck. It has the same issue the canvas plugin had. It draws to a hidden canvas first and is copied to a webgl texture. This is slow and uses a lot of memory when drawing many polygons.
I noticed you’re using some JavaScript. I usually define the functions once in a start of layout. To make the functions accessible later you’d define them as
window.myfunction = function(){};
Instead of
var myfunction = function(){};
Or
function myfunction(){}
And the beauty of it is you’d still be able to call the function as myfunction().
Window is the global object.
You can do it with just events as well. Might look more readable.
One thing I do to make my expressions more readable is to avoid using tokenat or even array.at as much. Probably just a personal preference.
For max performance you could do almost everything in JavaScript and only do minimal stuff in events like add cubes, set the view rotation, and request it to be drawn. Kind of loses the fun of using construct though if you run into js errors.