Не понимаю почему не отображаются тени, уже все перерыл
let canvas = document.getElementById("canvas");
let width = window.innerWidth;
let height = window.innerHeight;
canvas.width = width;
canvas.height = height;
let renderer = new THREE.WebGLRenderer({
canvas: canvas,
antialias: true
});
var scene, camera, mesh;
var meshFloor, ambientLight, light;
function init() {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(90, width / height, 0.1, 1000);
mesh = new THREE.Mesh(
new THREE.BoxGeometry(100, 100, 100),
new THREE.MeshLambertMaterial({
color: 0xff4444
})
);
mesh.position.y = 100;
mesh.receiveShadow = true;
mesh.castShadow = true;
scene.add(mesh);
meshFloor = new THREE.Mesh(
new THREE.PlaneGeometry(700, 700, 700, 10),
new THREE.MeshLambertMaterial({
color: 0xffffff
})
);
meshFloor.rotation.x -= Math.PI / 2;
meshFloor.receiveShadow = true;
scene.add(meshFloor);
let light = new THREE.PointLight(0xffffff, 0.8, 1800);
light.position.set(0,500, 00);
light.castShadow = true;