feat: integration & visual polish - lighting, water tuning (#6)
This commit is contained in:
@@ -9,7 +9,8 @@ export function setupLighting(
|
||||
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
||||
|
||||
// Warm point light near top center inside the tank (main, shadow-casting)
|
||||
const mainLight = new THREE.PointLight(0xffeedd, 2);
|
||||
const mainLight = new THREE.PointLight(0xffeedd, 30);
|
||||
mainLight.decay = 2; // physically correct inverse-square falloff
|
||||
mainLight.position.set(0, 2.2, 0);
|
||||
mainLight.castShadow = true;
|
||||
mainLight.shadow.mapSize.set(1024, 1024);
|
||||
@@ -17,17 +18,18 @@ export function setupLighting(
|
||||
scene.add(mainLight);
|
||||
|
||||
// Warm point light offset left-back (fill, no shadow)
|
||||
const fillLight = new THREE.PointLight(0xffe8cc, 1.2);
|
||||
const fillLight = new THREE.PointLight(0xffe8cc, 15);
|
||||
fillLight.decay = 2; // physically correct inverse-square falloff
|
||||
fillLight.position.set(-1.2, 2.0, -0.5);
|
||||
fillLight.castShadow = false;
|
||||
scene.add(fillLight);
|
||||
|
||||
// Cool dark blue ambient (dark room feel)
|
||||
const ambient = new THREE.AmbientLight(0x1a2a3a, 0.4);
|
||||
const ambient = new THREE.AmbientLight(0x1a2a3a, 0.6);
|
||||
scene.add(ambient);
|
||||
|
||||
// Subtle directional from above (no shadow — point light handles shadows)
|
||||
const directional = new THREE.DirectionalLight(0xffffff, 0.3);
|
||||
const directional = new THREE.DirectionalLight(0xffffff, 0.5);
|
||||
directional.position.set(0, 5, 0);
|
||||
directional.target.position.set(0, 0, 0);
|
||||
directional.castShadow = false;
|
||||
|
||||
+1
-1
@@ -143,7 +143,7 @@ export function createWater(scene: THREE.Scene): { update: (time: number) => voi
|
||||
depthWrite: false,
|
||||
uniforms: {
|
||||
uTime: { value: 0 },
|
||||
uColor: { value: new THREE.Color(0.08, 0.35, 0.45) },
|
||||
uColor: { value: new THREE.Color(0.05, 0.3, 0.4) },
|
||||
},
|
||||
});
|
||||
timeUniforms.push(waterMaterial.uniforms.uTime);
|
||||
|
||||
Reference in New Issue
Block a user