Files
vibemake/js/studio-environment.js
T

23 lines
865 B
JavaScript

import * as THREE from 'three';
// 只用于 IBL:柔光板形成宽高光,暗区保留反射层次,不增加逐帧的灯光开销。
export function createStudioEnvironment() {
const scene = new THREE.Scene();
const room = new THREE.Mesh(
new THREE.BoxGeometry(20, 20, 20),
new THREE.MeshBasicMaterial({ color: '#17191d', side: THREE.BackSide }),
);
scene.add(room);
const softbox = (width, height, position, intensity) => {
const material = new THREE.MeshBasicMaterial({ color: new THREE.Color().setScalar(intensity), side: THREE.DoubleSide });
const panel = new THREE.Mesh(new THREE.PlaneGeometry(width, height), material);
panel.position.set(...position);
panel.lookAt(0, 0, 0);
scene.add(panel);
};
softbox(4, 3, [-3, 4, 4], 6);
softbox(1.5, 4, [4, 2, 0], 4);
softbox(3, 2, [0, 5, -2], 3);
return scene;
}