Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions scripts/database/settings/SettingsProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ public partial class SettingsProfile
[Order]
public SettingsItem<double> NoteOpacity { get; private set; }

/// <summary>
/// Adjusts the note opacity curve, a higher value will make any sort of transparency appear more quickly
/// </summary>
[Order]
public SettingsItem<double> NoteOpacityExponent { get; private set; }

/// <summary>
/// Overrides the skin's note mesh
/// </summary>
Expand Down Expand Up @@ -589,6 +595,20 @@ public SettingsProfile()
}
};

NoteOpacityExponent = new(1.25)
{
Id = "NoteOpacityExponent",
Title = "Note Opacity Exponent",
Description = "Adjusts the note opacity curve, a higher value will make any sort of transparency appear more quickly",
Section = SettingsSection.Visual,
Slider = new()
{
Step = 0.05f,
MinValue = 1,
MaxValue = 2
}
};

NoteMesh = new("skin")
{
Id = "NoteMesh",
Expand Down
3 changes: 2 additions & 1 deletion scripts/game/LegacyRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public override void _Process(double delta)
bool pushback = LegacyRunner.CurrentAttempt.IsReplay ? LegacyRunner.CurrentAttempt.Replays[0].Pushback : settings.Pushback.Value;
float hitWindowDepth = pushback ? (float)Constants.HIT_WINDOW * ar / 1000 : 0;
float noteOpacity = (float)settings.NoteOpacity;
float noteOpacityExponent = (float)settings.NoteOpacityExponent;

if (noteOpacity > 1)
{
Expand Down Expand Up @@ -74,7 +75,7 @@ public override void _Process(double delta)
Color color = SkinManager.Instance.Skin.NoteColors[note.Index % SkinManager.Instance.Skin.NoteColors.Length];

transform.Origin = new Vector3(note.X, note.Y, -depth);
color.A = Math.Clamp(alpha * noteOpacity, 0, 1);
color.A = Math.Clamp((float)Math.Pow(alpha * noteOpacity, noteOpacityExponent), 0, 1);
Multimesh.SetInstanceTransform(j, transform);
Multimesh.SetInstanceColor(j, color);
}
Expand Down
Loading