Skip to content

Commit

Permalink
add option to disable bloom blur
Browse files Browse the repository at this point in the history
  • Loading branch information
flustix committed Dec 7, 2024
1 parent 2e4ceab commit 9a858bd
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions fluXis.Game/Configuration/FluXisConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ protected override void InitialiseDefaults()

// Graphics
SetDefault(FluXisSetting.ShowFps, false);
SetDefault(FluXisSetting.DisableBloom, false);

// Account
SetDefault(FluXisSetting.Username, string.Empty);
Expand Down Expand Up @@ -172,6 +173,7 @@ public enum FluXisSetting

// Graphics
ShowFps,
DisableBloom,

// Account
Username,
Expand Down
11 changes: 11 additions & 0 deletions fluXis.Game/Graphics/Shaders/Bloom/BloomContainer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using fluXis.Game.Configuration;
using fluXis.Game.Map.Structures.Events;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;

Expand All @@ -9,12 +12,20 @@ public partial class BloomContainer : ShaderContainer
protected override string FragmentShader => "Blur";
public override ShaderType Type => ShaderType.Bloom;

private Bindable<bool> disable;

public BloomContainer()
{
DrawOriginal = true;
EffectBlending = BlendingParameters.Additive;
EffectPlacement = EffectPlacement.InFront;
}

[BackgroundDependencyLoader]
private void load(FluXisConfig config)
{
disable = config.GetBindable<bool>(FluXisSetting.DisableBloom);
}

protected override DrawNode CreateShaderDrawNode() => new BloomContainerDrawNode(this, SharedData);
}
2 changes: 1 addition & 1 deletion fluXis.Game/Graphics/Shaders/Bloom/BloomDrawNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected override void PopulateContents(IRenderer renderer)
{
base.PopulateContents(renderer);

if (strength <= 0)
if (strength <= 0 || Source.disable.Value)
return;

renderer.PushScissorState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public class SettingsGameplayStrings : LocalizationCategory
public TranslatableString LaneSwitchAlerts => Get("lane-switch-alerts", "Lane Switch Alerts");
public TranslatableString LaneSwitchAlertsDescription => Get("lane-switch-alerts-description", "Shows arrows next to the playfield before a lane switch.");

public TranslatableString DisableBloom => Get("disable-bloom", "Disable Bloom Blur");
public TranslatableString DisableBloomDescription => Get("disable-bloom-description", "Fully disables blur of the bloom shader, leaving only the glow. This option might change later.");

#endregion

#region HUD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ private void load()
Label = strings.LaneSwitchAlerts,
Description = strings.LaneSwitchAlertsDescription,
Bindable = Config.GetBindable<bool>(FluXisSetting.LaneSwitchAlerts)
},
new SettingsToggle
{
Label = strings.DisableBloom,
Description = strings.DisableBloomDescription,
Bindable = Config.GetBindable<bool>(FluXisSetting.DisableBloom)
}
});
}
Expand Down

0 comments on commit 9a858bd

Please sign in to comment.