Fix for Bloom filter
This commit is contained in:
@@ -51,17 +51,18 @@ class Bloom(blur: Filter = ApproximateGaussianBlur()) : Filter(Shader.createFrom
|
||||
lastDownsampleRate = downsampleRate
|
||||
|
||||
for (downsample in 0 until downsamples * 2 step 2) {
|
||||
val bufferA = colorBuffer(dest.width, dest.height, 1.0 / (downsample + downsampleRate), target[0].format, ColorType.FLOAT16)
|
||||
val bufferB = colorBuffer(dest.width, dest.height, 1.0 / (downsample + downsampleRate), target[0].format, ColorType.FLOAT16)
|
||||
|
||||
val div = downsample + downsampleRate
|
||||
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))
|
||||
}
|
||||
}
|
||||
|
||||
for ((bufferA) in samplers) {
|
||||
for ((bufferA, _) in samplers) {
|
||||
blur.apply(src, bufferA)
|
||||
}
|
||||
|
||||
|
||||
for ((index, buffers) in samplers.asReversed().withIndex()) {
|
||||
val (bufferCurrA) = buffers
|
||||
|
||||
|
||||
@@ -13,8 +13,7 @@ uniform float gain;
|
||||
|
||||
out vec4 o_color;
|
||||
void main() {
|
||||
vec2 s = textureSize(tex0, 0).xy;
|
||||
s = vec2(1.0/s.x, 1.0/s.y);
|
||||
vec2 s = 1.0 / textureSize(tex0, 0).xy;
|
||||
int w = window;
|
||||
|
||||
vec4 sum = vec4(0.0);
|
||||
|
||||
Reference in New Issue
Block a user