Post Processing Effects + Screen Tiling (#583)

* scene setup

* post processing script

* vignette effect

* small change

* chromatic abberation added

* bloom added

* lens distortion added

* collapse param stuff

* Color grading

* screen tiling added
This commit is contained in:
Rapandrasmus 2023-11-23 22:31:23 +01:00 committed by GitHub
parent 9c37ec4216
commit 012b354db8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 2177 additions and 29 deletions

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 973719517d70b044e95328d5c777afd6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b51cceebf153b484cb3ae8addf344bb3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -295,6 +295,7 @@ GameObject:
- component: {fileID: 1535126665250126034}
- component: {fileID: 1198356187242493155}
- component: {fileID: 647613278910435637}
- component: {fileID: 2582851074058764053}
m_Layer: 31
m_Name: GameView
m_TagString: Untagged
@ -357,6 +358,18 @@ MonoBehaviour:
y: 0
width: 1
height: 1
--- !u!114 &2582851074058764053
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2464883521749415129}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d556607141c07af40b1b5ee71c28c5a6, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &2478945398383251488
GameObject:
m_ObjectHideFlags: 0
@ -597,6 +610,68 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1024
--- !u!1 &5636869531616399768
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1404010314325821530}
- component: {fileID: 4103352589331584694}
- component: {fileID: 313212884350892521}
m_Layer: 21
m_Name: PPVolume
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1404010314325821530
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5636869531616399768}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6052331674888157612}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4103352589331584694
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5636869531616399768}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b9a305e18de0c04dbd257a21cd47087, type: 3}
m_Name:
m_EditorClassIdentifier:
sharedProfile: {fileID: 11400000, guid: b51cceebf153b484cb3ae8addf344bb3, type: 2}
isGlobal: 1
blendDistance: 0
weight: 1
priority: 0
--- !u!114 &313212884350892521
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5636869531616399768}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e3cc0a4bae0c56540b9f598f4644539c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &6052331674005083371
GameObject:
m_ObjectHideFlags: 0
@ -684,6 +759,7 @@ GameObject:
- component: {fileID: 6052331674369862801}
- component: {fileID: 6052331674369862803}
- component: {fileID: 4484390403394809578}
- component: {fileID: 154916227922109824}
m_Layer: 0
m_Name: Main Camera
m_TagString: Untagged
@ -771,6 +847,68 @@ MonoBehaviour:
m_EditorClassIdentifier:
camera: {fileID: 6052331674369862801}
baseColor: {r: 0, g: 0, b: 0, a: 1}
--- !u!114 &154916227922109824
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6052331674369862802}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3}
m_Name:
m_EditorClassIdentifier:
volumeTrigger: {fileID: 6052331674369862766}
volumeLayer:
serializedVersion: 2
m_Bits: 2097152
stopNaNPropagation: 1
finalBlitToCameraTarget: 0
antialiasingMode: 0
temporalAntialiasing:
jitterSpread: 0.75
sharpness: 0.25
stationaryBlending: 0.95
motionBlending: 0.85
subpixelMorphologicalAntialiasing:
quality: 2
fastApproximateAntialiasing:
fastMode: 0
keepAlpha: 0
fog:
enabled: 1
excludeSkybox: 1
debugLayer:
lightMeter:
width: 512
height: 256
showCurves: 1
histogram:
width: 512
height: 256
channel: 3
waveform:
exposure: 0.12
height: 256
vectorscope:
size: 256
exposure: 0.12
overlaySettings:
linearDepth: 0
motionColorIntensity: 4
motionGridSize: 64
colorBlindnessType: 0
colorBlindnessStrength: 1
m_Resources: {fileID: 11400000, guid: d82512f9c8e5d4a4d938b575d47f88d4, type: 2}
m_ShowToolkit: 0
m_ShowCustomSorter: 0
breakBeforeColorGrading: 0
m_BeforeTransparentBundles: []
m_BeforeStackBundles:
- assemblyQualifiedName: PostProcessOutline, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_AfterStackBundles: []
--- !u!1 &6052331674888157615
GameObject:
m_ObjectHideFlags: 0
@ -804,6 +942,7 @@ Transform:
- {fileID: 2274170308165449537}
- {fileID: 4235880641665482497}
- {fileID: 2077856143944097172}
- {fileID: 1404010314325821530}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -842,7 +981,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0.0000009536743, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 2, y: 12}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7734333607666534753

View file

@ -371,9 +371,9 @@ RectTransform:
m_Father: {fileID: 574002313}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: -21}
m_SizeDelta: {x: 32, y: 32}
m_Pivot: {x: 0, y: 0.5}
--- !u!114 &9435782
@ -3519,9 +3519,9 @@ RectTransform:
m_Father: {fileID: 539838476}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 32, y: -21}
m_SizeDelta: {x: 32, y: 32}
m_Pivot: {x: 1, y: 0.5}
--- !u!114 &121871281
@ -3664,9 +3664,9 @@ RectTransform:
m_Father: {fileID: 539838476}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 72, y: -21}
m_SizeDelta: {x: 32, y: 32}
m_Pivot: {x: 1, y: 0.5}
--- !u!114 &129013734
@ -3786,9 +3786,9 @@ RectTransform:
m_Father: {fileID: 539838476}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 112, y: -21}
m_SizeDelta: {x: 32, y: 32}
m_Pivot: {x: 1, y: 0.5}
--- !u!114 &151246938
@ -5005,7 +5005,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -400, y: 0}
m_AnchoredPosition: {x: -399.99994, y: 0}
m_SizeDelta: {x: -800.0001, y: 194}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &195260752
@ -21343,7 +21343,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1589389272}
m_HandleRect: {fileID: 1589389271}
m_Direction: 2
m_Value: 1
m_Value: 0
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
@ -26115,7 +26115,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 153.75513}
m_AnchoredPosition: {x: 0, y: 199.06123}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 1}
--- !u!222 &1154875945
@ -30195,9 +30195,9 @@ RectTransform:
m_Father: {fileID: 574002313}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 40, y: -21}
m_SizeDelta: {x: 32, y: 32}
m_Pivot: {x: 0, y: 0.5}
--- !u!114 &1345846031
@ -31317,7 +31317,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -400, y: 0}
m_AnchoredPosition: {x: -399.99994, y: 0}
m_SizeDelta: {x: -800.0001, y: 194}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &1426168094
@ -35305,8 +35305,8 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1220118245}
m_HandleRect: {fileID: 1220118244}
m_Direction: 2
m_Value: 1.0000007
m_Size: 0.87568516
m_Value: 1
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
@ -38052,9 +38052,9 @@ RectTransform:
m_Father: {fileID: 574002313}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 80, y: -21}
m_SizeDelta: {x: 32, y: 32}
m_Pivot: {x: 0, y: 0.5}
--- !u!114 &1783491359

View file

@ -663,7 +663,7 @@ namespace HeavenStudio
//temp for testing
function = delegate {
var e = eventCaller.currentEntity;
Common.SkillStarManager.instance.DoStarIn(e.beat, e.length);
Common.SkillStarManager.instance.DoStarIn(e.beat, e.length);
}
},
new GameAction("toggle inputs", "Toggle Inputs", 0.5f, true,
@ -774,7 +774,10 @@ namespace HeavenStudio
new Param("colorB", Color.white, "End Color"),
new Param("valA", new EntityTypes.Float(0, 1, 1), "Start Opacity"),
new Param("valB", new EntityTypes.Float(0, 1, 0), "End Opacity"),
new Param("ease", Util.EasingFunction.Ease.Linear, "Ease")
new Param("ease", Util.EasingFunction.Ease.Linear, "Ease", "", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "colorA", "valA" })
})
}
),
new GameAction("filter", "Filter", 1f, true,
@ -791,7 +794,10 @@ namespace HeavenStudio
new Param("start", new EntityTypes.Float(0, 1, 1), "Start Intensity"),
new Param("end", new EntityTypes.Float(0, 1, 1), "End Intensity"),
new Param("ease", Util.EasingFunction.Ease.Linear, "Ease"),
new Param("ease", Util.EasingFunction.Ease.Linear, "Ease", "", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "start" })
}),
}
),
new GameAction("move camera", "Move Camera", 1f, true, new List<Param>()
@ -884,6 +890,162 @@ namespace HeavenStudio
new Param("instantOff", false, "Instant Hide", "Skip the hide animation?"),
}
),
// Post Processing VFX
new GameAction("vignette", "Vignette")
{
resizable = true,
parameters = new()
{
new("intenStart", new EntityTypes.Float(0f, 1f), "Start Intensity"),
new("intenEnd", new EntityTypes.Float(0f, 1f, 1f), "End Intensity"),
new("colorStart", Color.black, "Start Color"),
new("colorEnd", Color.black, "End Color"),
new("smoothStart", new EntityTypes.Float(0.01f, 1f, 0.2f), "Start Smoothness"),
new("smoothEnd", new EntityTypes.Float(0.01f, 1f, 0.2f), "End Smoothness"),
new("roundStart", new EntityTypes.Float(0f, 1f, 1f), "Start Roundness"),
new("roundEnd", new EntityTypes.Float(0f, 1f, 1f), "End Roundness"),
new("rounded", false, "Rounded"),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "intenStart", "colorStart", "smoothStart", "roundStart" })
}),
}
},
new GameAction("cabb", "Chromatic Abberation")
{
resizable = true,
parameters = new()
{
new("intenStart", new EntityTypes.Float(0f, 1f), "Start Intensity"),
new("intenEnd", new EntityTypes.Float(0f, 1f, 1f), "End Intensity"),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "intenStart" })
}),
}
},
new GameAction("bloom", "Bloom")
{
resizable = true,
parameters = new()
{
new("intenStart", new EntityTypes.Float(0f, 100f, 0f), "Start Intensity"),
new("intenEnd", new EntityTypes.Float(0f, 100f, 1f), "End Intensity"),
new("colorStart", Color.white, "Start Tint"),
new("colorEnd", Color.white, "End Tint"),
new("thresholdStart", new EntityTypes.Float(0f, 100f, 1f), "Start Threshold"),
new("thresholdEnd", new EntityTypes.Float(0f, 100f, 1f), "End Threshold"),
new("softKneeStart", new EntityTypes.Float(0f, 1f, 0.5f), "Start Soft Knee"),
new("softKneeEnd", new EntityTypes.Float(0f, 1f, 0.5f), "End Soft Knee"),
new("anaStart", new EntityTypes.Float(-1f, 1f, 0f), "Start Anamorphic Ratio"),
new("anaEnd", new EntityTypes.Float(-1f, 1f, 0f), "End Anamorphic Ratio"),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "intenStart", "colorStart", "thresholdStart", "softKneeStart", "anaStart" })
}),
}
},
new GameAction("lensD", "Lens Distortion")
{
resizable = true,
parameters = new()
{
new("intenStart", new EntityTypes.Float(-100f, 100f, 0f), "Start Intensity"),
new("intenEnd", new EntityTypes.Float(-100f, 100f, 1f), "End Intensity"),
new("xStart", new EntityTypes.Float(0f, 1f, 1f), "Start X Multiplier"),
new("yStart", new EntityTypes.Float(0f, 1f, 1f), "Start Y Multiplier"),
new("xEnd", new EntityTypes.Float(0f, 1f, 1f), "End X Multiplier"),
new("yEnd", new EntityTypes.Float(0f, 1f, 1f), "End Y Multiplier"),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "intenStart", "xStart", "yStart" })
}),
}
},
new GameAction("grain", "Grain")
{
resizable = true,
parameters = new()
{
new("intenStart", new EntityTypes.Float(0f, 1f), "Start Intensity"),
new("intenEnd", new EntityTypes.Float(0f, 1f, 1f), "End Intensity"),
new("sizeStart", new EntityTypes.Float(0.3f, 3f, 1f), "Start Size"),
new("sizeEnd", new EntityTypes.Float(0.3f, 3f, 1f), "End Size"),
new("colored", true, "Colored"),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "intenStart", "sizeStart" })
}),
}
},
new GameAction("colorGrading", "Color Grading")
{
resizable = true,
parameters = new()
{
new("tempStart", new EntityTypes.Float(-100f, 100f), "Start Temperature"),
new("tempEnd", new EntityTypes.Float(-100f, 100f), "End Temperature"),
new("tintStart", new EntityTypes.Float(-100f, 100f), "Start Tint"),
new("tintEnd", new EntityTypes.Float(-100f, 100f), "End Tint"),
new("colorStart", Color.white, "Start Color Filter"),
new("colorEnd", Color.white, "End Color Filter"),
new("hueShiftStart", new EntityTypes.Float(-180f, 180f), "Start Hue Shift"),
new("hueShiftEnd", new EntityTypes.Float(-180f, 180f), "End Hue Shift"),
new("satStart", new EntityTypes.Float(-100f, 100f), "Start Saturation"),
new("satEnd", new EntityTypes.Float(-100f, 100f), "End Saturation"),
new("brightStart", new EntityTypes.Float(-100f, 100f), "Start Brightness"),
new("brightEnd", new EntityTypes.Float(-100f, 100f), "End Brightness"),
new("conStart", new EntityTypes.Float(-100f, 100f), "Start Contrast"),
new("conEnd", new EntityTypes.Float(-100f, 100f), "End Contrast"),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "tempStart", "tintStart", "colorStart", "hueShiftStart", "satStart", "brightStart", "conStart" })
}),
}
},
new GameAction("screenTiling", "Screen Tiling")
{
resizable = true,
parameters = new()
{
new("xStart", new EntityTypes.Float(1, 100, 1), "Start Horizontal Tiles"),
new("yStart", new EntityTypes.Float(1, 100, 1), "Start Vertical Tiles"),
new("xEnd", new EntityTypes.Float(1, 100, 1), "End Horizontal Tiles"),
new("yEnd", new EntityTypes.Float(1, 100, 1), "End Vertical Tiles"),
new("xScrollStart", new EntityTypes.Float(-100, 100, 0), "Start Horizontal Scroll"),
new("yScrollStart", new EntityTypes.Float(-100, 100, 0), "Start Vertical Scroll"),
new("xScrollEnd", new EntityTypes.Float(-100, 100, 0), "End Horizontal Scroll"),
new("yScrollEnd", new EntityTypes.Float(-100, 100, 0), "End Vertical Scroll"),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "xStart", "yStart", "xScrollStart", "yScrollStart" })
}),
}
}
}),
};

View file

@ -0,0 +1,236 @@
using Jukebox;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
namespace HeavenStudio
{
public class PostProcessingVFX : MonoBehaviour
{
private PostProcessVolume _volume;
// events
private List<RiqEntity> _vignettes = new();
private List<RiqEntity> _cabbs = new();
private List<RiqEntity> _blooms = new();
private List<RiqEntity> _lensDs = new();
private List<RiqEntity> _grains = new();
private List<RiqEntity> _colorGradings = new();
private void Awake()
{
_volume = GetComponent<PostProcessVolume>();
}
private void Start()
{
GameManager.instance.onBeatChanged += OnBeatChanged;
}
public void OnBeatChanged(double beat)
{
_vignettes = EventCaller.GetAllInGameManagerList("vfx", new string[] { "vignette" });
_cabbs = EventCaller.GetAllInGameManagerList("vfx", new string[] { "cabb" });
_blooms = EventCaller.GetAllInGameManagerList("vfx", new string[] { "bloom" });
_lensDs = EventCaller.GetAllInGameManagerList("vfx", new string[] { "lensD" });
_grains = EventCaller.GetAllInGameManagerList("vfx", new string[] { "grain" });
_colorGradings = EventCaller.GetAllInGameManagerList("vfx", new string[] { "colorGrading" });
UpdateVignette();
UpdateChromaticAbberations();
UpdateBlooms();
UpdateLensDistortions();
UpdateGrain();
UpdateColorGrading();
}
private void Update()
{
UpdateVignette();
UpdateChromaticAbberations();
UpdateBlooms();
UpdateLensDistortions();
UpdateGrain();
UpdateColorGrading();
}
private void UpdateVignette()
{
if (!_volume.profile.TryGetSettings<Vignette>(out var v)) return;
v.enabled.Override(false);
foreach (var e in _vignettes)
{
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);
v.enabled.Override(newIntensity != 0);
if (!v.enabled) continue;
v.rounded.Override(e["rounded"]);
Color newColor = ColorEase(e["colorStart"], e["colorEnd"], clampNormal, func);
v.color.Override(newColor);
v.intensity.Override(newIntensity);
float newSmoothness = func(e["smoothStart"], e["smoothEnd"], clampNormal);
v.smoothness.Override(newSmoothness);
float newRoundness = func(e["roundStart"], e["roundEnd"], clampNormal);
v.roundness.Override(newRoundness);
}
}
private void UpdateChromaticAbberations()
{
if (!_volume.profile.TryGetSettings<ChromaticAberration>(out var c)) return;
c.enabled.Override(false);
foreach (var e in _cabbs)
{
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);
c.enabled.Override(newIntensity != 0);
if (!c.enabled) continue;
c.intensity.Override(newIntensity);
}
}
private void UpdateBlooms()
{
if (!_volume.profile.TryGetSettings<Bloom>(out var b)) return;
b.enabled.Override(false);
foreach (var e in _blooms)
{
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);
b.enabled.Override(newIntensity != 0);
if (!b.enabled) continue;
b.intensity.Override(newIntensity);
Color newColor = ColorEase(e["colorStart"], e["colorEnd"], clampNormal, func);
b.color.Override(newColor);
float newThreshold = func(e["thresholdStart"], e["thresholdEnd"], clampNormal);
b.threshold.Override(newThreshold);
float newSoftKnee = func(e["softKneeStart"], e["softKneeEnd"], clampNormal);
b.softKnee.Override(newSoftKnee);
float newAna = func(e["anaStart"], e["anaEnd"], clampNormal);
b.anamorphicRatio.Override(newAna);
}
}
private void UpdateLensDistortions()
{
if (!_volume.profile.TryGetSettings<LensDistortion>(out var l)) return;
l.enabled.Override(false);
foreach (var e in _lensDs)
{
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);
l.enabled.Override(newIntensity != 0);
if (!l.enabled) continue;
l.intensity.Override(newIntensity);
float newX = func(e["xStart"], e["xEnd"], clampNormal);
l.intensityX.Override(newX);
float newY = func(e["yStart"], e["yEnd"], clampNormal);
l.intensityY.Override(newY);
}
}
private void UpdateGrain()
{
if (!_volume.profile.TryGetSettings<Grain>(out var g)) return;
g.enabled.Override(false);
foreach (var e in _grains)
{
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.intensity.Override(newIntensity);
g.colored.Override(e["colored"]);
float newSize = func(e["sizeStart"], e["sizeEnd"], clampNormal);
g.size.Override(newSize);
}
}
private void UpdateColorGrading()
{
if (!_volume.profile.TryGetSettings<ColorGrading>(out var c)) return;
c.enabled.Override(false);
foreach (var e in _colorGradings)
{
c.enabled.Override(true);
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 newTemp = func(e["tempStart"], e["tempEnd"], clampNormal);
c.temperature.Override(newTemp);
float newTint = func(e["tintStart"], e["tintEnd"], clampNormal);
c.tint.Override(newTint);
Color newColor = ColorEase(e["colorStart"], e["colorEnd"], clampNormal, func);
c.colorFilter.Override(newColor);
float newHue = func(e["hueShiftStart"], e["hueShiftEnd"], clampNormal);
c.hueShift.Override(newHue);
float newSat = func(e["satStart"], e["satEnd"], clampNormal);
c.saturation.Override(newSat);
float newBright = func(e["brightStart"], e["brightEnd"], clampNormal);
c.brightness.Override(newBright);
float newCon = func(e["conStart"], e["conEnd"], clampNormal);
c.contrast.Override(newCon);
}
}
private Color ColorEase(Color start, Color end, float time, Util.EasingFunction.Function func)
{
float newR = func(start.r, end.r, time);
float newG = func(start.g, end.g, time);
float newB = func(start.b, end.b, time);
return new Color(newR, newG, newB, 1);
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e3cc0a4bae0c56540b9f598f4644539c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,62 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Jukebox;
using UnityEngine.UI;
namespace HeavenStudio
{
public class ScreenTiling : MonoBehaviour
{
private RawImage _image;
private RectTransform _rectTransform;
private List<RiqEntity> _events = new();
private void Awake()
{
_image = GetComponent<RawImage>();
_rectTransform = GetComponent<RectTransform>();
}
private void Start()
{
GameManager.instance.onBeatChanged += OnBeatChanged;
}
public void OnBeatChanged(double beat)
{
_events = EventCaller.GetAllInGameManagerList("vfx", new string[] { "screenTiling" });
ResetUVRect();
Update();
}
private void Update()
{
foreach (var e in _events)
{
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 newXTiles = func(e["xStart"], e["xEnd"], clampNormal);
float newYTiles = func(e["yStart"], e["yEnd"], clampNormal);
float newXScroll = func(e["xScrollStart"], e["xScrollEnd"], clampNormal);
float newYScroll = func(e["yScrollStart"], e["yScrollEnd"], clampNormal);
_image.uvRect = new Rect(newXScroll, newYScroll, newXTiles, newYTiles);
_rectTransform.localScale = new Vector3(1 / newXTiles, 1 / newYTiles);
}
}
public void ResetUVRect()
{
_image.uvRect = new Rect(0, 0, 1, 1);
_rectTransform.localScale = Vector3.one;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d556607141c07af40b1b5ee71c28c5a6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -26,7 +26,7 @@ TagManager:
-
-
- GameOverlaysCmn
-
- PostProcessingVFX
-
-
-