//////twinkling stars
for (let index = 0; index < 1000; index++) {
const stargeometry = new THREE.SphereGeometry(1, 24, 24); //create star sphere size
const starmaterial = new THREE.MeshStandardMaterial({ color: 0xffffff }); //define star texture
const star = new THREE.Mesh(stargeometry, starmaterial); //initialize the star
const [starx, stary, starz] = Array(3).fill().map(() => THREE.MathUtils.randFloatSpread(10000)); //set random position for star within range
star.position.set(starx, stary, starz); //position the stars
this.scene.add(star); //add stars to the scene
const light = new THREE.PointLight(0xffffff, 2, 50 );
light.position.set( starx, stary, starz );
this.scene.add( light );
}
An error encountered in Chrome browser:
THREE.WebGLProgram: shader error: 0 35715 false gl.getProgramInfoLog Fragment shader is not compiled.
**Recent observations: **
at index<100 everything works fine creating twinkling stars with point lights
at index<200 the loading process slows down significantly
at index<300 and above the system encounters an error instead of generating more stars.