From 8b10df1102ecad5b1dd056a2dcde31201b1b3931 Mon Sep 17 00:00:00 2001 From: adrien Date: Sun, 4 Jun 2023 00:57:58 +0200 Subject: [PATCH] transparent water!! --- main.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/main.js b/main.js index abf28f1..de83191 100644 --- a/main.js +++ b/main.js @@ -116,12 +116,14 @@ const ocean = new Water( sunColor : 0xffffff, waterColor : 0x001e0f, distortionScale: 3.7, - fog : scene.fog !== undefined + fog : scene.fog !== undefined, + alpha : 0.5 } ); ocean.rotation.x = - Math.PI / 2; ocean.position.y = -.01 ocean.receiveShadow = true; +ocean.material.transparent = true; scene.add( ocean ); // Lights @@ -144,15 +146,6 @@ sunLight.target = camera scene.add( sunLight ); const torchLight = new THREE.SpotLight(0xffffe8, 1, mazeLength/2, .45, 1) -/*torchLight.castShadow = true; -torchLight.shadow.camera.near = 20; -torchLight.shadow.camera.far = 200; -torchLight.shadow.camera.right = 30; -torchLight.shadow.camera.left = -30; -torchLight.shadow.camera.top = 30; -torchLight.shadow.camera.bottom = -30; -torchLight.shadow.mapSize.width = 512; -torchLight.shadow.mapSize.height = 512;*/ scene.add( torchLight ); scene.add( torchLight.target );