Hang the script on the camera
Using unityengine;using System.Collections; [Requirecomponent (typeof (Camera))]public class Posteffecttwist:monobehaviour {public Material ma;void onrenderimage ( Rendertexture src, rendertexture dest) {graphics.blit (src, dest, MA);}}
Create a material, and then create a shader
Shader "Hidden/newimageeffectshader" {Properties{_maintex ("Texture", 2D) = "White" {}_angle ("Rotation", Float) = 0} subshader{//No culling or depthcull off zwrite off ZTest alwayspass{cgprogram#pragma vertex vert#pragma fragment Frag#inc Lude "Unitycg.cginc" struct appdata{float4 vertex:position;float2 uv:texcoord0;}; struct V2F{FLOAT2 uv:texcoord0;float4 vertex:sv_position;}; v2f Vert (AppData v) {v2f O;o.vertex = Mul (UNITY_MATRIX_MVP, V.vertex); o.uv = V.uv;return o;} Sampler2d _maintex;float _angle;fixed4 Frag (v2f i): sv_target{float2 UV = FLOAT2 (i.uv.x-0.5,i.uv.y-0.5); float f = Distan CE (UV,FLOAT2 (0,0)), float s = sin (lerp (0,_angle,f)), float c = cos (LERP (0,_angle,f)),//-C s//s CUV = FLOAT2 (-uv.x*c+u V.Y*S,UV.X*S+UV.Y*C); UV = FLOAT2 (uv.x+0.5,uv.y+0.5); Fixed4 col = tex2d (_maintex, UV); return col;} ENDCG}}}
Unity3d Shader Image Warp transitions