Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/liquid warp" {
- Properties {
- _MainTex ("Albedo (RGB)", 2D) = "white" {}
- }
- SubShader {
- Tags { "RenderType"="Opaque" }
- LOD 200
- CGPROGRAM
- // Physically based Standard lighting model, and enable shadows on all light types
- #pragma surface surf Standard fullforwardshadows
- // Use shader model 3.0 target, to get nicer looking lighting
- #pragma target 3.0
- sampler2D _MainTex;
- struct Input {
- float2 uv_MainTex;
- float4 _Time;
- };
- fixed4 _Color;
- float warp( float a, float time )
- {
- float violence = 0.04;
- float levelOfExtreme = 6.0;
- float timeMod = time + a;
- return a + sin( timeMod * levelOfExtreme ) * violence;
- //return a + sin(time + a) * violence;
- }
- void surf (Input IN, inout SurfaceOutputStandard o) {
- float2 wuv = IN.uv_MainTex;
- wuv.x = warp(wuv.x, _Time.y);
- wuv.y = warp(wuv.y, _Time.y);
- // Albedo comes from a texture tinted by color
- fixed4 c = tex2D (_MainTex, wuv);
- o.Albedo = c.rgb;
- o.Alpha = c.a;
- }
- ENDCG
- }
- FallBack "Diffuse"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement