From d9dd5a56d19e1ffef881365b91b70b38706e33bb Mon Sep 17 00:00:00 2001 From: Dejvino Date: Fri, 21 Nov 2025 23:07:31 +0100 Subject: [PATCH] Fix: improved light effect --- party-cathedral/src/scene/light-ball.js | 9 ++++----- party-cathedral/src/scene/stained-glass-window.js | 9 +++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/party-cathedral/src/scene/light-ball.js b/party-cathedral/src/scene/light-ball.js index 7e338fa..950e6c8 100644 --- a/party-cathedral/src/scene/light-ball.js +++ b/party-cathedral/src/scene/light-ball.js @@ -19,7 +19,7 @@ export class LightBall extends SceneFeature { // --- Ball Properties --- const ballRadius = 0.4; const lightIntensity = 5.0; - const lightColors = [0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0x558800]; // Red, Green, Blue, Yellow + const lightColors = [0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0x00ffff]; // Red, Green, Blue, Yellow lightColors.forEach(color => { // --- Create the Ball --- @@ -31,11 +31,10 @@ export class LightBall extends SceneFeature { // --- Create the Light --- const light = new THREE.PointLight(color, lightIntensity, length / 1.5); - light.castShadow = true; - light.shadow.mapSize.width = 512; - light.shadow.mapSize.height = 512; + light.shadow.mapSize.width = 1024; + light.shadow.mapSize.height = 1024; light.shadow.camera.near = 0.1; - light.shadow.camera.far = length / 2; + light.shadow.camera.far = 200; // --- Initial Position --- ball.position.set( diff --git a/party-cathedral/src/scene/stained-glass-window.js b/party-cathedral/src/scene/stained-glass-window.js index 84b1857..a9145c6 100644 --- a/party-cathedral/src/scene/stained-glass-window.js +++ b/party-cathedral/src/scene/stained-glass-window.js @@ -32,8 +32,9 @@ export class StainedGlass extends SceneFeature { side: THREE.DoubleSide, metalness: 0.1, // Glass is not very metallic roughness: 0.3, // Glass is smooth - clearcoat: 1.0, - emissive: 0x000000, // We will control emissiveness via update + emissive: 0x222222, // Set to white to use vertex colors for glow + emissiveIntensity: 0.1, // Start with a base intensity + //blending: THREE.AdditiveBlending, // Additive blending for a bright, glowing effect }); const colorPalette = [ @@ -235,8 +236,8 @@ export class StainedGlass extends SceneFeature { update(deltaTime) { // Add a subtle pulsing glow to the windows const pulseSpeed = 0.5; - const minIntensity = 0.5; - const maxIntensity = 0.9; + const minIntensity = 0.1; // Increased intensity for a stronger glow + const maxIntensity = 0.2; const intensity = minIntensity + (maxIntensity - minIntensity) * (0.5 * (1 + Math.sin(state.clock.getElapsedTime() * pulseSpeed))); // To make the glow match the vertex colors, we set the emissive color to white