[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")) {
|
class BloomCombine : Filter(mppFilterShader(fx_bloom_combine, "bloom-combine")) {
|
||||||
var gain: Double by parameters
|
var gain: Double by parameters
|
||||||
|
var pregain: Double by parameters
|
||||||
var bias: ColorRGBa by parameters
|
var bias: ColorRGBa by parameters
|
||||||
|
|
||||||
init {
|
init {
|
||||||
bias = ColorRGBa.BLACK
|
bias = ColorRGBa.BLACK
|
||||||
gain = 1.0
|
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)
|
@DoubleParameter("gain", 0.0, 4.0)
|
||||||
var gain: Double = 1.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
|
* 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]))
|
upscale.apply(intermediates.toTypedArray(), arrayOf(target[0]))
|
||||||
combine.gain = gain
|
combine.gain = gain
|
||||||
|
combine.pregain = pregain
|
||||||
combine.apply(arrayOf(sourceCopy!!, target[0]), target)
|
combine.apply(arrayOf(sourceCopy!!, target[0]), target)
|
||||||
|
|
||||||
if (sRGB) {
|
if (sRGB) {
|
||||||
|
|||||||
@@ -5,9 +5,10 @@ uniform sampler2D tex0;
|
|||||||
uniform sampler2D tex1;
|
uniform sampler2D tex1;
|
||||||
|
|
||||||
uniform float gain;
|
uniform float gain;
|
||||||
|
uniform float pregain;
|
||||||
uniform vec4 bias;
|
uniform vec4 bias;
|
||||||
|
|
||||||
void main() {
|
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);
|
o_output.a = clamp(o_output.a, 0.0, 1.0);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user