同步-后处理调整

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

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