renderer.setAnimationLoop

This commit is contained in:
Adrien MALINGREY 2023-06-23 23:53:22 +02:00
parent 52ced3f0f1
commit da93c41e43

View File

@ -64,6 +64,9 @@ renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFShadowMap;
renderer.physicallyCorrectLights = true;
renderer.setAnimationLoop(animate)
container.appendChild(renderer.domElement);
const scene = new THREE.Scene();
@ -707,8 +710,6 @@ function onWindowResize() {
function animate() {
requestAnimationFrame(animate);
const delta = Math.min(0.05, clock.getDelta())
const deltaTime = delta / STEPS_PER_FRAME;