同步-后处理调整

This commit is contained in:
SoulliesOfficial
2026-07-09 17:10:17 -04:00
parent d474a8929c
commit 2b01d76bf4
21 changed files with 150 additions and 105 deletions

View File

@@ -213,7 +213,7 @@ Material:
- _Dst: 10 - _Dst: 10
- _DstBlend: 0 - _DstBlend: 0
- _DstBlendAlpha: 0 - _DstBlendAlpha: 0
- _EdgeValue: 0.93644387 - _EdgeValue: 0.30297375
- _EnvironmentReflections: 1 - _EnvironmentReflections: 1
- _FNLfanxiangkaiguan: 0 - _FNLfanxiangkaiguan: 0
- _Face: 1 - _Face: 1
@@ -258,7 +258,7 @@ Material:
- _Mask_scale: 1 - _Mask_scale: 1
- _Metallic: 0 - _Metallic: 0
- _OcclusionStrength: 1 - _OcclusionStrength: 1
- _Opacity: 0.063556135 - _Opacity: 0.69702625
- _Parallax: 0.005 - _Parallax: 0.005
- _Pass: 0 - _Pass: 0
- _QueueOffset: 0 - _QueueOffset: 0

View File

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

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3977ac8aeca6a7342901ef341d55891d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

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

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
€(<28>œx5¿f<C2BF>^ ‰%œd¤ Ü~æQF¦­ à°ÉO(DÓ¶Hð#‰ƒ²s? ')8á<>šðGþtáÔK"MŠþس݃"ódgÿÖ"à'áª;y F.Ю|[…=Eб•gјTЬъЄѕЙcяп—иNНTJ)Ё—L«Ра њtЛв@€CB6Њ©ф…ф{<+В$ и.fDЭ=5%Т•AЙeV|я8ъћЦ‡mЌсџ2FЙu4љ$K)lsQ)­dnРЏr

View File

@@ -1 +1 @@
!ÕØ!éÆLú²«Ñ sð4Kš8fHw7éL -à8Lv<4C>»Ò³<ª½ Cw=åò-êIa±øÙ@ðï—â©<C3A2>TùNr]ç)N}+µ$ŠÏÎPT"á²CwÊF<C38A>ŠNnÏ%eç 1k<31>ÁýŠ3<>`vè59È‚ô ŸJÀ;óÕá¡ra0C$ÁеrÉèÙcAIhO»í8A7úõËå¸Ñ7£Á.Al~ ',–…ÒtØ0²KL¶ÌŒ<C38C>7õbmþÄø¡¯?މù Z6ŽÖ¥ ߇XDWť*=ßŢ@Ć·żçmrżáď nť}aŐ[dlmqŁ™ăK«k$Ü޵¦8ČE éZ—M/ç#Ě!0ę

View File

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

View File

@@ -7,8 +7,8 @@ namespace Ichni.RhythmGame
public class PixelateEffect : EffectBase public class PixelateEffect : EffectBase
{ {
#region [] Effect Parameters #region [] Effect Parameters
public float bottomX; [Range(0f, 1f)] public float bottomX;
public float bottomY; [Range(0f, 1f)] public float bottomY;
public AnimationCurve intensityCurve; public AnimationCurve intensityCurve;
private PixelateVolume _pixelateVolume; private PixelateVolume _pixelateVolume;
@@ -19,8 +19,8 @@ namespace Ichni.RhythmGame
: base(effectTime) // 激活受控时间分段 : base(effectTime) // 激活受控时间分段
{ {
this.effectTime = effectTime; this.effectTime = effectTime;
this.bottomX = bottomX; this.bottomX = Mathf.Clamp01(bottomX);
this.bottomY = bottomY; this.bottomY = Mathf.Clamp01(bottomY);
this.intensityCurve = intensityCurve; this.intensityCurve = intensityCurve;
} }
@@ -41,8 +41,8 @@ namespace Ichni.RhythmGame
if (_pixelateVolume != null) if (_pixelateVolume != null)
{ {
_pixelateVolume.forceActive.value = true; _pixelateVolume.forceActive.value = true;
_pixelateVolume.strengthX.value = Screen.width; _pixelateVolume.strengthX.value = 1f;
_pixelateVolume.strengthY.value = Screen.height; _pixelateVolume.strengthY.value = 1f;
} }
} }
@@ -50,8 +50,9 @@ namespace Ichni.RhythmGame
{ {
if (_pixelateVolume != null) if (_pixelateVolume != null)
{ {
float x = Mathf.Lerp(Screen.width, bottomX, intensityCurve.Evaluate(effectProgressPercent)); float progress = intensityCurve == null ? effectProgressPercent : intensityCurve.Evaluate(effectProgressPercent);
float y = Mathf.Lerp(Screen.height, bottomY, 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.strengthX.value = x;
_pixelateVolume.strengthY.value = y; _pixelateVolume.strengthY.value = y;
@@ -67,8 +68,8 @@ namespace Ichni.RhythmGame
if (_pixelateVolume != null) if (_pixelateVolume != null)
{ {
_pixelateVolume.forceActive.value = false; _pixelateVolume.forceActive.value = false;
_pixelateVolume.strengthX.value = Screen.width; _pixelateVolume.strengthX.value = 1f;
_pixelateVolume.strengthY.value = Screen.height; _pixelateVolume.strengthY.value = 1f;
} }
} }
#endregion #endregion

Binary file not shown.

View File

@@ -23,15 +23,14 @@ Shader "Hidden/Custom/Pixelate"
half4 Frag(Varyings input) : SV_Target half4 Frag(Varyings input) : SV_Target
{ {
float2 uv = input.texcoord; float2 uv = input.texcoord;
float2 strength = float2(_PixelateStrengthX, _PixelateStrengthY); float2 resolutionRatio = saturate(float2(_PixelateStrengthX, _PixelateStrengthY));
// 使用当前渲染目标分辨率,而不是设备固定分辨率,兼容动态分辨率和渲染缩放。
// 防止除数为0的极小可能崩溃 float2 targetResolution = max(floor(_ScreenParams.xy * resolutionRatio), float2(1.0, 1.0));
strength = max(strength, float2(1.0, 1.0));
float2 uvScaled = uv * strength; float2 uvScaled = uv * targetResolution;
float2 uvFloor = floor(uvScaled); float2 uvFloor = floor(uvScaled);
float2 uvCenter = uvFloor + 0.5; float2 uvCenter = uvFloor + 0.5;
float2 uvPixelated = uvCenter / strength; float2 uvPixelated = uvCenter / targetResolution;
// Blitter框架将自动把 SourceTexture 注入为 _BlitTexture // Blitter框架将自动把 SourceTexture 注入为 _BlitTexture
return SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uvPixelated); return SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uvPixelated);

View File

@@ -15,9 +15,12 @@ namespace SLSUtilities.Rendering.PostProcessing
[Tooltip("是否强制开启像素化效果")] [Tooltip("是否强制开启像素化效果")]
public BoolParameter forceActive = new BoolParameter(false); public BoolParameter forceActive = new BoolParameter(false);
public FloatParameter strengthX = new FloatParameter(1920f); [Tooltip("横向分辨率比例0 到 11 为当前渲染分辨率")]
public FloatParameter strengthY = new FloatParameter(1080f); public FloatParameter strengthX = new FloatParameter(1f);
[Tooltip("纵向分辨率比例0 到 11 为当前渲染分辨率")]
public FloatParameter strengthY = new FloatParameter(1f);
// 返回我们在 Shader 里定义的名字,保证管家可以据此获取材质 // 返回我们在 Shader 里定义的名字,保证管家可以据此获取材质
public override string GetShaderName() => "Hidden/Custom/Pixelate"; public override string GetShaderName() => "Hidden/Custom/Pixelate";
@@ -32,11 +35,11 @@ namespace SLSUtilities.Rendering.PostProcessing
{ {
if (material == null) return; if (material == null) return;
cmd.SetGlobalFloat(InternalShaderHelpers.ID._PixelateStrengthX, strengthX.value); cmd.SetGlobalFloat(InternalShaderHelpers.ID._PixelateStrengthX, Mathf.Clamp01(strengthX.value));
cmd.SetGlobalFloat(InternalShaderHelpers.ID._PixelateStrengthY, strengthY.value); cmd.SetGlobalFloat(InternalShaderHelpers.ID._PixelateStrengthY, Mathf.Clamp01(strengthY.value));
// 使用你的统一管家分发的 Blitter 进行优雅渲染 // 使用你的统一管家分发的 Blitter 进行优雅渲染
Blitter.BlitCameraTexture(cmd, source, destination, material, 0); Blitter.BlitCameraTexture(cmd, source, destination, material, 0);
} }
} }
} }

Binary file not shown.

View File

@@ -0,0 +1,14 @@
{
"useBuildCacheServer": false,
"cacheServerHost": "",
"cacheServerPort": 8126,
"threadedArchiving": true,
"logCacheMiss": false,
"logAssetWarnings": true,
"slimWriteResults": true,
"maximumCacheSize": 20,
"useDetailedBuildLog": false,
"useV2Hasher": true,
"fileIDHashSeed": 0,
"prefabPackedHeaderSize": 2
}

View File

@@ -262,7 +262,7 @@ MonoBehaviour:
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 1 m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name: ConsoleWindow m_Name: ProjectBrowser
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Children: [] m_Children: []
m_Position: m_Position:
@@ -271,16 +271,16 @@ MonoBehaviour:
y: 513.3333 y: 513.3333
width: 1195.3334 width: 1195.3334
height: 300 height: 300
m_MinSize: {x: 101, y: 126} m_MinSize: {x: 231, y: 276}
m_MaxSize: {x: 4001, y: 4026} m_MaxSize: {x: 10001, y: 10026}
m_ActualView: {fileID: 19} m_ActualView: {fileID: 18}
m_Panes: m_Panes:
- {fileID: 18} - {fileID: 18}
- {fileID: 19} - {fileID: 19}
- {fileID: 20} - {fileID: 20}
- {fileID: 21} - {fileID: 21}
m_Selected: 1 m_Selected: 0
m_LastSelected: 0 m_LastSelected: 1
--- !u!114 &12 --- !u!114 &12
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 52 m_ObjectHideFlags: 52
@@ -332,7 +332,7 @@ MonoBehaviour:
m_Pos: m_Pos:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
y: 42.666668 y: 0
width: 1706.6666 width: 1706.6666
height: 36 height: 36
m_SerializedDataModeController: m_SerializedDataModeController:
@@ -717,7 +717,7 @@ MonoBehaviour:
height: 720 height: 720
m_MinimalGUI: 1 m_MinimalGUI: 1
m_defaultScale: 0.64768517 m_defaultScale: 0.64768517
m_LastWindowPixelSize: {x: 1384.0001, y: 731} m_LastWindowPixelSize: {x: 922.66675, y: 487.3333}
m_ClearInEditMode: 1 m_ClearInEditMode: 1
m_NoCameraWarning: 1 m_NoCameraWarning: 1
m_LowResolutionForAspectRatios: 00000000000000000000 m_LowResolutionForAspectRatios: 00000000000000000000
@@ -747,7 +747,7 @@ MonoBehaviour:
m_Pos: m_Pos:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
y: 78.66667 y: 24
width: 269.66666 width: 269.66666
height: 487.3333 height: 487.3333
m_SerializedDataModeController: m_SerializedDataModeController:
@@ -770,27 +770,15 @@ MonoBehaviour:
m_LastClickedID: m_LastClickedID:
m_Data: 0 m_Data: 0
m_ExpandedIDs: m_ExpandedIDs:
- m_Data: -90416 - m_Data: -13608
- m_Data: -90342 - m_Data: -13180
- m_Data: -90336 - m_Data: -10902
- m_Data: -65648 - m_Data: -8312
- m_Data: -61864
- m_Data: -61850
- m_Data: -61846
- m_Data: -61842
- m_Data: -61836
- m_Data: -61828
- m_Data: -61816
- m_Data: -59336
- m_Data: -41986
- m_Data: -41980
- m_Data: -13506
- m_Data: -10978
- m_Data: -1338 - m_Data: -1338
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: DTM_CircleSpinTrails(Clone) m_Name:
m_OriginalName: DTM_CircleSpinTrails(Clone) m_OriginalName:
m_EditFieldRect: m_EditFieldRect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
@@ -798,10 +786,10 @@ MonoBehaviour:
width: 0 width: 0
height: 0 height: 0
m_UserData: m_UserData:
m_Data: -90342 m_Data: 0
m_IsWaitingForDelay: 0 m_IsWaitingForDelay: 0
m_IsRenaming: 0 m_IsRenaming: 0
m_OriginalEventType: 0 m_OriginalEventType: 11
m_IsRenamingFilename: 0 m_IsRenamingFilename: 0
m_TrimLeadingAndTrailingWhitespace: 0 m_TrimLeadingAndTrailingWhitespace: 0
m_ClientGUIView: {fileID: 9} m_ClientGUIView: {fileID: 9}
@@ -834,8 +822,8 @@ MonoBehaviour:
m_TextWithWhitespace: "Scene\u200B" m_TextWithWhitespace: "Scene\u200B"
m_Pos: m_Pos:
serializedVersion: 2 serializedVersion: 2
x: 270.6667 x: 271.66666
y: 78.66667 y: 24
width: 922.66675 width: 922.66675
height: 487.3333 height: 487.3333
m_SerializedDataModeController: m_SerializedDataModeController:
@@ -1556,11 +1544,11 @@ MonoBehaviour:
m_Rotation: m_Rotation:
m_Target: {x: -0.23046315, y: 0.41502702, z: -0.10957123, w: -0.8734504} m_Target: {x: -0.23046315, y: 0.41502702, z: -0.10957123, w: -0.8734504}
speed: 2 speed: 2
m_Value: {x: -0.23054008, y: 0.41409498, z: -0.109325305, w: -0.87374175} m_Value: {x: -0.23046315, y: 0.41502702, z: -0.10957123, w: -0.8734504}
m_Size: m_Size:
m_Target: 324.6959 m_Target: 324.6959
speed: 2 speed: 2
m_Value: 310.71378 m_Value: 324.6959
m_Ortho: m_Ortho:
m_Target: 0 m_Target: 0
speed: 2 speed: 2
@@ -1724,7 +1712,7 @@ MonoBehaviour:
m_Pos: m_Pos:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
y: 592 y: 537.3333
width: 1194.3334 width: 1194.3334
height: 274 height: 274
m_SerializedDataModeController: m_SerializedDataModeController:
@@ -1751,7 +1739,7 @@ MonoBehaviour:
m_SkipHidden: 0 m_SkipHidden: 0
m_SearchArea: 1 m_SearchArea: 1
m_Folders: m_Folders:
- Packages/com.unity.visualscripting/Editor/VisualScripting.Core/Plugins - Assets/Resources/Beatmaps/Chapter0/Space Rain/Special
m_Globs: [] m_Globs: []
m_ProductIds: m_ProductIds:
m_AnyWithAssetOrigin: 0 m_AnyWithAssetOrigin: 0
@@ -1761,27 +1749,20 @@ MonoBehaviour:
m_ViewMode: 1 m_ViewMode: 1
m_StartGridSize: 16 m_StartGridSize: 16
m_LastFolders: m_LastFolders:
- Packages/com.unity.visualscripting/Editor/VisualScripting.Core/Plugins - Assets/Resources/Beatmaps/Chapter0/Space Rain/Special
m_LastFoldersGridSize: 16 m_LastFoldersGridSize: 16
m_LastProjectPath: D:\Projects\ichni Official m_LastProjectPath: D:\Projects\ichni Official
m_LockTracker: m_LockTracker:
m_IsLocked: 0 m_IsLocked: 0
m_LastLocalAssetsSearchArea: 1 m_LastLocalAssetsSearchArea: 1
m_FolderTreeState: m_FolderTreeState:
scrollPos: {x: 0, y: 3714} scrollPos: {x: 0, y: 802}
m_SelectedIDs: m_SelectedIDs:
- m_Data: 108238 - m_Data: 82862
m_LastClickedID: m_LastClickedID:
m_Data: 108238 m_Data: 82862
m_ExpandedIDs: m_ExpandedIDs:
- m_Data: 0 - m_Data: 0
- m_Data: 82164
- m_Data: 82166
- m_Data: 82168
- m_Data: 82170
- m_Data: 82172
- m_Data: 82174
- m_Data: 82176
- m_Data: 82178 - m_Data: 82178
- m_Data: 82180 - m_Data: 82180
- m_Data: 82182 - m_Data: 82182
@@ -1868,15 +1849,25 @@ MonoBehaviour:
- m_Data: 82344 - m_Data: 82344
- m_Data: 82346 - m_Data: 82346
- m_Data: 82348 - m_Data: 82348
- m_Data: 82828 - m_Data: 82350
- m_Data: 82886 - m_Data: 82352
- m_Data: 82888 - m_Data: 82354
- m_Data: 82934 - m_Data: 82356
- m_Data: 82938 - m_Data: 82358
- m_Data: 82962 - m_Data: 82360
- m_Data: 108240 - m_Data: 82362
- m_Data: 1000000000 - m_Data: 82364
- m_Data: 2147483647 - m_Data: 82366
- m_Data: 82368
- m_Data: 82370
- m_Data: 82372
- m_Data: 82374
- m_Data: 82376
- m_Data: 82378
- m_Data: 82380
- m_Data: 82382
- m_Data: 82384
- m_Data: 82386
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: m_Name:
@@ -1909,13 +1900,6 @@ MonoBehaviour:
m_Data: 0 m_Data: 0
m_ExpandedIDs: m_ExpandedIDs:
- m_Data: 0 - m_Data: 0
- m_Data: 82164
- m_Data: 82166
- m_Data: 82168
- m_Data: 82170
- m_Data: 82172
- m_Data: 82174
- m_Data: 82176
- m_Data: 82178 - m_Data: 82178
- m_Data: 82180 - m_Data: 82180
- m_Data: 82182 - m_Data: 82182
@@ -2002,6 +1986,25 @@ MonoBehaviour:
- m_Data: 82344 - m_Data: 82344
- m_Data: 82346 - m_Data: 82346
- m_Data: 82348 - m_Data: 82348
- m_Data: 82350
- m_Data: 82352
- m_Data: 82354
- m_Data: 82356
- m_Data: 82358
- m_Data: 82360
- m_Data: 82362
- m_Data: 82364
- m_Data: 82366
- m_Data: 82368
- m_Data: 82370
- m_Data: 82372
- m_Data: 82374
- m_Data: 82376
- m_Data: 82378
- m_Data: 82380
- m_Data: 82382
- m_Data: 82384
- m_Data: 82386
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: m_Name:
@@ -2028,10 +2031,9 @@ MonoBehaviour:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_ResourceFile: m_ResourceFile:
m_ListAreaState: m_ListAreaState:
m_SelectedInstanceIDs: m_SelectedInstanceIDs: []
- m_Data: 48546 m_LastClickedInstanceID: 0
m_LastClickedInstanceID: 48546 m_HadKeyboardFocusLastEvent: 1
m_HadKeyboardFocusLastEvent: 0
m_ExpandedInstanceIDs: m_ExpandedInstanceIDs:
- m_Data: 0 - m_Data: 0
- m_Data: 80838 - m_Data: 80838
@@ -2209,8 +2211,8 @@ MonoBehaviour:
m_TextWithWhitespace: "Inspector\u200B" m_TextWithWhitespace: "Inspector\u200B"
m_Pos: m_Pos:
serializedVersion: 2 serializedVersion: 2
x: 1195.3334 x: 1196.3334
y: 78.66667 y: 24
width: 510.33325 width: 510.33325
height: 787.3333 height: 787.3333
m_SerializedDataModeController: m_SerializedDataModeController: