diff --git a/app.js b/app.js index b396094..bfe5404 100644 --- a/app.js +++ b/app.js @@ -438,6 +438,11 @@ function updateFocusDisplay() { if (photoFocusDisplay) { photoFocusDisplay.textContent = bokehPass.uniforms['focus'].value.toFixed(1); } + + // 3D Audio: Update panner position to match camera + if (audioPanner) { + audioPanner.setPosition(camera.position.x, camera.position.y, camera.position.z); + } } document.addEventListener('keydown', (e) => { @@ -797,6 +802,37 @@ document.getElementById('debug-toggle').addEventListener('click', () => { } }); +// === 3D AUDIO SETUP === +let audioContext; +let audioSource; +let audioPanner; +let is3DAudioEnabled = true; + +// Replace the