Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Vertex_Sine"
- {
- Properties
- {
- _MainTex ("Base (RGB)", 2D) = "" {}
- _Factor ("Factor", Range(-10, 10)) = 0
- }
- SubShader
- {
- Pass {
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #include "UnityCG.cginc"
- struct appdata {
- float4 vertex : POSITION;
- float2 uv : TEXCOORD0;
- };
- struct v2f {
- float4 vertex : SV_POSITION;
- float2 uv : TEXCOORD0;
- };
- sampler2D _MainTex;
- float4 _MainTex_ST;
- half _Factor;
- v2f vert(appdata v)
- {
- v2f o;
- o.vertex = UnityObjectToClipPos(fixed4(v.vertex.xyz * abs(sin(v.vertex.y * _Factor + _Time.y)), 1));
- o.uv = TRANSFORM_TEX(v.uv, _MainTex);
- return o;
- }
- fixed4 frag(v2f i) : SV_TARGET
- {
- fixed4 col = tex2D(_MainTex, i.uv);
- col.rgb *= col.a;
- return col;
- }
- ENDCG
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement