From 3e438d93d78a54413f183fe53d8dca70994a5a07 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Sun, 23 Apr 2023 16:26:11 +0200 Subject: [PATCH] tiles: base blur is proportial to image size --- packages/core/src/adapters/EquirectangularAdapter.ts | 2 +- packages/cubemap-adapter/src/CubemapAdapter.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/adapters/EquirectangularAdapter.ts b/packages/core/src/adapters/EquirectangularAdapter.ts index 24b2bc301..50ae57f29 100644 --- a/packages/core/src/adapters/EquirectangularAdapter.ts +++ b/packages/core/src/adapters/EquirectangularAdapter.ts @@ -180,7 +180,7 @@ export class EquirectangularAdapter extends AbstractAdapter { const ctx = buffer.getContext('2d'); if (this.config.blur) { - ctx.filter = 'blur(1px)'; + ctx.filter = `blur(${buffer.width / 2048}px)`; } ctx.drawImage( diff --git a/packages/cubemap-adapter/src/CubemapAdapter.ts b/packages/cubemap-adapter/src/CubemapAdapter.ts index 6260e19c9..ff77531d6 100644 --- a/packages/cubemap-adapter/src/CubemapAdapter.ts +++ b/packages/cubemap-adapter/src/CubemapAdapter.ts @@ -122,7 +122,7 @@ export class CubemapAdapter extends AbstractAdapter const ctx = buffer.getContext('2d'); if (this.config.blur) { - ctx.filter = 'blur(1px)'; + ctx.filter = `blur(${buffer.width / 512}px)`; } ctx.drawImage(img, 0, 0, buffer.width, buffer.height);