Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. Shader "Vertex_Sine"
  2. {
  3. Properties
  4. {
  5. _MainTex ("Base (RGB)", 2D) = "" {}
  6. _Factor ("Factor", Range(-10, 10)) = 0
  7. }
  8.  
  9. SubShader
  10. {
  11. Pass {
  12. CGPROGRAM
  13. #pragma vertex vert
  14. #pragma fragment frag
  15. #include "UnityCG.cginc"
  16.  
  17. struct appdata {
  18. float4 vertex : POSITION;
  19. float2 uv : TEXCOORD0;
  20. };
  21.  
  22. struct v2f {
  23. float4 vertex : SV_POSITION;
  24. float2 uv : TEXCOORD0;
  25. };
  26.  
  27. sampler2D _MainTex;
  28. float4 _MainTex_ST;
  29. half _Factor;
  30.  
  31. v2f vert(appdata v)
  32. {
  33. v2f o;
  34. o.vertex = UnityObjectToClipPos(fixed4(v.vertex.xyz * abs(sin(v.vertex.y * _Factor + _Time.y)), 1));
  35. o.uv = TRANSFORM_TEX(v.uv, _MainTex);
  36. return o;
  37. }
  38.  
  39. fixed4 frag(v2f i) : SV_TARGET
  40. {
  41. fixed4 col = tex2D(_MainTex, i.uv);
  42. col.rgb *= col.a;
  43. return col;
  44. }
  45. ENDCG
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement