Shader屏幕扭曲效果
在Unity中实现了一个简单的屏幕扭曲Shader,对材质纹理进行采样后再与原图像进行混合,效果如下:
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。关键代码:
float4 frag(v2f i) : SV_TARGET{
float2 noise = tex2D(_NoiseTex, i.uv).xy;
noise = ((noise * 2) - 1) * _Magnitude;
float4 col = tex2D(_MainTex, i.uv + noise) * _Color;
return col;
}
完整项目放到了github上,地址:https://github.com/gitctrls/ScreenDistortionShader。

更多精彩