I'm pretty new to shaders and want to add a gaussian blur to this shader. So what I'm trying to accomplish is duplicating the screen, gaussian blur it slightly, then apply a screen overlay similar to the photoshop effect. Have the screen overlay part working but not sure how to include a gaussian blur effect before I screen overlay it. This is for a post-processing effect by the way
Shader "Hidden/Custom/BlurAndScreenOverlay"
{
HLSLINCLUDE
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex);
float _Opacity;
float4 Frag(VaryingsDefault i) : SV_Target{
float4 base = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord);
float4 calculateBase = (1 - (1 - base)*(1 - base));
//Gaussian blur effect goes here ?
return lerp(calculateBase, base, 0.75f);
}
ENDHLSL
SubShader {
Cull Off ZWrite Off ZTest Always
Pass
{
HLSLPROGRAM
#pragma vertex VertDefault
#pragma fragment Frag
ENDHLSL
}
}
}
↧