NodeScript+ 导入了个 UI Extend
Signed-off-by: TRADER_FOER <lhf190@outlook.com>
This commit is contained in:
@@ -43,6 +43,7 @@ namespace SLSUtilities.Rendering.PostProcessing
|
||||
|
||||
public override string GetShaderName() => "SLS/Postprocessing/AnimeBloom";
|
||||
|
||||
[System.Obsolete]
|
||||
public override void Render(CommandBuffer cmd, ref RenderingData renderingData, RTHandle source, RTHandle destination)
|
||||
{
|
||||
if (material == null) return;
|
||||
@@ -59,7 +60,7 @@ namespace SLSUtilities.Rendering.PostProcessing
|
||||
|
||||
// 2. 初始化金字塔数组
|
||||
int iterations = Mathf.Clamp(diffusion.value, 1, k_MaxPyramidSize);
|
||||
|
||||
|
||||
// 确保 RT 数组大小足够
|
||||
if (_bloomPyramidUp == null || _bloomPyramidUp.Length != k_MaxPyramidSize)
|
||||
{
|
||||
@@ -71,7 +72,7 @@ namespace SLSUtilities.Rendering.PostProcessing
|
||||
// 先降一半分辨率,节省性能且增加模糊感
|
||||
desc.width = Mathf.Max(1, desc.width >> 1);
|
||||
desc.height = Mathf.Max(1, desc.height >> 1);
|
||||
|
||||
|
||||
RenderingUtils.ReAllocateIfNeeded(ref _bloomPyramidDown[0], desc, FilterMode.Bilinear, TextureWrapMode.Clamp, name: "_BloomMipDown0");
|
||||
RenderingUtils.ReAllocateIfNeeded(ref _bloomPyramidUp[0], desc, FilterMode.Bilinear, TextureWrapMode.Clamp, name: "_BloomMipUp0");
|
||||
|
||||
@@ -105,7 +106,7 @@ namespace SLSUtilities.Rendering.PostProcessing
|
||||
// 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]);
|
||||
|
||||
@@ -117,11 +118,11 @@ namespace SLSUtilities.Rendering.PostProcessing
|
||||
// 6. Composite (合成)
|
||||
// 此时 _bloomPyramidUp[0] 包含了最终的泛光纹理
|
||||
material.SetTexture(InternalShaderHelpers.ID._BloomTex, _bloomPyramidUp[0]);
|
||||
|
||||
|
||||
// Source + BloomTex -> Destination
|
||||
Blitter.BlitCameraTexture(cmd, source, destination, material, 3);
|
||||
}
|
||||
|
||||
|
||||
// 清理 RT
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user