Fragment brightness has now a effect on the radius

This commit is contained in:
Michel Fedde 2021-03-24 14:02:48 +01:00
parent ddd2171da2
commit 9fa1ac6ad9
3 changed files with 9 additions and 8 deletions

View file

@ -81,7 +81,7 @@ namespace SM.Base.PostEffects
/// Radius of the effect
/// <para>Default: 2</para>
/// </summary>
public float Radius = 2;
public float Radius = 1;
/// <summary>
/// This can disable the bloom calculation.

View file

@ -35,12 +35,13 @@ void main() {
vec2 tex_offset = 1.0 / textureSize(renderedTexture, 0) * vec2(Horizontal ? 1 : 0, Horizontal ? 0 : 1);
vec3 result = max(GetRenderColorOffset(vec2(0)).rgb - thres, 0) * (First ? Power : 1);
result *= GetWeight(0);
vec3 result = max(GetRenderColorOffset(vec2(0)).rgb - thres, 0) * (First ? Power : 1) * GetWeight(0);
float radi = Radius + (length(result));
for(int i = 1; i < WeightCount; i++) {
result += max(GetRenderColorOffset(tex_offset * i * Radius).rgb - thres, 0) * (First ? Power : 1) * GetWeight(i);
result += max(GetRenderColorOffset(-tex_offset * i * Radius).rgb - thres, 0) * (First ? Power : 1) * GetWeight(i);
result += max(GetRenderColorOffset(tex_offset * i * radi).rgb - thres, 0) * (First ? Power : 1) * GetWeight(i);
result += max(GetRenderColorOffset(-tex_offset * i * radi).rgb - thres, 0) * (First ? Power : 1) * GetWeight(i);
}
color = vec4(result, 1);