From 3797ca2fa835c6eae2d52d695e0996378de084a1 Mon Sep 17 00:00:00 2001 From: Baz Utsahajit Date: Fri, 29 Dec 2023 23:24:09 +0000 Subject: [PATCH] Updated Bloom Filter (Still not working properly) --- filters/bloom/src/BloomFilter.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/filters/bloom/src/BloomFilter.ts b/filters/bloom/src/BloomFilter.ts index 9f4696d51..c2a2269ef 100644 --- a/filters/bloom/src/BloomFilter.ts +++ b/filters/bloom/src/BloomFilter.ts @@ -91,15 +91,12 @@ export class BloomFilter extends AlphaFilter */ public override apply(filterManager: FilterSystem, input: Texture, output: RenderSurface, clear: boolean): void { - const tempTexture = TexturePool.getSameSizeTexture(input); - const tempTexture2 = TexturePool.getSameSizeTexture(input); + const renderTarget = TexturePool.getSameSizeTexture(input); - filterManager.applyFilter(this, input, tempTexture, false); - filterManager.applyFilter(this._blurXFilter, tempTexture, tempTexture2, false); - filterManager.applyFilter(this._blurYFilter, tempTexture2, output, clear); - - TexturePool.returnTexture(tempTexture); - TexturePool.returnTexture(tempTexture2); + filterManager.applyFilter(this, input, output, clear); + filterManager.applyFilter(this._blurXFilter, input, renderTarget, true); + filterManager.applyFilter(this._blurYFilter, renderTarget, output, false); + TexturePool.returnTexture(renderTarget); } /**