From b0f48d2ace477f4977ccd124504bfc41cd42968a Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Tue, 14 Jan 2020 18:20:51 +0100 Subject: [PATCH] Changed downsampling strategy for Bloom --- orx-fx/src/main/kotlin/blur/Bloom.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orx-fx/src/main/kotlin/blur/Bloom.kt b/orx-fx/src/main/kotlin/blur/Bloom.kt index 940819c0..e83e3340 100644 --- a/orx-fx/src/main/kotlin/blur/Bloom.kt +++ b/orx-fx/src/main/kotlin/blur/Bloom.kt @@ -50,8 +50,8 @@ class Bloom(blur: Filter = ApproximateGaussianBlur()) : Filter(Shader.createFrom lastDownsampleRate = downsampleRate - for (downsample in 0 until downsamples * 2 step 2) { - val div = downsample + downsampleRate + for (downsample in 0 until downsamples) { + val div = 1 shl downsample val bufferA = colorBuffer(dest.width/div, dest.height/div, 1.0, target[0].format, ColorType.FLOAT16) val bufferB = colorBuffer(dest.width/div, dest.height/div, 1.0, target[0].format, ColorType.FLOAT16) samplers.add(Pair(bufferA, bufferB))