bloom替换

This commit is contained in:
SoulliesOfficial
2026-06-30 16:02:52 -04:00
parent 5158c529f7
commit fd75502f1a
7 changed files with 896 additions and 250 deletions

View File

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

View File

@@ -14732,10 +14732,10 @@ MonoBehaviour:
m_addressable:
m_atlas:
m_fileSize: 4590
m_assetChangeTS: 1782741627
m_assetChangeTS: 1782849601
m_fileInfoReadTS: 1782741681
m_fileWriteTS: 1782741627
m_cachefileWriteTS: 1782741627
m_cachefileWriteTS: 0
refreshStamp: 3
UseGUIDsList:
- guid: bf2edee5c58d82540a51f03df9d42094
@@ -33666,10 +33666,10 @@ MonoBehaviour:
m_addressable:
m_atlas:
m_fileSize: 4587
m_assetChangeTS: 1782741627
m_assetChangeTS: 1782849602
m_fileInfoReadTS: 1782741681
m_fileWriteTS: 1782741627
m_cachefileWriteTS: 1782741627
m_cachefileWriteTS: 0
refreshStamp: 3
UseGUIDsList:
- guid: bf2edee5c58d82540a51f03df9d42094
@@ -131525,10 +131525,10 @@ MonoBehaviour:
m_addressable:
m_atlas:
m_fileSize: 1714023
m_assetChangeTS: 1781421390
m_fileInfoReadTS: 1781421400
m_fileWriteTS: 1781421390
m_cachefileWriteTS: 1781421390
m_assetChangeTS: 1782849597
m_fileInfoReadTS: 1782849597
m_fileWriteTS: 1782849597
m_cachefileWriteTS: 1782849597
refreshStamp: 3
UseGUIDsList:
- guid: 0000000000000000f000000000000000
@@ -186258,10 +186258,10 @@ MonoBehaviour:
m_addressable:
m_atlas:
m_fileSize: 4597
m_assetChangeTS: 1782741627
m_assetChangeTS: 1782849602
m_fileInfoReadTS: 1782741681
m_fileWriteTS: 1782741627
m_cachefileWriteTS: 1782741627
m_cachefileWriteTS: 0
refreshStamp: 3
UseGUIDsList:
- guid: bf2edee5c58d82540a51f03df9d42094
@@ -260567,32 +260567,6 @@ MonoBehaviour:
UseGUIDsList:
- guid: 96eebd1d5b544e74ca55536541f943f2
ids: 4a000000
- guid: 28802a2f6f0ff2942bd2a248b9b68960
type: 9
m_fileInfoHash: 1113.sln
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 1113
m_assetChangeTS: 0
m_fileInfoReadTS: 1781924800
m_fileWriteTS: 1781432742
m_cachefileWriteTS: 1781432742
refreshStamp: 3
UseGUIDsList: []
- guid: 88f0993afef43b34eb23a79fbdd94e9b
type: 9
m_fileInfoHash: 722.csproj
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 722
m_assetChangeTS: 0
m_fileInfoReadTS: 1781924800
m_fileWriteTS: 1781432742
m_cachefileWriteTS: 1781432742
refreshStamp: 3
UseGUIDsList: []
- guid: 2c06fda76d96da644ae1f8d15233a23b
type: 3
m_fileInfoHash: 1260426.unity
@@ -262673,6 +262647,617 @@ MonoBehaviour:
m_cachefileWriteTS: 1782741588
refreshStamp: 3
UseGUIDsList: []
- guid: 0023a0858ba124646a55dfcb7231ed46
type: 9
m_fileInfoHash: 369874.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 369874
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322241
m_cachefileWriteTS: 1756322241
refreshStamp: 3
UseGUIDsList: []
- guid: 70777e8ce9f3c8d4a8182ca2f965cdb2
type: 9
m_fileInfoHash: 108227.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 108227
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322398
m_cachefileWriteTS: 1756322398
refreshStamp: 3
UseGUIDsList: []
- guid: c0a0a980c9ba86345bc15411db88d34f
type: 9
m_fileInfoHash: 45767503.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 45767503
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322510
m_cachefileWriteTS: 1756322510
refreshStamp: 3
UseGUIDsList: []
- guid: e00e6f90ab8233e46a41c5e33917c642
type: 9
m_fileInfoHash: 557844.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 557844
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322554
m_cachefileWriteTS: 1756322554
refreshStamp: 3
UseGUIDsList: []
- guid: 0190b8bde50f12943926613d9a63c89a
type: 9
m_fileInfoHash: 269031.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 269031
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1757349462
m_cachefileWriteTS: 1757349462
refreshStamp: 3
UseGUIDsList: []
- guid: d1c0b77896049554fa4b635531caf741
type: 9
m_fileInfoHash: 3185682.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 3185682
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322536
m_cachefileWriteTS: 1756322536
refreshStamp: 3
UseGUIDsList: []
- guid: 2243c8b4e1ab6914995699133f67ab5a
type: 9
m_fileInfoHash: 84545.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 84545
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322282
m_cachefileWriteTS: 1756322282
refreshStamp: 3
UseGUIDsList: []
- guid: 929783250050f8a448821b6ca1f2c578
type: 9
m_fileInfoHash: 41699.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 41699
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322450
m_cachefileWriteTS: 1756322450
refreshStamp: 3
UseGUIDsList: []
- guid: 13ab599a7bda4e54fba3e92a13c9580a
type: 9
m_fileInfoHash: 79965.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 79965
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322264
m_cachefileWriteTS: 1756322264
refreshStamp: 3
UseGUIDsList: []
- guid: 641c955d37d2fac4f87e00ac5c9d9bd8
type: 9
m_fileInfoHash: 360203.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 360203
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322382
m_cachefileWriteTS: 1756322382
refreshStamp: 3
UseGUIDsList: []
- guid: b460b52e6c1feae45b70b7ddc2c45bd6
type: 9
m_fileInfoHash: 23184.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 23184
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322489
m_cachefileWriteTS: 1756322489
refreshStamp: 3
UseGUIDsList: []
- guid: e447b3d7d913d694ca35f74e30581840
type: 9
m_fileInfoHash: 277741.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 277741
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1757349504
m_cachefileWriteTS: 1757349504
refreshStamp: 3
UseGUIDsList: []
- guid: f4990f6ace6142c4bbbf41cdd80b0bd3
type: 9
m_fileInfoHash: 45519.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 45519
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322580
m_cachefileWriteTS: 1756322580
refreshStamp: 3
UseGUIDsList: []
- guid: 3579d9cf4b75c564faa8fffc58a9f3f6
type: 9
m_fileInfoHash: 369778.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 369778
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322310
m_cachefileWriteTS: 1756322310
refreshStamp: 3
UseGUIDsList: []
- guid: 6584a66582083a1459dcf5e4e87f6d62
type: 9
m_fileInfoHash: 268546.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 268546
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1757349478
m_cachefileWriteTS: 1757349478
refreshStamp: 3
UseGUIDsList: []
- guid: c5303861611f41c438a30be552da5de4
type: 9
m_fileInfoHash: 91198.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 91198
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322515
m_cachefileWriteTS: 1756322515
refreshStamp: 3
UseGUIDsList: []
- guid: 2690f45490c175045bbdc63395bf6278
type: 9
m_fileInfoHash: 365438.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 365438
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322286
m_cachefileWriteTS: 1756322286
refreshStamp: 3
UseGUIDsList: []
- guid: d69745226619e3241a8e04ce86aee6a6
type: 9
m_fileInfoHash: 269026.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 269026
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1757349499
m_cachefileWriteTS: 1757349499
refreshStamp: 3
UseGUIDsList: []
- guid: e6fc8948257acee42b666d0bfe1d782c
type: 9
m_fileInfoHash: 110636.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 110636
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322563
m_cachefileWriteTS: 1756322563
refreshStamp: 3
UseGUIDsList: []
- guid: f6f268949ccf3f34fa4d18e92501ed82
type: 9
m_fileInfoHash: 83402.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 83402
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322585
m_cachefileWriteTS: 1756322585
refreshStamp: 3
UseGUIDsList: []
- guid: 1782b72cd0e99a54fac09382c482e3db
type: 9
m_fileInfoHash: 254618.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 254618
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1757349467
m_cachefileWriteTS: 1757349467
refreshStamp: 3
UseGUIDsList: []
- guid: 37e6a9374416bc946a55779c58d0d984
type: 9
m_fileInfoHash: 269191.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 269191
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1757349472
m_cachefileWriteTS: 1757349472
refreshStamp: 3
UseGUIDsList: []
- guid: 57fcea0ed8b5eb347923c4c21fa31b57
type: 9
m_fileInfoHash: 38182.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 38182
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322361
m_cachefileWriteTS: 1756322361
refreshStamp: 3
UseGUIDsList: []
- guid: 0904cdf24ddcd5042b024326476220d5
type: 9
m_fileInfoHash: 40611.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 40611
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322254
m_cachefileWriteTS: 1756322254
refreshStamp: 3
UseGUIDsList: []
- guid: 19939ee2cdb76e0489b1b8cd4bed7f3d
type: 9
m_fileInfoHash: 108414.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 108414
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322272
m_cachefileWriteTS: 1756322272
refreshStamp: 3
UseGUIDsList: []
- guid: 49d5bcbbd4cbd754b98cf3200197b0f1
type: 9
m_fileInfoHash: 267725.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 267725
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1757349474
m_cachefileWriteTS: 1757349474
refreshStamp: 3
UseGUIDsList: []
- guid: 69bc3229216b1504ea3e28b5820bbb0d
type: 9
m_fileInfoHash: 83642.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 83642
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322387
m_cachefileWriteTS: 1756322387
refreshStamp: 3
UseGUIDsList: []
- guid: 89f0b84148d149d4d96b838d7ef60e92
type: 9
m_fileInfoHash: 106917.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 106917
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322438
m_cachefileWriteTS: 1756322438
refreshStamp: 3
UseGUIDsList: []
- guid: a9d68dd8913f05d4d9ce75e7b40c6044
type: 9
m_fileInfoHash: 172686.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 172686
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322476
m_cachefileWriteTS: 1756322476
refreshStamp: 3
UseGUIDsList: []
- guid: 7a0bb33169d95ec499136d59cb25918b
type: 9
m_fileInfoHash: 356286.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 356286
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322413
m_cachefileWriteTS: 1756322413
refreshStamp: 3
UseGUIDsList: []
- guid: 8a87ed432fe2d97498c0de5fae312e35
type: 9
m_fileInfoHash: 90924.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 90924
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322439
m_cachefileWriteTS: 1756322439
refreshStamp: 3
UseGUIDsList: []
- guid: 9a5e61a8b3421b944863d0946e32da0a
type: 9
m_fileInfoHash: 104671.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 104671
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322459
m_cachefileWriteTS: 1756322459
refreshStamp: 3
UseGUIDsList: []
- guid: aa102d640b98b5d4781710a3a3dd6983
type: 9
m_fileInfoHash: 325098.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 325098
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322476
m_cachefileWriteTS: 1756322476
refreshStamp: 3
UseGUIDsList: []
- guid: ba281a1a00c8ac54c914e0763299f637
type: 9
m_fileInfoHash: 110423.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 110423
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322497
m_cachefileWriteTS: 1756322497
refreshStamp: 3
UseGUIDsList: []
- guid: 4b5cb8698f2d9c14fadf8e2383441d37
type: 9
m_fileInfoHash: 110653.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 110653
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322337
m_cachefileWriteTS: 1756322337
refreshStamp: 3
UseGUIDsList: []
- guid: fbd1fd9b3a70fad429d1eaaa5799c2a5
type: 9
m_fileInfoHash: 368597.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 368597
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322592
m_cachefileWriteTS: 1756322592
refreshStamp: 3
UseGUIDsList: []
- guid: 7c3bfbbeb9427b94099254e2e2768ad4
type: 9
m_fileInfoHash: 91311.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 91311
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322416
m_cachefileWriteTS: 1756322416
refreshStamp: 3
UseGUIDsList: []
- guid: ec984c51d4ae2504184eeb292734c672
type: 9
m_fileInfoHash: 277492.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 277492
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1757349506
m_cachefileWriteTS: 1757349506
refreshStamp: 3
UseGUIDsList: []
- guid: fcc4d2eb0af82e546ae75506872cf092
type: 9
m_fileInfoHash: 45140.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 45140
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322593
m_cachefileWriteTS: 1756322593
refreshStamp: 3
UseGUIDsList: []
- guid: 9da5530d5ebfab24c8ecad68795e720f
type: 9
m_fileInfoHash: 304772.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 304772
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322462
m_cachefileWriteTS: 1756322462
refreshStamp: 3
UseGUIDsList: []
- guid: cd0a0171c5157b748afe763b89f71211
type: 9
m_fileInfoHash: 45572.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 45572
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322529
m_cachefileWriteTS: 1756322529
refreshStamp: 3
UseGUIDsList: []
- guid: 2e995dfe11e22d34d92432383d15c067
type: 9
m_fileInfoHash: 277670.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 277670
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1757349470
m_cachefileWriteTS: 1757349470
refreshStamp: 3
UseGUIDsList: []
- guid: 2edbf4a9b9544774bbef617e92429664
type: 9
m_fileInfoHash: 68647.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 68647
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322300
m_cachefileWriteTS: 1756322300
refreshStamp: 3
UseGUIDsList: []
- guid: 2e9da72e7e3196146bf7d27450013734
type: 9
m_fileInfoHash: 41701.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 41701
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322300
m_cachefileWriteTS: 1756322300
refreshStamp: 3
UseGUIDsList: []
- guid: ae2ce8ad295486349839288636aed1ed
type: 9
m_fileInfoHash: 269169.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 269169
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1757349491
m_cachefileWriteTS: 1757349491
refreshStamp: 3
UseGUIDsList: []
- guid: eefe45a405f061045be947217e30ed10
type: 9
m_fileInfoHash: 267843.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 267843
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1757349506
m_cachefileWriteTS: 1757349506
refreshStamp: 3
UseGUIDsList: []
- guid: 4f665a06c5a2aa5499fa1c79ac058999
type: 9
m_fileInfoHash: 83956.unitypackage
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 83956
m_assetChangeTS: 0
m_fileInfoReadTS: 1782849594
m_fileWriteTS: 1756322344
m_cachefileWriteTS: 1756322344
refreshStamp: 3
UseGUIDsList: []
setting:
alternateColor: 1
excludeTypes: 0

View File

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

View File

@@ -1,6 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-7893295128165547882
--- !u!114 &-7803705743286941064
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
@@ -9,17 +9,14 @@ MonoBehaviour:
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3}
m_Name: Bloom
m_EditorClassIdentifier:
m_Script: {fileID: 11500000, guid: bb4cc52ae13b01a44ab204c23af5263f, type: 3}
m_Name: AnimeBloom
m_EditorClassIdentifier: Assembly-CSharp::SLSUtilities.Rendering.PostProcessing.AnimeBloom
active: 1
skipIterations:
m_OverrideState: 0
m_Value: 1
threshold:
m_OverrideState: 1
m_Value: 1
intensity:
m_OverrideState: 1
m_Value: 0.5
threshold:
m_OverrideState: 1
m_Value: 1
scatter:
@@ -27,29 +24,19 @@ MonoBehaviour:
m_Value: 0.7
clamp:
m_OverrideState: 1
m_Value: 10
m_Value: 65472
diffusion:
m_OverrideState: 1
m_Value: 6
initialDownscaleShift:
m_OverrideState: 1
m_Value: 1
kernelScale:
m_OverrideState: 1
m_Value: 3
tint:
m_OverrideState: 1
m_Value: {r: 1, g: 1, b: 1, a: 1}
highQualityFiltering:
m_OverrideState: 0
m_Value: 0
filter:
m_OverrideState: 0
m_Value: 0
downscale:
m_OverrideState: 0
m_Value: 0
maxIterations:
m_OverrideState: 0
m_Value: 6
dirtTexture:
m_OverrideState: 0
m_Value: {fileID: 0}
dimension: 1
dirtIntensity:
m_OverrideState: 0
m_Value: 0
--- !u!114 &-7011558710299706105
MonoBehaviour:
m_ObjectHideFlags: 3
@@ -170,8 +157,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
components:
- {fileID: 8593306801730158424}
- {fileID: -7803705743286941064}
- {fileID: 849379129802519247}
- {fileID: -7893295128165547882}
- {fileID: -7011558710299706105}
- {fileID: -2021892299009130980}
- {fileID: 1307736113976530991}
@@ -254,7 +241,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 148ba37ea406c934ea39cee8e2dd1108, type: 3}
m_Name: Sharpen
m_EditorClassIdentifier: Assembly-CSharp::SLSUtilities.Rendering.PostProcessing.Sharpen
active: 1
active: 0
sharpness:
m_OverrideState: 1
m_Value: 2

View File

@@ -60,7 +60,10 @@ namespace Echovoid.Runtime.Behavior.Rendering
public static readonly int _BloomParams = Shader.PropertyToID("_BloomParams");
public static readonly int _BloomTint = Shader.PropertyToID("_BloomTint");
public static readonly int _AnimeBloom_BlurRadius = Shader.PropertyToID("_BlurRadius");
public static readonly int _AnimeBloom_KernelScale = Shader.PropertyToID("_KernelScale");
public static readonly int _BloomTex = Shader.PropertyToID("_BloomTex");
public static readonly int _SourceTexLowMip = Shader.PropertyToID("_SourceTexLowMip");
public static readonly int _BloomScatterParams = Shader.PropertyToID("_BloomScatterParams");
// --- Anime ACES ---
public static readonly int _TonemapParams = Shader.PropertyToID("_TonemapParams");

View File

@@ -9,106 +9,142 @@ Shader "SLS/Postprocessing/AnimeBloom"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
// --- 参数定义 ---
float4 _BloomParams; // x: Intensity, y: Threshold, z: SoftKnee, w: Clamp
float4 _BloomTint; // 泛光染色
float _BlurRadius; // 模糊扩散半径 (控制光晕大小的关键)
// =====================================================
// 参数定义(与 Unity 原生 Bloom.shader 对齐)
// =====================================================
// _BloomScatterParams:
// x: scatter (已经过 C# 侧 Lerp(0.05, 0.95, userValue) 映射)
// y: clamp (最大亮度限制,防萤火虫)
// z: threshold (线性空间C# 侧已做 GammaToLinear)
// w: thresholdKnee (= threshold * 0.5f,硬编码 soft knee)
float4 _BloomScatterParams;
#define Scatter _BloomScatterParams.x
#define ClampMax _BloomScatterParams.y
#define Threshold _BloomScatterParams.z
#define ThresholdKnee _BloomScatterParams.w
// 纹理
// Composite 阶段参数x=intensity, y/z/w=tint.rgb (已归一化亮度)
float4 _BloomParams;
float4 _BloomTint; // 保留兼容,不再使用
float _KernelScale; // 采样跨度放大乘数,默认 1.0
// SourceTexLowMip: upsample 时的"低频大光晕"纹理 (lowMip)
TEXTURE2D(_SourceTexLowMip);
SAMPLER(sampler_SourceTexLowMip);
// 最终 bloom 结果纹理(传入 Composite Pass
TEXTURE2D(_BloomTex);
SAMPLER(sampler_BloomTex);
// --- 辅助函数Prefilter (提取高亮) ---
half3 Prefilter(half3 color)
{
float threshold = _BloomParams.y;
float softKnee = _BloomParams.z;
float clampVal = _BloomParams.w;
// =====================================================
// 我们去除了 EncodeHDR / DecodeHDR因为我们在 BeforePostProcess 运行
// 且面向移动端,节省 ALU 开销,直接进行线性空间计算。
// =====================================================
// 1. 限制最大亮度 (防闪烁/萤火虫噪点)
color = min(color, clampVal);
// 2. 阈值计算 (使用 Soft Knee 曲线让过渡更自然)
// 标准公式:(Brightness - Threshold) / max(Brightness, 0.0001)
// 这里使用一个更平滑的曲线版本,防止高光边缘切变太硬
float brightness = Max3(color.r, color.g, color.b);
float soft = brightness - threshold + softKnee;
soft = clamp(soft, 0, 2 * softKnee);
soft = soft * soft / (4 * softKnee + 1e-4);
float contribution = max(soft, brightness - threshold);
contribution /= max(brightness, 1e-4);
return color * contribution;
}
// --- Pass 0: Prefilter ---
// =====================================================
// Pass 0: Prefilter — 提取超过阈值的高亮像素
// 与原生完全一致的 soft knee 公式
// =====================================================
half4 FragPrefilter(Varyings input) : SV_Target
{
// 采样原图
half4 color = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, input.texcoord);
// 提取高亮
half3 bloom = Prefilter(color.rgb);
return half4(bloom, 1.0);
}
// --- Pass 1: Downsample (Kawase 4-Tap) ---
// 降采样:取 4 个对角像素的平均值,范围随分辨率降低而扩大
half4 FragDownsample(Varyings input) : SV_Target
{
float2 uv = input.texcoord;
float4 texelSize = _BlitTexture_TexelSize;
// 扩散偏移量,随 BlurRadius 调整
float2 offset = texelSize.xy * _BlurRadius;
half3 color = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv).rgb;
half3 c0 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv - offset).rgb;
half3 c1 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv + float2(offset.x, -offset.y)).rgb;
half3 c2 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv - float2(offset.x, -offset.y)).rgb;
half3 c3 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv + offset).rgb;
// 1. 亮度钳制(防止极亮萤火虫像素跳变)
color = min(color, ClampMax);
// 2. Soft Knee 阈值(与 Unity 原生公式完全一致)
half brightness = Max3(color.r, color.g, color.b);
half softness = clamp(brightness - Threshold + ThresholdKnee, 0.0, 2.0 * ThresholdKnee);
softness = (softness * softness) / (4.0 * ThresholdKnee + 1e-4);
half multiplier = max(brightness - Threshold, softness) / max(brightness, 1e-4);
color *= multiplier;
// 3. 防止 NaN 传播
color = max(color, 0);
half3 color = (c0 + c1 + c2 + c3) * 0.25;
return half4(color, 1.0);
}
// --- Pass 2: Upsample (Kawase 4-Tap + Blend) ---
// 升采样:高质量混合。
// 这里采用 Dual Kawase 的升采样逻辑,混合上一级纹理
half4 FragUpsample(Varyings input) : SV_Target
// =====================================================
// Pass 1: Dual Kawase Downsample
// 公式1/8 * (center*4 + 4corners)
// 采样次数5次相当于 3×3 box + 双线性权重,效果非常柔和)
// 与 Unity 原生 Bloom.shader FragDualDownsample 完全一致
// =====================================================
half4 FragDualDownsample(Varyings input) : SV_Target
{
float2 uv = input.texcoord;
float4 texelSize = _BlitTexture_TexelSize;
float2 offset = texelSize.xy * _BlurRadius * 0.5; // 升采样时半径减半,为了更平滑
// 乘以 _KernelScale在极低迭代次数下强制向外大跨步拉扯光晕
float2 ts = _BlitTexture_TexelSize.xy * _KernelScale;
// 4-Tap 采样高一级的纹理
half3 c0 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv - offset * float2(1, 1)).rgb;
half3 c1 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv + offset * float2(1, -1)).rgb;
half3 c2 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv - offset * float2(1, -1)).rgb;
half3 c3 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv + offset * float2(1, 1)).rgb;
half3 blur = (c0 + c1 + c2 + c3) * 0.25;
// 中心点(权重 4
half3 c0 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv).rgb;
// 这一步在 C# 中是通过 Blit 叠加到上一级 RT 上的
// 所以这里直接输出 blur 结果,混合模式设为 Add 即可
return half4(blur, 1.0);
// 4 个对角偏移
half3 c1 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv + float2( 0.5, 0.5) * ts).rgb;
half3 c2 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv + float2(-0.5, 0.5) * ts).rgb;
half3 c3 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv + float2(-0.5, -0.5) * ts).rgb;
half3 c4 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv + float2( 0.5, -0.5) * ts).rgb;
// 加权平均
half3 color = (1.0 / 8.0) * (c0 * 4.0 + c1 + c2 + c3 + c4);
return half4(color, 1.0);
}
// --- Pass 3: Composite (最终合成) ---
// =====================================================
// Pass 2: Dual Kawase Upsample + Energy-Conserving Lerp
//
// 关键核心:与 Unity 原生 FragUpsample 一致的混合公式
// result = lerp(highMip, lowMip, Scatter)
//
// highMip (_BlitTexture) = 当前层的降采样纹理 Down[i](高分辨率,细节)
// lowMip (_SourceTexLowMip) = 上一层的升采样结果 Up[i+1](低分辨率,扩散光晕)
//
// lerp 是能量守恒的:总亮度 = (1-s)*high + s*low永远 ≤ max(high,low)
// 这是防止"死白"的数学保证。
// =====================================================
half4 FragDualUpsample(Varyings input) : SV_Target
{
float2 uv = input.texcoord;
// 【移动端终极杀器】:剥离所有冗余采样!
// 从 9 采样(原生高端/老版)降低为 2 采样(原生移动端级别)
// 凭借前面巨大的 Spread 范围,仅使用最基础的双线性过滤合并即可。
// 1. highMip = 当前层级的高清纹理
half3 highMip = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv).rgb;
// 2. lowMip = 上一级的极致模糊光晕
half3 lowMip = SAMPLE_TEXTURE2D(_SourceTexLowMip, sampler_LinearClamp, uv).rgb;
// 物理守恒 Lerp 合并
half3 result = lerp(highMip, lowMip, Scatter);
return half4(result, 1.0);
}
// =====================================================
// Pass 3: Composite — 将最终 bloom 叠加回原始画面
// _BloomParams.x = intensity
// _BloomParams.yzw = tint.rgb (亮度已归一化,仅携带色相/饱和度)
// =====================================================
half4 FragComposite(Varyings input) : SV_Target
{
float2 uv = input.texcoord;
// 原始画面
// 原始 HDR 画面
half4 baseColor = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv);
// 泛光结果 (经过多次升采样后的最终纹理)
// Bloom 纹理
half3 bloom = SAMPLE_TEXTURE2D(_BloomTex, sampler_BloomTex, uv).rgb;
// 应用强度和染色
bloom *= _BloomParams.x * _BloomTint.rgb;
// 应用强度和染色_BloomParams.yzw 是亮度归一化的 tint
float intensity = _BloomParams.x;
half3 tint = _BloomParams.yzw;
bloom *= intensity * tint;
// 叠加 (Additive)
// 也可以尝试 Screen 混合模式让光变得更柔和,但 Additive 最符合物理发光
// Additive 合并(物理正确的发光叠加)
return half4(baseColor.rgb + bloom, baseColor.a);
}
@@ -117,9 +153,9 @@ Shader "SLS/Postprocessing/AnimeBloom"
SubShader
{
Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" }
ZWrite Off Cull Off
ZWrite Off Cull Off ZTest Always
// 0: Prefilter
// Pass 0: Prefilter
Pass
{
Name "Bloom Prefilter"
@@ -129,28 +165,27 @@ Shader "SLS/Postprocessing/AnimeBloom"
ENDHLSL
}
// 1: Downsample
// Pass 1: Dual Kawase Downsample
Pass
{
Name "Bloom Downsample"
Name "Bloom Dual Downsample"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment FragDownsample
#pragma fragment FragDualDownsample
ENDHLSL
}
// 2: Upsample
// Pass 2: Dual Kawase Upsample + lerp(high, low, scatter)
Pass
{
Name "Bloom Upsample"
Blend One One // Additive Blend for upsampling accumulation
Name "Bloom Dual Upsample"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment FragUpsample
#pragma fragment FragDualUpsample
ENDHLSL
}
// 3: Composite
// Pass 3: Composite
Pass
{
Name "Bloom Composite"

View File

@@ -2,48 +2,58 @@ using Echovoid.Runtime.Behavior.Rendering;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using UnityEngine.Experimental.Rendering;
namespace SLSUtilities.Rendering.PostProcessing
{
[System.Serializable, VolumeComponentMenu("SLS/Postprocessing/Anime Bloom")]
public class AnimeBloom : ScriptablePostProcessorVolume
{
// 放在 ToneMapping 之前效果最强,但放在 AfterPostProcess 最安全(不易过曝)
// 这里建议 AfterPostProcess配合 HDR 使用
public override CustomPostProcessInjectionPoint InjectionPoint => CustomPostProcessInjectionPoint.AfterPostProcess;
public override int OrderInInjectionPoint => 5; // 放在 Vignette 之前
// BeforePostProcess: 在 ToneMapping 之前运行,确保 HDR bloom 颜色不被截断
// 这与 Unity 原生 Bloom 的执行阶段完全一致
public override CustomPostProcessInjectionPoint InjectionPoint => CustomPostProcessInjectionPoint.BeforePostProcess;
public override int OrderInInjectionPoint => 5;
[Header("Glow Settings")]
[Tooltip("泛光强度。值越大越亮。")]
public ClampedFloatParameter intensity = new(0f, 0f, 10f);
public ClampedFloatParameter intensity = new(1f, 0f, 10f);
[Tooltip("阈值。亮度超过此值的像素才会发光。\n关键设为 1.1 可以过滤掉白墙(1.0),只让灯光发光。")]
public MinFloatParameter threshold = new(1.1f, 0f); // 默认设为 1.1
// 注意threshold 在 Gamma 空间中设置C# 侧会转为 Linear。
// 0.9 在 gamma 空间 ≈ 0.79 在 linear 空间,这与 Unity 原生默认行为完全一致。
public MinFloatParameter threshold = new(0.9f, 0f);
[Tooltip("柔膝 (Soft Knee)。让阈值过渡更平滑,避免高光边缘有硬切痕迹。")]
public ClampedFloatParameter softKnee = new(0.5f, 0f, 1f);
[Header("Scatter")]
// scatter 在 [0,1] 范围内由用户设置。
// C# 侧映射Mathf.Lerp(0.05f, 0.95f, scatter.value),与 Unity 原生完全一致。
// 低值 = 光晕聚拢,高值 = 光晕向外大范围扩散。
public ClampedFloatParameter scatter = new(0.7f, 0f, 1f);
[Tooltip("最大亮度钳制。防止极亮像素(如太阳)产生乱跳的噪点。")]
public MinFloatParameter clamp = new(65472f, 1f); // 默认很大,基本不限制
public MinFloatParameter clamp = new(65472f, 1f);
[Header("Anime Style")]
[Tooltip("扩散半径。值越大,光晕越松散、范围越大(二次元感核心)。")]
public ClampedFloatParameter scatter = new(0.7f, 0f, 5f); // 推荐 0.5 - 1.0
[Header("Iterations")]
// 迭代次数Dual Kawase 每层只需 1 Pass性能远低于原生双趟高斯。
// 4 次迭代 Dual Kawase ≈ 原生 6 次双趟高斯的扩散范围,但 Pass 数只有其 1/3。
public ClampedIntParameter diffusion = new(4, 1, 8);
[Tooltip("迭代次数。次数越多,光晕越平滑、范围越大,但性能开销越高。")]
public ClampedIntParameter diffusion = new(6, 1, 8); // 6次通常足够高品质
[Header("Optimization (Mobile)")]
[Tooltip("初始降采样倍率(首趟大幅压缩分辨率)。\n1=原生半分辨率(1/2)2=1/4分辨率3=1/8分辨率。\n调大此值可用极低的迭代次数跑出巨大且柔和的光晕大幅节省 GPU 带宽。")]
public ClampedIntParameter initialDownscaleShift = new(1, 1, 3);
[Tooltip("采样偏移跨度放大Kernel Scale。\n1.0=原生标准跨度。适度放大(如1.2-1.5)可拉扯光晕扩散范围,但过大会产生轻微十字星/方格马赛克。")]
public ClampedFloatParameter kernelScale = new(1.0f, 0.5f, 3.0f);
[Tooltip("泛光染色。可以做粉色霓虹、蓝色科技光等效果。")]
[Header("Tint")]
// tint 染色C# 侧会归一化亮度(只保留色相/饱和度),与原生行为一致。
// 这样调整 tint 颜色不会意外改变 bloom 总亮度。
public ColorParameter tint = new(Color.white, true, true, true);
// 内部使用的 RT 数组
private RTHandle[] _bloomPyramidUp;
private RTHandle[] _bloomPyramidDown;
private const int k_MaxPyramidSize = 16;
// RT 数组(仅 Down 金字塔 + Up 金字塔,数量与 diffusion 对齐)
private RTHandle[] _bloomMipDown;
private RTHandle[] _bloomMipUp;
private const int k_MaxMips = 8;
public override string GetShaderName() => "SLS/Postprocessing/AnimeBloom";
public override bool IsActive() => intensity.value > 0f;
[System.Obsolete]
public override void Render(CommandBuffer cmd, ref RenderingData renderingData, RTHandle source, RTHandle destination)
{
if (material == null) return;
@@ -51,91 +61,131 @@ namespace SLSUtilities.Rendering.PostProcessing
var desc = renderingData.cameraData.cameraTargetDescriptor;
desc.msaaSamples = 1;
desc.depthBufferBits = 0;
// 1. 设置参数
Vector4 bloomParams = new Vector4(intensity.value, threshold.value, softKnee.value, clamp.value);
material.SetVector(InternalShaderHelpers.ID._BloomParams, bloomParams);
material.SetVector(InternalShaderHelpers.ID._BloomTint, tint.value);
material.SetFloat(InternalShaderHelpers.ID._BlurRadius, scatter.value);
// 2. 初始化金字塔数组
int iterations = Mathf.Clamp(diffusion.value, 1, k_MaxPyramidSize);
// 确保 RT 数组大小足够
if (_bloomPyramidUp == null || _bloomPyramidUp.Length != k_MaxPyramidSize)
// 【移动端极限优化】:强制降级到 32位 HDR 格式 (B10G11R11)
// 相比主相机默认的 64位 R16G16B16A16带宽消耗直接砍半且肉眼几乎无损
if (SystemInfo.IsFormatSupported(GraphicsFormat.B10G11R11_UFloatPack32, FormatUsage.Linear | FormatUsage.Render))
{
_bloomPyramidUp = new RTHandle[k_MaxPyramidSize];
_bloomPyramidDown = new RTHandle[k_MaxPyramidSize];
desc.graphicsFormat = GraphicsFormat.B10G11R11_UFloatPack32;
}
// 3. Prefilter Pass (提取高亮)
// 先降一半分辨率,节省性能且增加模糊感
desc.width = Mathf.Max(1, desc.width >> 1);
desc.height = Mathf.Max(1, desc.height >> 1);
// ─────────────────────────────────────────────────────────────
// 1. 参数打包(完全对齐 Unity SetupBloom 的计算逻辑)
// ─────────────────────────────────────────────────────────────
RenderingUtils.ReAllocateIfNeeded(ref _bloomPyramidDown[0], desc, FilterMode.Bilinear, TextureWrapMode.Clamp, name: "_BloomMipDown0");
RenderingUtils.ReAllocateIfNeeded(ref _bloomPyramidUp[0], desc, FilterMode.Bilinear, TextureWrapMode.Clamp, name: "_BloomMipUp0");
// scatter: 用户 [0,1] → shader [0.05, 0.95](与原生 Lerp 映射一致)
float scatterMapped = Mathf.Lerp(0.05f, 0.95f, scatter.value);
// Source -> Down[0] (Prefilter)
Blitter.BlitCameraTexture(cmd, source, _bloomPyramidDown[0], material, 0);
// threshold: Gamma → Linear原生使用 GammaToLinearSpace 转换)
float thresholdLinear = Mathf.GammaToLinearSpace(threshold.value);
float thresholdKnee = thresholdLinear * 0.5f; // 硬编码 soft knee与原生一致
// 4. Downsample Loop (降采样金字塔)
int lastDown = 0;
for (int i = 1; i < iterations; i++)
material.SetVector(InternalShaderHelpers.ID._BloomScatterParams,
new Vector4(scatterMapped, clamp.value, thresholdLinear, thresholdKnee));
material.SetFloat(InternalShaderHelpers.ID._AnimeBloom_KernelScale, kernelScale.value);
// ─────────────────────────────────────────────────────────────
// 2. Tint 归一化(原生做法:亮度归一为 1只携带色相/饱和度)
// 这样 tint 调整颜色时不会改变 bloom 总亮度。
// ─────────────────────────────────────────────────────────────
Color tintLinear = tint.value.linear;
float luma = 0.2126f * tintLinear.r + 0.7152f * tintLinear.g + 0.0722f * tintLinear.b;
Color tintNormalized = luma > 0f ? tintLinear * (1f / luma) : Color.white;
// 将 intensity 和归一化 tint 一并打包进 _BloomParams原生 uber 方式)
material.SetVector(InternalShaderHelpers.ID._BloomParams,
new Vector4(intensity.value, tintNormalized.r, tintNormalized.g, tintNormalized.b));
// ─────────────────────────────────────────────────────────────
// 3. RT 数组初始化
// ─────────────────────────────────────────────────────────────
int mipCount = Mathf.Clamp(diffusion.value, 1, k_MaxMips);
if (_bloomMipDown == null || _bloomMipDown.Length != k_MaxMips)
{
// 每次分辨率减半
desc.width = Mathf.Max(1, desc.width >> 1);
_bloomMipDown = new RTHandle[k_MaxMips];
_bloomMipUp = new RTHandle[k_MaxMips];
}
// ─────────────────────────────────────────────────────────────
// 4. Prefilter提取高亮像素 + 初始激进降采样)
// 根据用户选择,起始分辨率可能是 1/2, 1/4 或 1/8。
// ─────────────────────────────────────────────────────────────
int shift = initialDownscaleShift.value;
desc.width = Mathf.Max(1, desc.width >> shift);
desc.height = Mathf.Max(1, desc.height >> shift);
RenderingUtils.ReAllocateIfNeeded(ref _bloomMipDown[0], desc, FilterMode.Bilinear,
TextureWrapMode.Clamp, name: "_BloomDown0");
// Source → Down[0] via Pass 0 (Prefilter)
Blitter.BlitCameraTexture(cmd, source, _bloomMipDown[0], material, 0);
// ─────────────────────────────────────────────────────────────
// 5. Downsample LoopDual Kawase 降采样金字塔Pass 1
// 每次分辨率减半,产生多层不同尺度的模糊纹理
// ─────────────────────────────────────────────────────────────
for (int i = 1; i < mipCount; i++)
{
desc.width = Mathf.Max(1, desc.width >> 1);
desc.height = Mathf.Max(1, desc.height >> 1);
RenderingUtils.ReAllocateIfNeeded(ref _bloomPyramidDown[i], desc, FilterMode.Bilinear, TextureWrapMode.Clamp, name: "_BloomMipDown" + i);
RenderingUtils.ReAllocateIfNeeded(ref _bloomPyramidUp[i], desc, FilterMode.Bilinear, TextureWrapMode.Clamp, name: "_BloomMipUp" + i);
RenderingUtils.ReAllocateIfNeeded(ref _bloomMipDown[i], desc, FilterMode.Bilinear,
TextureWrapMode.Clamp, name: "_BloomDown" + i);
// Down[i-1] -> Down[i]
Blitter.BlitCameraTexture(cmd, _bloomPyramidDown[i - 1], _bloomPyramidDown[i], material, 1);
lastDown = i;
// Down[i-1] Down[i] via Pass 1 (Dual Kawase Downsample)
Blitter.BlitCameraTexture(cmd, _bloomMipDown[i - 1], _bloomMipDown[i], material, 1);
}
// 5. Upsample Loop (升采样并混合)
// 从最小的一张开始,往上叠加
// 先把最小的 Down 直接拷给 Up
Blitter.BlitCameraTexture(cmd, _bloomPyramidDown[lastDown], _bloomPyramidUp[lastDown]);
// ─────────────────────────────────────────────────────────────
// 6. Upsample LoopDual Kawase 升采样 + lerp(high, low, scatter)
//
// 与 Unity 原生完全一致的数据流向:
// _BlitTexture = highMip = Down[i] (当前层高分辨率细节)
// _SourceTexLowMip = lowMip = Up[i+1] 或 Down[last](低分辨率扩散光晕)
// output = Up[i]
//
// 从最底层开始,逐层往上合并,最终 Up[0] 就是完整的 bloom 纹理
// ─────────────────────────────────────────────────────────────
for (int i = lastDown - 1; i >= 0; i--)
// 分配所有 Up RT从最大 mip 往上,分辨率逐步翻倍)
// 由于 desc 已经在 downsample 中不断减半,我们要重新从 Down[i] 读尺寸
for (int i = mipCount - 1; i >= 0; i--)
{
// 设置上一级 Up 为输入
// Upsample Pass 会混合Up[i+1] (Blur) + Down[i] (High Res Detail)
// 这里我们稍微简化逻辑:直接把 Up[i+1] 升采样并叠加到 Up[i] 上
// 为了保留细节Dual Kawase 通常是将 Up[i+1] 叠加回 Down[i] 存入 Up[i]
// 第一步:先把 Down[i] 拷进 Up[i] 作为底图
Blitter.BlitCameraTexture(cmd, _bloomPyramidDown[i], _bloomPyramidUp[i]);
// 第二步:把 Up[i+1] 升采样并 Additive 混合进 Up[i]
// Shader Pass 2 开启了 Blend One One
Blitter.BlitCameraTexture(cmd, _bloomPyramidUp[i + 1], _bloomPyramidUp[i], material, 2);
RenderingUtils.ReAllocateIfNeeded(ref _bloomMipUp[i],
_bloomMipDown[i].rt.descriptor, FilterMode.Bilinear,
TextureWrapMode.Clamp, name: "_BloomUp" + i);
}
// 6. Composite (合成)
// 此时 _bloomPyramidUp[0] 包含了最终的泛光纹理
material.SetTexture(InternalShaderHelpers.ID._BloomTex, _bloomPyramidUp[0]);
// 最底层lowMip = Down[last]highMip 也是 Down[last](无 low 可用,直接 lerp 自身,结果仍 = Down[last]
// 简化做法:直接将 Down[last] 拷到 Up[last] 作为起点
Blitter.BlitCameraTexture(cmd, _bloomMipDown[mipCount - 1], _bloomMipUp[mipCount - 1]);
// Source + BloomTex -> Destination
// 从第二底层开始向上 upsample
for (int i = mipCount - 2; i >= 0; i--)
{
// highMip当前层降采样纹理 Down[i],作为 Blit 的 source_BlitTexture
// lowMip 上一级升采样结果 Up[i+1],通过 SetTexture 传入
cmd.SetGlobalTexture(InternalShaderHelpers.ID._SourceTexLowMip, _bloomMipUp[i + 1]);
Blitter.BlitCameraTexture(cmd, _bloomMipDown[i], _bloomMipUp[i], material, 2);
}
// ─────────────────────────────────────────────────────────────
// 7. Composite将 bloom 叠加回原始画面Pass 3
// ─────────────────────────────────────────────────────────────
material.SetTexture(InternalShaderHelpers.ID._BloomTex, _bloomMipUp[0]);
Blitter.BlitCameraTexture(cmd, source, destination, material, 3);
}
// 清理 RT
public void Dispose()
{
if (_bloomPyramidDown != null)
if (_bloomMipDown == null) return;
for (int i = 0; i < _bloomMipDown.Length; i++)
{
for (int i = 0; i < _bloomPyramidDown.Length; i++)
{
if (_bloomPyramidDown[i] != null) _bloomPyramidDown[i].Release();
if (_bloomPyramidUp[i] != null) _bloomPyramidUp[i].Release();
}
_bloomMipDown[i]?.Release();
_bloomMipUp[i]?.Release();
}
}
public override bool IsActive() => intensity.value > 0f;
}
}