diff --git a/core/assets/bloomshaders/alpha_bloom.frag b/core/assets/bloomshaders/alpha_bloom.frag index 0b47274dfd..17578edab2 100644 --- a/core/assets/bloomshaders/alpha_bloom.frag +++ b/core/assets/bloomshaders/alpha_bloom.frag @@ -6,8 +6,10 @@ uniform lowp float OriginalIntensity; varying vec2 v_texCoords; void main(){ - vec4 original = texture2D(u_texture0, v_texCoords) * OriginalIntensity; - vec4 bloom = texture2D(u_texture1, v_texCoords) * BloomIntensity; - original = original * (vec4(1.0) - vec4(bloom.rgb, 0.0)); - gl_FragColor = original + bloom; + vec4 original = texture2D(u_texture0, v_texCoords) * OriginalIntensity; + vec4 bloom = texture2D(u_texture1, v_texCoords) * BloomIntensity; + original = original * (vec4(1.0) - bloom); + vec4 combined = original + bloom; + float mx = min(max(combined.r,max(combined.g,combined.b)), 1.0); + gl_FragColor = vec4(combined.rgb/mx,mx); } diff --git a/core/assets/bloomshaders/alpha_gaussian.frag b/core/assets/bloomshaders/alpha_gaussian.frag index a2c8c459de..8f52c951a5 100644 --- a/core/assets/bloomshaders/alpha_gaussian.frag +++ b/core/assets/bloomshaders/alpha_gaussian.frag @@ -15,32 +15,4 @@ void main(){ + center * texture2D(u_texture, v_texCoords2) + close * texture2D(u_texture, v_texCoords3) + far * texture2D(u_texture, v_texCoords4); - - - //TODO this is broken (too bright) - -/* - vec4 - v1 = texture2D(u_texture, v_texCoords0), - v2 = texture2D(u_texture, v_texCoords1), - v3 = texture2D(u_texture, v_texCoords2), - v4 = texture2D(u_texture, v_texCoords3), - v5 = texture2D(u_texture, v_texCoords4); - - float - a1 = v1.a * far, - a2 = v2.a * close, - a3 = v3.a * center, - a4 = v4.a * close, - a5 = v5.a * far; - - gl_FragColor = vec4( - //RGB values are weighed by their alpha values and their base weight (less alpha -> less contribution) - (v1.rgb * a1 + v2.rgb * a2 + v3.rgb * a3 + v4.rgb * a4 + v5.rgb * a5) / - //RGB must then be weighed by the sum of all alpha processed. don't allow divide by zero - max(a1 + a2 + a3 + a4 + a5, 0.0001), - //alpha is just the weighed sum - a1 + a2 + a3 + a4 + a5);*/ - - } diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 0ce3bdc16a..2ef34795e6 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -3382,7 +3382,7 @@ public class UnitTypes{ colors = new Color[]{Color.valueOf("bf92f9").a(0.4f), Color.valueOf("bf92f9"), Color.white}; //TODO merge chargeEffect = new MultiEffect(Fx.lancerLaserCharge, Fx.lancerLaserChargeBegin); - width = 20f; + width = 4f; largeHit = false; buildingDamageMultiplier = 0.25f; diff --git a/core/src/mindustry/world/blocks/defense/Door.java b/core/src/mindustry/world/blocks/defense/Door.java index 8a48640bbe..3fa4732ebe 100644 --- a/core/src/mindustry/world/blocks/defense/Door.java +++ b/core/src/mindustry/world/blocks/defense/Door.java @@ -36,6 +36,7 @@ public class Door extends Wall{ config(Boolean.class, (DoorBuild base, Boolean open) -> { doorSound.at(base); + base.effect(); for(DoorBuild entity : base.chained){ //skip doors with things in them @@ -45,7 +46,6 @@ public class Door extends Wall{ entity.open = open; pathfinder.updateTile(entity.tile()); - entity.effect(); } }); }