From b110516965c4806708c9e54dd9ffa1f6c7a19f21 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 1 Feb 2026 10:53:13 -0600 Subject: [PATCH] feat(immersive): increase source quality to 256x256 - Source canvas now 256x256 (was 64x64) - Light pre-blur (8px), GPU shader does main blur - Increased shader blur radius and samples (16 samples) - Should produce much smoother results --- src/lib/immersive/shaders/ambient.frag | 4 ++-- src/lib/immersive/utils/texture-loader.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/immersive/shaders/ambient.frag b/src/lib/immersive/shaders/ambient.frag index fc7b0c2d5..c2329e1ec 100644 --- a/src/lib/immersive/shaders/ambient.frag +++ b/src/lib/immersive/shaders/ambient.frag @@ -31,8 +31,8 @@ const float BREATH_SPEED = 0.15; const float BREATH_AMOUNT = 0.08; // Blur simulation parameters -const float BLUR_RADIUS = 0.015; // UV space blur radius -const int BLUR_SAMPLES = 12; // Number of samples for blur +const float BLUR_RADIUS = 0.025; // UV space blur radius (increased for 256px source) +const int BLUR_SAMPLES = 16; // More samples for smoother blur // Simple pseudo-random function float random(vec2 st) { diff --git a/src/lib/immersive/utils/texture-loader.ts b/src/lib/immersive/utils/texture-loader.ts index 7b4387e1a..086a77755 100644 --- a/src/lib/immersive/utils/texture-loader.ts +++ b/src/lib/immersive/utils/texture-loader.ts @@ -227,12 +227,12 @@ export async function loadBlurredTexture( activeLoads.set(requestId, controller); try { - // Generate blurred image - // Match original: 64x64 canvas with heavy blur (40px equivalent) + // Generate pre-processed image + // Use 256x256 for good quality - GPU shader will handle the blur const blurredDataUrl = await generateBlurredImage( artworkUrl, - 64, // Same as original CSS approach - 20, // Heavy blur - will be applied multiple times + 256, // Higher quality source for GPU blur + 8, // Light pre-blur, GPU shader does the heavy lifting controller.signal );