From 8679021d21e08133d8237972380156d7abbcf2e6 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Jan 2026 04:42:55 +0000 Subject: [PATCH] fix: Address console errors - spawn warning, TSL texture, missing audio 1. GameWorker.ts: Change duplicate spawn warning from console.warn to debugInitialization.log since the guard is working correctly 2. VolumetricFog.ts: Fix THREE.TSL texture error by using .sample() on the depth texture node instead of texture() - the depthTexture parameter is already a texture node from scenePass.getTextureNode('depth') 3. sounds.config.json: Use yamato.mp3 for power_cannon sound effect since power_cannon.mp3 doesn't exist in the audio assets https://claude.ai/code/session_0123HA6ovqXT4Gk6EyLXoc3h --- public/audio/sounds.config.json | 2 +- src/engine/workers/GameWorker.ts | 2 +- src/rendering/tsl/VolumetricFog.ts | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/audio/sounds.config.json b/public/audio/sounds.config.json index f7087838..1dd8306b 100644 --- a/public/audio/sounds.config.json +++ b/public/audio/sounds.config.json @@ -197,7 +197,7 @@ "clusterRadius": 15 }, "attack_power_cannon": { - "url": "/audio/combat/power_cannon.mp3", + "url": "/audio/combat/yamato.mp3", "volume": 0.8, "spatial": true, "maxInstances": 3, diff --git a/src/engine/workers/GameWorker.ts b/src/engine/workers/GameWorker.ts index 206c8e47..87f63937 100644 --- a/src/engine/workers/GameWorker.ts +++ b/src/engine/workers/GameWorker.ts @@ -909,7 +909,7 @@ export class WorkerGame extends GameCore { public spawnInitialEntities(mapData: SpawnMapData): void { // Idempotency guard - prevent duplicate entity spawning if (this.entitiesAlreadySpawned) { - console.warn('[GameWorker] spawnInitialEntities called multiple times - skipping duplicate spawn'); + debugInitialization.log('[GameWorker] spawnInitialEntities called multiple times - skipping duplicate spawn'); return; } this.entitiesAlreadySpawned = true; diff --git a/src/rendering/tsl/VolumetricFog.ts b/src/rendering/tsl/VolumetricFog.ts index 60bf9afd..5ee10881 100644 --- a/src/rendering/tsl/VolumetricFog.ts +++ b/src/rendering/tsl/VolumetricFog.ts @@ -15,7 +15,6 @@ import { int, uniform, uv, - texture, clamp, smoothstep, mix, @@ -104,7 +103,9 @@ export function createVolumetricFogNode( const enabled = uEnabled.greaterThan(0.5); // Sample depth and convert to linear - const depthSample = texture(depthTexture, fragUV).r; + // depthTexture is already a texture node from scenePass.getTextureNode('depth'), + // so use .sample() instead of texture() which expects a raw THREE.Texture + const depthSample = depthTexture.sample(fragUV).r; // Convert depth to linear distance const z = depthSample.mul(2.0).sub(1.0);