Skip to content

Instantly share code, notes, and snippets.

@ikoan310
Created September 20, 2018 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikoan310/16c6b9f03c6969e4a432dcc473edb58b to your computer and use it in GitHub Desktop.
Save ikoan310/16c6b9f03c6969e4a432dcc473edb58b to your computer and use it in GitHub Desktop.
単純なブラー処理を行うピクセルシェーダー
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
col += tex2D(_MainTex, i.uv + _MainTex_TexelSize.xy * fixed2( _Param, 0 ));
col += tex2D(_MainTex, i.uv + _MainTex_TexelSize.xy * fixed2( -_Param, 0 ));
col += tex2D(_MainTex, i.uv + _MainTex_TexelSize.xy * fixed2( 0, _Param ));
col += tex2D(_MainTex, i.uv + _MainTex_TexelSize.xy * fixed2( 0, -_Param ));
return col / 26;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment