From a49bb808491d471978e8102084d1207924654e5d Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 18 May 2026 16:00:52 +0200 Subject: [PATCH] Simplify texture disposal logic in material rendering --- src/materials/material-rendering.ts | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/materials/material-rendering.ts b/src/materials/material-rendering.ts index 3c6cf94f..5e249650 100644 --- a/src/materials/material-rendering.ts +++ b/src/materials/material-rendering.ts @@ -11,9 +11,7 @@ import type { LoadedImageAsset } from "../assets/image-assets"; import { createStarterMaterialSignature, - createStarterMaterialTextureSet, - disposeStarterMaterialTextureSet, - type StarterMaterialTextureSet + createStarterMaterialTextureSet } from "./starter-material-textures"; import type { CustomMaterialDef, @@ -184,25 +182,6 @@ export function createMaterialTextureSet( } export function disposeMaterialTextureSet(textureSet: MaterialTextureSet): void { - if (textureSet.specular !== null || textureSet.metallic !== null) { - const starterCandidate: StarterMaterialTextureSet = { - baseColor: textureSet.baseColor as Texture, - normal: textureSet.normal as Texture, - roughness: textureSet.roughness as Texture, - metallic: textureSet.metallic, - specular: textureSet.specular - }; - - if ( - starterCandidate.baseColor !== null && - starterCandidate.normal !== null && - starterCandidate.roughness !== null - ) { - disposeStarterMaterialTextureSet(starterCandidate); - return; - } - } - const textures = new Set(); for (const texture of [