blob: 1e10746f2f4885b56aa151e6eff3bc0a198c8ad5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
using UnityEngine;
[ExecuteInEditMode]
public class BlurPost : MonoBehaviour
{
[SerializeField]
private Material postprocessMaterial;
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
RenderTexture temporary = RenderTexture.GetTemporary(source.width, source.height);
Graphics.Blit(source, temporary, postprocessMaterial, 0);
Graphics.Blit(temporary, destination, postprocessMaterial, 1);
RenderTexture.ReleaseTemporary(temporary);
}
}
|