Spaces:
Running
Running
Dim the 3D lighting (part 2)
Browse files29 unmodified lines30313233333435361 unmodified line3839404142434445414243444546474818 unmodified lines67686970707172733 unmodified lines77787980818280818283848485868729 unmodified linesfunction studioEnvironment(pmrem) { const env = new THREE.Scene(); env.add(new THREE.Mesh(new THREE.BoxGeometry(10, 10, 10), new THREE.MeshBasicMaterial({ color: 0x9a9da2, side: THREE.BackSide }))); new THREE.MeshBasicMaterial({ color: 0x75787d, side: THREE.BackSide }))); const panel = (w, h, pos, power) => { const m = new THREE.Mesh(new THREE.PlaneGeometry(w, h), new THREE.MeshBasicMaterial({ color: new THREE.Color(1, 1, 1).multiplyScalar(power), side: THREE.DoubleSide }));1 unmodified line m.lookAt(0, 0, 0); env.add(m); }; panel(7, 7, [0, 4.8, 0], 2.6); // overhead softbox panel(5, 5, [-4.8, 1.5, 1], 2.2); // left (key side) panel(5, 5, [4.8, 1.5, -1], 1.6); // right panel(6, 4, [0, 1.5, 4.8], 1.4); // front panel(6, 4, [0, 1.5, -4.8], 1.4); // back panel(7, 7, [0, 4.8, 0], 1.8); // overhead softbox panel(5, 5, [-4.8, 1.5, 1], 1.5); // left (key side) panel(5, 5, [4.8, 1.5, -1], 1.1); // right panel(6, 4, [0, 1.5, 4.8], 0.95); // front panel(6, 4, [0, 1.5, -4.8], 0.95); // back const ground = new THREE.Mesh(new THREE.PlaneGeometry(10, 10), new THREE.MeshBasicMaterial({ color: 0x55585d })); ground.rotation.x = -Math.PI / 2; ground.position.y = -4.9;18 unmodified lines renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)); renderer.outputColorSpace = THREE.SRGBColorSpace; renderer.toneMapping = THREE.ACESFilmicToneMapping; renderer.toneMappingExposure = 1.0; renderer.toneMappingExposure = 0.85; renderer.shadowMap.enabled = true; renderer.shadowMap.type = THREE.PCFSoftShadowMap; stage.prepend(renderer.domElement);3 unmodified lines scene.fog = new THREE.Fog(STUDIO.horizon, 10, 50); const pmrem = new THREE.PMREMGenerator(renderer); scene.environment = studioEnvironment(pmrem); scene.add(new THREE.HemisphereLight(0xffffff, 0x6a6d72, 0.8)); const fill = new THREE.DirectionalLight(0xffffff, 0.7); // opposite the key, no shadow const rim = new THREE.DirectionalLight(0xffffff, 0.6); // from behind, lights the back scene.add(new THREE.HemisphereLight(0xffffff, 0x6a6d72, 0.5)); const fill = new THREE.DirectionalLight(0xffffff, 0.45); // opposite the key, no shadow const rim = new THREE.DirectionalLight(0xffffff, 0.4); // from behind, lights the back scene.add(fill, fill.target, rim, rim.target); const key = new THREE.DirectionalLight(0xffffff, 1.5); const key = new THREE.DirectionalLight(0xffffff, 1.25); key.castShadow = true; key.shadow.mapSize.set(2048, 2048); key.shadow.radius = 5;viewer.js+11-11