Advertisement
tonynogo

Demo 17 - Jelly effect

Jul 6th, 2017
8,896
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "Custom/Jelly" {
  2.     Properties {
  3.         _MainTex ("Base (RGB)", 2D) = "white" {}
  4.     }
  5.     SubShader {
  6.         Pass {
  7.             Tags { "RenderType"="Opaque" }
  8.        
  9.             CGPROGRAM
  10.             #pragma vertex vert
  11.             #pragma fragment frag
  12.             #include "UnityCG.cginc"
  13.  
  14.             sampler2D _MainTex;
  15.             struct v2f {
  16.                 float4 pos : SV_POSITION;
  17.                 half2 uv : TEXCOORD0;
  18.             };
  19.  
  20.             v2f vert(appdata_base v) {
  21.                 v2f o;
  22.                 v.vertex.x += sign(v.vertex.x) * sin(_Time.w)/50;
  23.                 v.vertex.y += sign(v.vertex.y) * cos(_Time.w)/50;
  24.                 o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
  25.                 o.uv = v.texcoord;
  26.                 return o;
  27.             }
  28.  
  29.  
  30.             half4 frag(v2f i) : COLOR {
  31.                 half4 c = tex2D(_MainTex, i.uv);
  32.                 return c;
  33.             }
  34.  
  35.             ENDCG
  36.         }
  37.     }
  38.     FallBack "Diffuse"
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement