Shader:
Shader "ImageEffect/Unlit/GaussianBlue" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
CGINCLUDE
#include "UnityCG.cginc"
#pragma target 3.0
static const half curve[7] = { 0.0205, 0.0855, 0.232, 0.324, 0.232, 0.0855, 0.0205 };
static const half4 curve4[7] = { half4(0.0205,0.0205,0.0205,0),
half4(0.0855,0.0855,0.0855,0),
half4(0.232,0.232,0.232,0),
half4(0.324,0.324,0.324,1),
half4(0.232,0.232,0.232,0),
half4(0.0855,0.0855,0.0855,0),
half4(0.0205,0.0205,0.0205,0) };
struct v2f_withBlurCoords8
{
float4 pos : SV_POSITION;
half4 uv : TEXCOORD0;
half4 offs : TEXCOORD1;
};
sampler2D _MainTex;
// if it's a 1k x 1k texture, both x and y will be 1.0/1024.0
uniform half4 _MainTex_TexelSize;
uniform float _BlurSize;
v2f_withBlurCoords8 vertBlurHori