From b8d58619db0fd138ef8a9a675552cf4061dce2d9 Mon Sep 17 00:00:00 2001 From: Neylz Date: Thu, 21 May 2026 02:34:02 +0200 Subject: [PATCH] fix: doesn't premultiplies alpha on renderItem functions --- src/app/services/Resources.ts | 5 ++++- src/app/services/Resources1204.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/services/Resources.ts b/src/app/services/Resources.ts index 7770e53f..3face85c 100644 --- a/src/app/services/Resources.ts +++ b/src/app/services/Resources.ts @@ -43,7 +43,10 @@ export async function renderItem(version: VersionId, item: ItemStack, baseCompon canvas.width = RENDER_SIZE canvas.height = RENDER_SIZE const resources = await getResources(version, baseComponents) - const gl = canvas.getContext('webgl2', { preserveDrawingBuffer: true }) + const gl = canvas.getContext('webgl2', { + preserveDrawingBuffer: true, + premultipliedAlpha: false, + }) if (!gl) { throw new Error('Cannot get WebGL2 context') } diff --git a/src/app/services/Resources1204.ts b/src/app/services/Resources1204.ts index a8aa7ceb..9cfcca27 100644 --- a/src/app/services/Resources1204.ts +++ b/src/app/services/Resources1204.ts @@ -39,7 +39,10 @@ export async function renderItem(version: VersionId, item: ItemStack) { canvas.width = RENDER_SIZE canvas.height = RENDER_SIZE const resources = await getResources(version) - const gl = canvas.getContext('webgl2', { preserveDrawingBuffer: true }) + const gl = canvas.getContext('webgl2', { + preserveDrawingBuffer: true, + premultipliedAlpha: false, + }) if (!gl) { throw new Error('Cannot get WebGL2 context') }