упрости этот код:
import * as THREE from 'three';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'

const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.z = 5;

const renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

const controls = new OrbitControls( camera, renderer.domElement );
controls.enableZoom = false;

controls.enableDamping = true;
controls.dampingFactor = 0.05;

const shaderCode = document.getElementById('fragShader').innerHTML;
const shaderCode2 = document.getElementById('fragShader2').innerHTML;
THREE.ImageUtils.crossOrigin = '';
const texture = new THREE.TextureLoader().load('gradient-2.png');
const texture2 = new THREE.TextureLoader().load('Rectangle 56.png');



const loader = new GLTFLoader();
const url = 'GRAF_3_23.glb';

loader.load(url, function (gltf) {
  const model = gltf.scene;
  
  model.traverse((child) => {
    if (child.isMesh) {
      const geometry = child.geometry;

      const positions = geometry.getAttribute('position').array;
      const randomPosition = [];
      for (let i = 0; i < positions.length; i += 3) {
        randomPosition.push(10.0*Math.random()-5.0, 10.0*Math.random()-5.0, 10.0*Math.random()-5.0);
      }

      // --------------------------------------------------------------------------
      const pointsArr = [];
      const pointSize = [];
      let uniforms2 = {
        mouseCoord: {type:'v3', value: new THREE.Vector3()},
        light: {type:'v3', value: new THREE.Vector3()},
        tex: { type:'t', value:texture2 },
        opacity:{type:'f', value: 0.5},
        res: { type:'v2', value:new THREE.Vector2(window.innerWidth,window.innerHeight)}
      };
      uniforms2.light.value.z = 50;
      for(let i = 0; i < positions.length; i+=3){
        const max = 0.03;
        const min = 0.055;
        pointSize[i] = Math.random() * (max - min) + min;
        pointSize[i+1] = Math.random() * (max - min) + min;
        pointSize[i+2] = Math.random() * (max - min) + min;
        const pointGeometry = new THREE.CircleGeometry(pointSize[i], 50);
        const pointMaterial = new THREE.ShaderMaterial({
          uniforms: uniforms2,
          // uniforms:{
          //   opacity: { type:'f', value: Math.random() }, 
          // },
          fragmentShader:shaderCode,
          side: THREE.DoubleSide,
          transparent: true
        });
        const point = new THREE.Mesh(pointGeometry, pointMaterial); 
        
        const posX = randomPosition[i];
        const posY = randomPosition[i+1];
        const posZ = randomPosition[i+2];
        point.position.set(posX, posY, posZ);
        pointsArr.push(point); 
        pointSize.push(pointSize[i]);
        // point.material.uniforms.opacity.value.setScalar(Math.random());
      }

      const groupPoints = new THREE.Group(); 
      pointsArr.forEach(point => {
        scene.add(point);
        point.lookAt(camera.position);
        groupPoints.add(point); 
      });
      scene.add(groupPoints);
      groupPoints.rotation.x = Math.PI/2;
      let t = 0;
      let time = 0;
      function getPointSizeAtTime(t,oldSize) {
        return Math.sin((t-oldSize)/oldSize/80.0)/80.0+0.05; 
      }
      function getPointOpacityAtTime(t,oldSize) {
        return  Math.sin((t-oldSize)/oldSize/80.0)/80.0+0.05;
      }
      function anim() {
        requestAnimationFrame(anim);
        t += 0.1;
        time += 0.003;
        uniforms2.light.value.x = Math.sin(time);
        uniforms2.light.value.y = Math.cos(time);
        for(let i = 0; i < pointsArr.length; i++){
          const oldSize = pointSize[i]
          const scale = getPointSizeAtTime(t,oldSize)*10;
          pointsArr[i].scale.set(scale, scale, scale);
          // uniforms2.opacity.value = getPointOpacityAtTime(t,oldSize)*10;
        }

      }
      anim();
      controls.addEventListener("change", (event) => {
        pointsArr.forEach(point => {
          point.lookAt(camera.position);
        });
      });
      // -------------------------------------------------------------------------------

      const randomPositionCopy = [...randomPosition];

      let increment = 0.002;

      geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(randomPosition), 3));
      function updateArray(increment) {
        for(let j = 0; j < 55; j++) {
          for(let i = 0; i<randomPosition.length; i++) {
            if (randomPosition[i] < positions[i]) {
              randomPosition[i] = randomPosition[i] + increment;
            } else if(randomPosition[i] > positions[i]) {
              randomPosition[i] = randomPosition[i] - increment;
            } else if((randomPosition[i] - positions[i]) < 0.002) {
              randomPosition[i] = positions[i];
            }
          }
        }
        let k = 0;
        for(let i = 0; i<pointsArr.length; i++) {
          const posX = randomPosition[k];
          const posY = randomPosition[k+1];
          const posZ = randomPosition[k+2];
          pointsArr[i].position.set(posX, posY, posZ);
          pointsArr[i].lookAt(camera.position);
          k+=3;
        }
      }
      function reverseUpdateArray(increment) {
        for(let j = 0; j < 55; j++) {
          for(let i = 0; i<randomPosition.length; i++) {
            if (randomPosition[i] < randomPositionCopy[i]) {
              randomPosition[i] = randomPosition[i] + increment;
            } else if(randomPosition[i] > randomPositionCopy[i]) {
              randomPosition[i] = randomPosition[i] - increment;
            } else if((randomPosition[i] - randomPositionCopy[i]) < 0.002) {
              randomPosition[i] = randomPositionCopy[i];
            }
          }
        }
        let j = 0;
        for(let i = 0; i<pointsArr.length; i++) {
          const posX = randomPosition[j];
          const posY = randomPosition[j+1];
          const posZ = randomPosition[j+2];
          pointsArr[i].position.set(posX, posY, posZ);
          pointsArr[i].lookAt(camera.position);
          j+=3;
        }
      }



      window.addEventListener('wheel', function(event) {
        if (event.deltaY > 0) {
          updateArray(increment);
        } else {
          reverseUpdateArray(increment);
        }
      });

    }
});
camera.position.z = 3;

let uniforms = {
mouseCoord: {type:'v3', value: new THREE.Vector3()},
tex: { type:'t', value:texture },
res: { type:'v2', value:new THREE.Vector2(window.innerWidth,window.innerHeight)}
};

const planeGeometry = new THREE.PlaneGeometry(1000, 1000);
const planeMaterial = new THREE.ShaderMaterial({
uniforms:uniforms,
fragmentShader:shaderCode2,
side: THREE.DoubleSide
});
const planeMesh = new THREE.Mesh(planeGeometry, planeMaterial);
scene.add(planeMesh);
planeMesh.position.set(0, 0, -85);

const group = new THREE.Group(); 
group.add(planeMesh); 
scene.add(group);

let targetX = 0;
let targetY = 0;
let currentX = 0;
let currentY = 0;

function update() {
  requestAnimationFrame(update);
  const diffX = targetX - currentX;
  const diffY = targetY - currentY;
  const distance = Math.sqrt(diffX * diffX + diffY * diffY);
  const speed = distance / 10;
  if (distance < 1.0) {
    currentX = targetX;
    currentY = targetY;
  } else {
    currentX += speed * diffX / distance;
  currentY += speed * diffY / distance;
  }
}
update();

group.position.set(camera.position.x, camera.position.y, camera.position.z);
function animate() {
  requestAnimationFrame(animate);
  group.rotation.x = camera.rotation.x;
  group.rotation.y = camera.rotation.y;
  group.rotation.z = camera.rotation.z;
  controls.update();
  renderer.render(scene, camera);
}
animate();
});