Bloom config options

This commit is contained in:
Anuken
2022-04-25 10:53:18 -04:00
parent eb880ba2be
commit 1ac7317986
7 changed files with 41 additions and 3 deletions
+31 -2
View File
@@ -10,9 +10,38 @@ const float close = 0.3162162162;
const float far = 0.0702702703; const float far = 0.0702702703;
void main(){ void main(){
gl_FragColor = far * texture2D(u_texture, v_texCoords0) gl_FragColor = far * texture2D(u_texture, v_texCoords0)
+ close * texture2D(u_texture, v_texCoords1) + close * texture2D(u_texture, v_texCoords1)
+ center * texture2D(u_texture, v_texCoords2) + center * texture2D(u_texture, v_texCoords2)
+ close * texture2D(u_texture, v_texCoords3) + 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
*/
} }
+2
View File
@@ -950,6 +950,8 @@ setting.difficulty.hard = Hard
setting.difficulty.insane = Insane setting.difficulty.insane = Insane
setting.difficulty.name = Difficulty: setting.difficulty.name = Difficulty:
setting.screenshake.name = Screen Shake setting.screenshake.name = Screen Shake
setting.bloomintensity.name = Bloom Intensity
setting.bloomblur.name = Bloom Blurs
setting.effects.name = Display Effects setting.effects.name = Display Effects
setting.destroyedblocks.name = Display Destroyed Blocks setting.destroyedblocks.name = Display Destroyed Blocks
setting.blockstatus.name = Display Block Status setting.blockstatus.name = Display Block Status
Binary file not shown.
+2
View File
@@ -339,6 +339,8 @@ public class Renderer implements ApplicationListener{
if(bloom != null){ if(bloom != null){
bloom.resize(graphics.getWidth(), graphics.getHeight()); 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.bullet - 0.02f, bloom::capture);
Draw.draw(Layer.effect + 0.02f, bloom::render); Draw.draw(Layer.effect + 0.02f, bloom::render);
} }
@@ -12,7 +12,7 @@ import mindustry.graphics.*;
public class ContinuousLaserBulletType extends ContinuousBulletType{ public class ContinuousLaserBulletType extends ContinuousBulletType{
public float fadeTime = 16f; public float fadeTime = 16f;
public float lightStroke = 40f; 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 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 strokeFrom = 2f, strokeTo = 0.5f, pointyScaling = 0.75f;
public float backLength = 7f, frontLength = 35f; public float backLength = 7f, frontLength = 35f;
+1
View File
@@ -54,6 +54,7 @@ public class Drawf{
} }
public static void flameFront(float x, float y, int divisions, float rotation, float length, float width){ 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; divisions = Mathf.round(divisions, 2) + 1;
points.clear(); points.clear();
@@ -342,6 +342,10 @@ public class SettingsMenuDialog extends BaseDialog{
}); });
graphics.sliderPref("screenshake", 4, 0, 8, i -> (i / 4f) + "x"); 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("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("chatopacity", 100, 0, 100, 5, s -> s + "%");
graphics.sliderPref("lasersopacity", 100, 0, 100, 5, s -> { graphics.sliderPref("lasersopacity", 100, 0, 100, 5, s -> {