diff --git a/core/assets/bloomshaders/alpha_gaussian.frag b/core/assets/bloomshaders/alpha_gaussian.frag index 4d762bd5b4..0866932871 100644 --- a/core/assets/bloomshaders/alpha_gaussian.frag +++ b/core/assets/bloomshaders/alpha_gaussian.frag @@ -10,9 +10,38 @@ const float close = 0.3162162162; const float far = 0.0702702703; void main(){ - gl_FragColor = far * texture2D(u_texture, v_texCoords0) + gl_FragColor = far * texture2D(u_texture, v_texCoords0) + close * texture2D(u_texture, v_texCoords1) + center * texture2D(u_texture, v_texCoords2) + close * texture2D(u_texture, v_texCoords3) - + far * texture2D(u_texture, v_texCoords4); + + far * texture2D(u_texture, v_texCoords4); + + + //TODO this is broken. + /* + + 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; + + //far close center close far + + //TODO figure this out + //RGB values should be weighted by their respective alpha values. + gl_FragColor = vec4( + (v1.rgb * a1 + v2.rgb * a2 + v3.rgb * a3 + v4.rgb * a4 + v5.rgb * a5) / + max(a1 + a2 + a3 + a4 + a5, 0.0001), //RGB must be weighed by the sum of all alpha processed. if a pixel contributes less weight, the multiplication is higher + a1 + a2 + a3 + a4 + a5); //alpha is just the weighed sum + + */ } diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 32ef0ec3d3..45ebd97683 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -950,6 +950,8 @@ setting.difficulty.hard = Hard setting.difficulty.insane = Insane setting.difficulty.name = Difficulty: setting.screenshake.name = Screen Shake +setting.bloomintensity.name = Bloom Intensity +setting.bloomblur.name = Bloom Blurs setting.effects.name = Display Effects setting.destroyedblocks.name = Display Destroyed Blocks setting.blockstatus.name = Display Block Status diff --git a/core/assets/maps/two.msav b/core/assets/maps/two.msav index a10184dd40..9891414f69 100644 Binary files a/core/assets/maps/two.msav and b/core/assets/maps/two.msav differ diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index 5a6aba4fcc..3bcb2cf7b4 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -339,6 +339,8 @@ public class Renderer implements ApplicationListener{ if(bloom != null){ bloom.resize(graphics.getWidth(), graphics.getHeight()); + bloom.setBloomIntesity(settings.getInt("bloomintensity", 6) / 4f + 1f); + bloom.blurPasses = settings.getInt("bloomblur", 1); Draw.draw(Layer.bullet - 0.02f, bloom::capture); Draw.draw(Layer.effect + 0.02f, bloom::render); } diff --git a/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java b/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java index 7cd7dd04fc..e6fd3fa2c5 100644 --- a/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java +++ b/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java @@ -12,7 +12,7 @@ import mindustry.graphics.*; public class ContinuousLaserBulletType extends ContinuousBulletType{ public float fadeTime = 16f; public float lightStroke = 40f; - public int divisions = 11; + public int divisions = 13; public Color[] colors = {Color.valueOf("ec745855"), Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.white}; public float strokeFrom = 2f, strokeTo = 0.5f, pointyScaling = 0.75f; public float backLength = 7f, frontLength = 35f; diff --git a/core/src/mindustry/graphics/Drawf.java b/core/src/mindustry/graphics/Drawf.java index bf7a8208fe..aef676b10e 100644 --- a/core/src/mindustry/graphics/Drawf.java +++ b/core/src/mindustry/graphics/Drawf.java @@ -54,6 +54,7 @@ public class Drawf{ } public static void flameFront(float x, float y, int divisions, float rotation, float length, float width){ + //TODO I don't know why this is necessary yet. Does FIll.poly screw up with triangles? divisions = Mathf.round(divisions, 2) + 1; points.clear(); diff --git a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java index d137ba88e9..87129459dd 100644 --- a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java +++ b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java @@ -342,6 +342,10 @@ public class SettingsMenuDialog extends BaseDialog{ }); graphics.sliderPref("screenshake", 4, 0, 8, i -> (i / 4f) + "x"); + + graphics.sliderPref("bloomintensity", 6, 0, 16, i -> (int)(i/4f * 100f) + "%"); + graphics.sliderPref("bloomblur", 2, 1, 16, i -> i + "x"); + graphics.sliderPref("fpscap", 240, 10, 245, 5, s -> (s > 240 ? Core.bundle.get("setting.fpscap.none") : Core.bundle.format("setting.fpscap.text", s))); graphics.sliderPref("chatopacity", 100, 0, 100, 5, s -> s + "%"); graphics.sliderPref("lasersopacity", 100, 0, 100, 5, s -> {