After testing out the threejs library with a project (link: ), I noticed that the performance was quite poor. Any suggestions on how to improve it?
The main components of my experiment include a timeFont class for generating instances, camera initialization, scene setup, lighting, and renderer configuration. Instances are deleted when they move out of the scene.
I'm unsure what's causing the resource consumption - is it the fonts, frequent text updates, or limitations of the library itself.
Below is the source code snippet:
// timeFont class
class timeFont {
// constructor and methods here...
};
// global variables and functions
var container;
var camera, cameraTarget, scene, renderer;
var windowHalfX = window.innerWidth / 2;
var instances = [];
var frameRate = 5;
document.getElementById("setFrameRate-Input").value = frameRate;
var instanceCreationTime = 1;
document.getElementById("setInstanceCreation-Input").value = instanceCreationTime;
// Initialization and animation functions included as well.
Note: The script has been updated on my website link mentioned above. Now, I only update the text every second if seconds are displayed, but the performance issue persists.