也就是屏幕后期特效。
在场景渲染完以后,添加一些特效
1.引擎 渲染后最后结果,就是一张图片。(1秒60张就是60帧的动画)
2.将图片传递给shader,进行二次计算。形成一些效果。
模糊效果
fixed4 frag (v2f i) : SV_Target
{
float ambient =0.002;
float2 tmpUV =i.uv;
fixed4 col = tex2D(_MainTex, tmpUV);
fixed4 col2 = tex2D(_MainTex,tmpUV+float2(-ambient,0));//左偏
fixed4 col3 = tex2D(_MainTex,tmpUV+float2(ambient,0));//右偏
fixed4 col4 = tex2D(_MainTex,tmpUV+float2(0,ambient));
fixed4 col5 = tex2D(_MainTex,tmpUV+float2(0,-ambient));
// just invert the colors
// col.rgb = 1 - col.rgb;
col=(col+col2+col3+col4+col5)/5;//求平均
return col;
}
ENDCG
一般挂在摄像机上。在原来的图片上加上特殊效果,再进行输出
p