Retro VFX! (also airboarder works now) (#780)

* Super Retro VFX!

* Updated Screen Jump default

* also airboarder works now

---------

Co-authored-by: minenice55 <star.elementa@gmail.com>
This commit is contained in:
wookywok
2024-03-11 16:21:51 -05:00
committed by GitHub
parent bc93a7ab94
commit 92962fef26
915 changed files with 32248 additions and 73 deletions

View File

@ -500,9 +500,9 @@ namespace HeavenStudio.Games
newArch.appearBeat = beat;
newArch.gameObject.SetActive(true);
if (crouch) {
archBasic.CueCrouch(beat);
archBasic.CueCrouch(beat+25);
} else {
newArch.CueDuck(beat);
newArch.CueDuck(beat+25);
}
}
@ -511,7 +511,7 @@ namespace HeavenStudio.Games
Wall newWall = Instantiate(wallBasic, transform);
newWall.appearBeat = beat;
newWall.gameObject.SetActive(true);
newWall.CueJump(beat);
newWall.CueJump(beat+25);
}

View File

@ -1096,6 +1096,7 @@ namespace HeavenStudio
}),
}
},
new GameAction("colorGrading", "Color Grading")
{
resizable = true,
@ -1128,6 +1129,124 @@ namespace HeavenStudio
}),
}
},
new GameAction("gaussBlur", "Gaussian Blur")
{
resizable = true,
parameters = new()
{
new("intenStart", new EntityTypes.Float(0f, 5f, 0f), "Start Intensity", "Set the intensity at the start of the event."),
new("intenEnd", new EntityTypes.Float(0f, 5f, 1f), "End Intensity", "Set the intensity at the end of the event."),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action.", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Linear, new string[] { "intenStart" })
}),
}
},
new GameAction("retroTv", "Retro TV")
{
resizable = true,
parameters = new()
{
new("intenStart", new EntityTypes.Float(0f, 1f, 0f), "Start Distortion", "Set the distortion at the start of the event."),
new("intenEnd", new EntityTypes.Float(0f, 1f, 0.2f), "End Distortion", "Set the distortion at the end of the event."),
new("rgbStart", new EntityTypes.Float(0f, 1f, 1f), "Start RGB Blend", "Set the RGB blend at the start of the event."),
new("rgbEnd", new EntityTypes.Float(0f, 1f, 1f), "End RGB Blend", "Set the RGB blend at the end of the event."),
new("bottomStart", new EntityTypes.Float(0f, 1f, 0f), "Start Bottom Collapse", "Set the bottom collapse at the start of the event."),
new("bottomEnd", new EntityTypes.Float(0f, 1f, 0.02f), "End Bottom Collapse", "Set the bottom collapse at the end of the event."),
new("noiseStart", new EntityTypes.Float(0f, 1f, 0f), "Start Noise", "Set the noise at the start of the event."),
new("noiseEnd", new EntityTypes.Float(0f, 1f, 0.3f), "End Noise", "Set the noise knee at the end of the event."),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action.", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "intenStart", "rgbStart", "bottomStart", "noiseStart"})
}),
}
},
new GameAction("scanJitter", "Scan Line Jitter")
{
resizable = true,
parameters = new()
{
new("intenStart", new EntityTypes.Float(0f, 1f, 0f), "Start Intensity", "Set the intensity at the start of the event."),
new("intenEnd", new EntityTypes.Float(0f, 1f, 0.1f), "End Intensity", "Set the intensity at the end of the event."),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action.", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "intenStart" })
}),
}
},
new GameAction("analogNoise", "Analog Noise")
{
resizable = true,
parameters = new()
{
new("intenStart", new EntityTypes.Float(0f, 1f, 0f), "Start Speed", "Set the speed at the start of the event."),
new("intenEnd", new EntityTypes.Float(0f, 1f, 0.5f), "End Speed", "Set the speed at the end of the event."),
new("fadingStart", new EntityTypes.Float(0f, 1f, 0f), "Start Fading", "Set the fading at the start of the event."),
new("fadingEnd", new EntityTypes.Float(0f, 1f, 0.1f), "End Fading", "Set the fading at the end of the event."),
new("thresholdStart", new EntityTypes.Float(0f, 1f, 0f), "Start Threshold", "Set the threshold at the start of the event."),
new("thresholdEnd", new EntityTypes.Float(0f, 1f, 0.8f), "End Threshold", "Set the threshold at the end of the event."),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action.", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "intenStart", "fadingStart", "thresholdStart"})
}),
}
},
new GameAction("screenJump", "Screen Jump")
{
resizable = true,
parameters = new()
{
new("intenStart", new EntityTypes.Float(0f, 1f, 0f), "Start Intensity", "Set the intensity at the start of the event."),
new("intenEnd", new EntityTypes.Float(0f, 1f, 0.01f), "End Intensity", "Set the intensity at the end of the event."),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action.", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "intenStart" })
}),
}
},
new GameAction("sobelNeon", "Neon")
{
resizable = true,
parameters = new()
{
new("intenStart", new EntityTypes.Float(0.1f, 1f, 0.1f), "Start Intensity", "Set the edge fade at the start of the event."),
new("intenEnd", new EntityTypes.Float(0.1f, 1f, 1f), "End Intensity", "Set the edge fade at the end of the event."),
new("edgeWidthStart", new EntityTypes.Float(0.05f, 5f, 0.05f), "Start Edge Width", "Set the edge width at the start of the event."),
new("edgeWidthEnd", new EntityTypes.Float(0.05f, 5f, 2f), "End Edge Width", "Set the edge width at the end of the event."),
new("bgFadeStart", new EntityTypes.Float(0f, 1f, 0f), "Start Background Presence", "Set the background presence at the start of the event."),
new("bgFadeEnd", new EntityTypes.Float(0f, 1f, 0f), "End Background Presence", "Set the background presence at the end of the event."),
new("brightnessStart", new EntityTypes.Float(0f, 2f, 0f), "Start Brightness", "Set the brightness at the start of the event."),
new("brightnessEnd", new EntityTypes.Float(0f, 2f, 1f), "End Brightness", "Set the brightness at the end of the event."),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action.", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "intenStart", "edgeWidthStart", "bgFadeStart", "brightnessStart" })
}),
}
},
new GameAction("screenTiling", "Tile Screen")
{
resizable = true,
@ -1159,7 +1278,9 @@ namespace HeavenStudio
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "xScrollStart", "yScrollStart" })
}),
}
}
},
}),
new Minigame("advanced", "Advanced", "", false, true, new List<GameAction>()

View File

@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
using XPostProcessing;
namespace HeavenStudio
{
@ -17,10 +18,19 @@ namespace HeavenStudio
private List<RiqEntity> _lensDs = new();
private List<RiqEntity> _grains = new();
private List<RiqEntity> _colorGradings = new();
private List<RiqEntity> _retroTvs = new();
private List<RiqEntity> _scanJitters = new();
private List<RiqEntity> _gaussBlurs = new();
private List<RiqEntity> _analogNoises = new();
private List<RiqEntity> _screenJumps = new();
private List<RiqEntity> _sobelNeons = new();
private void Awake()
{
_volume = GetComponent<PostProcessVolume>();
UpdateRetroTV();
UpdateAnalogNoise();
UpdateSobelNeons();
}
private void Start()
@ -36,6 +46,12 @@ namespace HeavenStudio
_lensDs = EventCaller.GetAllInGameManagerList("vfx", new string[] { "lensD" });
_grains = EventCaller.GetAllInGameManagerList("vfx", new string[] { "grain" });
_colorGradings = EventCaller.GetAllInGameManagerList("vfx", new string[] { "colorGrading" });
_retroTvs = EventCaller.GetAllInGameManagerList("vfx", new string[] { "retroTv" });
_scanJitters = EventCaller.GetAllInGameManagerList("vfx", new string[] {"scanJitter"});
_gaussBlurs = EventCaller.GetAllInGameManagerList("vfx", new string[] {"gaussBlur"});
_analogNoises = EventCaller.GetAllInGameManagerList("vfx", new string[] {"analogNoise"});
_screenJumps = EventCaller.GetAllInGameManagerList("vfx", new string[] {"screenJump"});
_sobelNeons = EventCaller.GetAllInGameManagerList("vfx", new string[] {"sobelNeon"});
UpdateVignette();
UpdateChromaticAbberations();
@ -43,6 +59,13 @@ namespace HeavenStudio
UpdateLensDistortions();
UpdateGrain();
UpdateColorGrading();
UpdateRetroTV();
UpdateScanJitter();
UpdateGaussBlur();
UpdateAnalogNoise();
UpdateScreenJumps();
UpdateSobelNeons();
}
private void Update()
@ -53,6 +76,13 @@ namespace HeavenStudio
UpdateLensDistortions();
UpdateGrain();
UpdateColorGrading();
UpdateRetroTV();
UpdateScanJitter();
UpdateGaussBlur();
UpdateAnalogNoise();
UpdateScreenJumps();
UpdateSobelNeons();
}
private void UpdateVignette()
@ -223,6 +253,145 @@ namespace HeavenStudio
}
}
private void UpdateRetroTV()
{
if (!_volume.profile.TryGetSettings<CRT>(out var t)) return;
t.enabled.Override(false);
foreach (var e in _retroTvs)
{
float normalized = Conductor.instance.GetPositionFromBeat(e.beat, e.length);
if (normalized < 0) break;
float clampNormal = Mathf.Clamp01(normalized);
var func = Util.EasingFunction.GetEasingFunction((Util.EasingFunction.Ease)e["ease"]);
float newIntensity = func(e["intenStart"], e["intenEnd"], clampNormal);
t.enabled.Override(newIntensity != 0);
if (!t.enabled) continue;
t.distort.Override(newIntensity);
float newRGBBlend = func(e["rgbStart"], e["rgbEnd"], clampNormal);
t.RGBBlend.Override(newRGBBlend);
float newBottomCollapse = func(e["bottomStart"], e["bottomEnd"], clampNormal);
t.BottomCollapse.Override(newBottomCollapse);
float newNoiseAmount = func(e["noiseStart"], e["noiseEnd"], clampNormal);
t.NoiseAmount.Override(newNoiseAmount);
}
}
private void UpdateScanJitter()
{
if (!_volume.profile.TryGetSettings<GlitchScanLineJitter>(out var j)) return;
j.enabled.Override(false);
foreach (var e in _scanJitters)
{
float normalized = Conductor.instance.GetPositionFromBeat(e.beat, e.length);
if (normalized < 0) break;
float clampNormal = Mathf.Clamp01(normalized);
var func = Util.EasingFunction.GetEasingFunction((Util.EasingFunction.Ease)e["ease"]);
float newIntensity = func(e["intenStart"], e["intenEnd"], clampNormal);
j.enabled.Override(newIntensity != 0);
if (!j.enabled) continue;
j.JitterIndensity.Override(newIntensity);
}
}
private void UpdateGaussBlur()
{
if (!_volume.profile.TryGetSettings<GaussianBlur>(out var g)) return;
g.enabled.Override(false);
foreach (var e in _gaussBlurs)
{
float normalized = Conductor.instance.GetPositionFromBeat(e.beat, e.length);
if (normalized < 0) break;
float clampNormal = Mathf.Clamp01(normalized);
var func = Util.EasingFunction.GetEasingFunction((Util.EasingFunction.Ease)e["ease"]);
float newIntensity = func(e["intenStart"], e["intenEnd"], clampNormal);
g.enabled.Override(newIntensity != 0);
if (!g.enabled) continue;
g.BlurRadius.Override(newIntensity);
}
}
private void UpdateAnalogNoise()
{
if (!_volume.profile.TryGetSettings<GlitchAnalogNoise>(out var n)) return;
n.enabled.Override(false);
foreach (var e in _analogNoises)
{
float normalized = Conductor.instance.GetPositionFromBeat(e.beat, e.length);
if (normalized < 0) break;
float clampNormal = Mathf.Clamp01(normalized);
var func = Util.EasingFunction.GetEasingFunction((Util.EasingFunction.Ease)e["ease"]);
float newIntensity = func(e["intenStart"], e["intenEnd"], clampNormal);
n.enabled.Override(newIntensity != 0);
if (!n.enabled) continue;
n.NoiseSpeed.Override(newIntensity);
float newFading = func(e["fadingStart"], e["fadingEnd"], clampNormal);
n.NoiseFading.Override(newFading);
float newThreshold = func(e["thresholdStart"], e["thresholdEnd"], clampNormal);
n.LuminanceJitterThreshold.Override(newThreshold);
}
}
private void UpdateScreenJumps()
{
if (!_volume.profile.TryGetSettings<GlitchScreenJump>(out var sj)) return;
sj.enabled.Override(false);
foreach (var e in _screenJumps)
{
float normalized = Conductor.instance.GetPositionFromBeat(e.beat, e.length);
if (normalized < 0) break;
float clampNormal = Mathf.Clamp01(normalized);
var func = Util.EasingFunction.GetEasingFunction((Util.EasingFunction.Ease)e["ease"]);
float newIntensity = func(e["intenStart"], e["intenEnd"], clampNormal);
sj.enabled.Override(newIntensity != 0);
if (!sj.enabled) continue;
sj.ScreenJumpIndensity.Override(newIntensity);
}
}
private void UpdateSobelNeons()
{
if (!_volume.profile.TryGetSettings<EdgeDetectionSobelNeonV2>(out var sn)) return;
sn.enabled.Override(false);
foreach (var e in _sobelNeons)
{
float normalized = Conductor.instance.GetPositionFromBeat(e.beat, e.length);
if (normalized < 0) break;
float clampNormal = Mathf.Clamp01(normalized);
var func = Util.EasingFunction.GetEasingFunction((Util.EasingFunction.Ease)e["ease"]);
float newIntensity = func(e["intenStart"], e["intenEnd"], clampNormal);
sn.enabled.Override(newIntensity != 0.1);
if (!sn.enabled) continue;
sn.EdgeNeonFade.Override(newIntensity);
float newEdgeWidth = func(e["edgeWidthStart"], e["edgeWidthEnd"], clampNormal);
sn.EdgeWidth.Override(newEdgeWidth);
float newBgFade = func(e["bgFadeStart"], e["bgFadeEnd"], clampNormal);
sn.BackgroundFade.Override(newBgFade);
float newBrightness = func(e["brightnessStart"], e["brightnessEnd"], clampNormal);
sn.Brigtness.Override(newBrightness);
}
}
private Color ColorEase(Color start, Color end, float time, Util.EasingFunction.Function func)
{
float newR = func(start.r, end.r, time);