auto-git:

[change] src/rendering/precomputed-shader-sky-environment-cache.ts
This commit is contained in:
2026-04-22 17:56:13 +02:00
parent d79ab40a29
commit 291b7ffd4f

View File

@@ -38,6 +38,7 @@ export interface PrecomputedShaderSkyEnvironmentCacheOptions {
) => CachedEnvironmentBlendTexture; ) => CachedEnvironmentBlendTexture;
disposeBuildResources?: () => void; disposeBuildResources?: () => void;
phaseBlendTextureResolver?: WorldEnvironmentBlendTextureResolver | null; phaseBlendTextureResolver?: WorldEnvironmentBlendTextureResolver | null;
clearPhaseBlendTextureResolver?: () => void;
} }
function createEmptyPhaseEntries(): ShaderSkyEnvironmentPhaseEntries { function createEmptyPhaseEntries(): ShaderSkyEnvironmentPhaseEntries {
@@ -144,6 +145,7 @@ export class PrecomputedShaderSkyEnvironmentCache
return; return;
} }
this.options.clearPhaseBlendTextureResolver?.();
this.clear(); this.clear();
for (const phase of SHADER_SKY_PHASES) { for (const phase of SHADER_SKY_PHASES) {
@@ -228,6 +230,9 @@ export function createRendererPrecomputedShaderSkyEnvironmentCache(
disposeBuildResources: () => { disposeBuildResources: () => {
builder.dispose(); builder.dispose();
}, },
phaseBlendTextureResolver: options.phaseBlendTextureResolver ?? null phaseBlendTextureResolver: options.phaseBlendTextureResolver ?? null,
clearPhaseBlendTextureResolver: () => {
options.phaseBlendTextureResolver?.clear();
}
}); });
} }