My dilemma involves placing labels with the names of cities on a terrain. However, once the number of labels exceeds ten, the frames per second drastically decrease.
I've tried implementing the code provided at
My code looks something like this:
var canvas = document.createElement('canvas');
var canvasSize = 250;
canvas.width = canvasSize;
canvas.height = canvasSize;
var context = canvas.getContext('2d');
context.font = "Bold " + size + "px " + font;
context.textAlign = 'center';
context.fillStyle = "rgba(10, 10, 10, 1.0)";
context.fillText(text, canvasSize / 2, canvasSize / 2);
var texture = new THREE.Texture(canvas);
texture.needsUpdate = true;
var labelMaterial = new THREE.SpriteMaterial(
{map: texture, useScreenCoordinates: false});
var label = new THREE.Sprite(labelMaterial);
label.position.x = this._vector.x;
label.position.y = this._vector.y;
label.position.z = this._vector.z;
label.scale.set(10, 10, 1.0);
scene.add(label);
I believe the issue with the decreasing fps when merging sprites is due to each label having a different texture.
Thank you in advance!