后处理修复

This commit is contained in:
SoulliesOfficial
2026-07-09 17:09:34 -04:00
parent fdc20cd66f
commit 8985d98653
25 changed files with 196 additions and 143 deletions

View File

@@ -6,8 +6,8 @@ namespace Ichni.RhythmGame.Beatmap
public class PixelateEffect_BM : EffectBase_BM
{
[System.Obsolete] public float duration;
public float bottomX;
public float bottomY;
[Range(0f, 1f)] public float bottomX;
[Range(0f, 1f)] public float bottomY;
public AnimationCurve intensityCurve;
public PixelateEffect_BM()
@@ -19,8 +19,8 @@ namespace Ichni.RhythmGame.Beatmap
{
this.effectTime = duration;
this.duration = duration;
this.bottomX = bottomX;
this.bottomY = bottomY;
this.bottomX = Mathf.Clamp01(bottomX);
this.bottomY = Mathf.Clamp01(bottomY);
this.intensityCurve = intensityCurve;
}

View File

@@ -11,8 +11,8 @@ namespace Ichni.RhythmGame
InspectorBuilder.For(this)
.Section("Pixelate Effect")
.InputField(nameof(effectTime), "Effect Time")
.InputField(nameof(bottomX), "Bottom X")
.InputField(nameof(bottomY), "Bottom Y")
.InputField(nameof(bottomX), "Bottom X (0-1)")
.InputField(nameof(bottomY), "Bottom Y (0-1)")
.Button("Intensity Curve", () => insp.GenerateCompositeParameterWindow(this, "Intensity Curve", nameof(intensityCurve)).SetAsCustomCurve())
.Button("Clear Pixelate", Recover)
.Button("Remove", () => { nowEffectState = EffectState.Before; AccommodatingList.Remove(this); EditorManager.instance.uiManager.inspector.SetInspector(attachedGameElement); })

View File

@@ -41,7 +41,7 @@ namespace Ichni.RhythmGame
{ "Vignette", () => new VignetteEffect(1, 1, 0.4f, Color.black, CustomCurvePresets.Parabolic(1, 0, 1)) },
{ "SetInteger", () => new SetIntegerEffect("New Variable", 0, false, 0, 1) },
{ "EnableControl", () => new EnableControlEffect(null, "New Variable", 0, false, "") },
{ "Pixelate", () => new PixelateEffect(1, 320, 180, CustomCurvePresets.Instant()) },
{ "Pixelate", () => new PixelateEffect(1, 1f / 6f, 1f / 6f, CustomCurvePresets.Instant()) },
{ "LowPassFilter", () => new LowPassFilterEffect(1, 20, true, CustomCurvePresets.Parabolic(1, 0, 1)) },
{ "HighPassFilter", () => new HighPassFilterEffect(1, 20000, true, CustomCurvePresets.Parabolic(1, 0, 1)) },
{ "SpeedLines", () => new SpeedLinesEffect(1f, CustomCurvePresets.Parabolic(1, 0, 1), new Color(1f, 1f, 1f, 0.5f), peakRemap: 0f) },

View File

@@ -7,8 +7,8 @@ namespace Ichni.RhythmGame
public partial class PixelateEffect : EffectBase
{
#region [] Property Caches
public float bottomX;
public float bottomY;
[Range(0f, 1f)] public float bottomX;
[Range(0f, 1f)] public float bottomY;
public AnimationCurve intensityCurve;
private PixelateVolume _pixelateVolume;
@@ -18,8 +18,8 @@ namespace Ichni.RhythmGame
public PixelateEffect(float duration, float bottomX, float bottomY, AnimationCurve intensityCurve)
: base(duration)
{
this.bottomX = bottomX;
this.bottomY = bottomY;
this.bottomX = Mathf.Clamp01(bottomX);
this.bottomY = Mathf.Clamp01(bottomY);
this.intensityCurve = intensityCurve;
}
@@ -28,8 +28,8 @@ namespace Ichni.RhythmGame
if (other is PixelateEffect otherEffect)
{
this.effectTime = otherEffect.effectTime;
this.bottomX = otherEffect.bottomX;
this.bottomY = otherEffect.bottomY;
this.bottomX = Mathf.Clamp01(otherEffect.bottomX);
this.bottomY = Mathf.Clamp01(otherEffect.bottomY);
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
}
}
@@ -50,8 +50,8 @@ namespace Ichni.RhythmGame
if (_pixelateVolume != null)
{
_pixelateVolume.forceActive.value = true;
_pixelateVolume.strengthX.value = Screen.width;
_pixelateVolume.strengthY.value = Screen.height;
_pixelateVolume.strengthX.value = 1f;
_pixelateVolume.strengthY.value = 1f;
}
}
@@ -59,8 +59,9 @@ namespace Ichni.RhythmGame
{
if (_pixelateVolume != null)
{
float x = Mathf.Lerp(Screen.width, bottomX, intensityCurve.Evaluate(effectProgressPercent));
float y = Mathf.Lerp(Screen.height, bottomY, intensityCurve.Evaluate(effectProgressPercent));
float progress = intensityCurve == null ? effectProgressPercent : intensityCurve.Evaluate(effectProgressPercent);
float x = Mathf.Lerp(1f, Mathf.Clamp01(bottomX), progress);
float y = Mathf.Lerp(1f, Mathf.Clamp01(bottomY), progress);
_pixelateVolume.strengthX.value = x;
_pixelateVolume.strengthY.value = y;
}
@@ -75,8 +76,8 @@ namespace Ichni.RhythmGame
if (_pixelateVolume != null)
{
_pixelateVolume.forceActive.value = false;
_pixelateVolume.strengthX.value = Screen.width;
_pixelateVolume.strengthY.value = Screen.height;
_pixelateVolume.strengthX.value = 1f;
_pixelateVolume.strengthY.value = 1f;
}
}
#endregion