[orx-fx] add pregain parameter to MipBloom
This commit is contained in:
@@ -31,11 +31,13 @@ class BloomUpscale : Filter(mppFilterShader(fx_bloom_upscale, "bloom-upscale"))
|
||||
|
||||
class BloomCombine : Filter(mppFilterShader(fx_bloom_combine, "bloom-combine")) {
|
||||
var gain: Double by parameters
|
||||
var pregain: Double by parameters
|
||||
var bias: ColorRGBa by parameters
|
||||
|
||||
init {
|
||||
bias = ColorRGBa.BLACK
|
||||
gain = 1.0
|
||||
pregain = 1.0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +51,10 @@ open class MipBloom<T : Filter>(val blur: T) : Filter(mppFilterShader(fx_bloom_c
|
||||
@DoubleParameter("gain", 0.0, 4.0)
|
||||
var gain: Double = 1.0
|
||||
|
||||
@DoubleParameter("pregain", 0.0, 4.0)
|
||||
var pregain: Double = 1.0
|
||||
|
||||
|
||||
/**
|
||||
* noise gain. low noise gains will result in visible banding of the image. default value is 0.25
|
||||
*/
|
||||
@@ -113,6 +119,7 @@ open class MipBloom<T : Filter>(val blur: T) : Filter(mppFilterShader(fx_bloom_c
|
||||
|
||||
upscale.apply(intermediates.toTypedArray(), arrayOf(target[0]))
|
||||
combine.gain = gain
|
||||
combine.pregain = pregain
|
||||
combine.apply(arrayOf(sourceCopy!!, target[0]), target)
|
||||
|
||||
if (sRGB) {
|
||||
|
||||
@@ -5,9 +5,10 @@ uniform sampler2D tex0;
|
||||
uniform sampler2D tex1;
|
||||
|
||||
uniform float gain;
|
||||
uniform float pregain;
|
||||
uniform vec4 bias;
|
||||
|
||||
void main() {
|
||||
o_output = texture(tex0, v_texCoord0) + texture(tex1, v_texCoord0)*gain;
|
||||
o_output = texture(tex0, v_texCoord0) * pregain + texture(tex1, v_texCoord0)*gain;
|
||||
o_output.a = clamp(o_output.a, 0.0, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user