Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. Shader "Custom/TestLit"
  2. {
  3. Properties
  4. {
  5. _Color ("Color", Color) = (1,1,1,1)
  6. _MainTex ("Albedo (RGB)", 2D) = "white" {}
  7. _Glossiness ("Smoothness", Range(0,1)) = 0.5
  8. _Metallic ("Metallic", Range(0,1)) = 0.0
  9. _Amplitude ("Amplitude", float) = 1
  10. _Frequency ("Frequency", float) = 1
  11. _Speed ("Speed", float) = 1
  12. }
  13. SubShader
  14. {
  15. Tags { "RenderType"="Transparent" "Queue"="Transparent"}
  16. LOD 200
  17.  
  18. CGPROGRAM
  19. // Physically based Standard lighting model, and enable shadows on all light types
  20. #pragma surface surf Standard fullforwardshadows vertex:vert
  21.  
  22. // Use shader model 3.0 target, to get nicer looking lighting
  23. #pragma target 3.0
  24.  
  25. sampler2D _MainTex;
  26.  
  27. struct Input
  28. {
  29. float2 uv_MainTex;
  30. };
  31.  
  32. half _Glossiness;
  33. half _Metallic;
  34. fixed4 _Color;
  35.  
  36. float _Amplitude;
  37. float _Frequency;
  38. float _Speed;
  39.  
  40. void vert(inout appdata_full v, out Input o)
  41. {
  42. v.vertex.y = sin(_Time.w * _Speed + v.vertex.x * _Frequency) * _Amplitude;
  43. UNITY_INITIALIZE_OUTPUT(Input, o);
  44. }
  45.  
  46. void surf (Input IN, inout SurfaceOutputStandard o)
  47. {
  48. fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
  49. o.Albedo = c.rgb;
  50. o.Metallic = _Metallic;
  51. o.Smoothness = _Glossiness;
  52. o.Alpha = c.a;
  53. }
  54. ENDCG
  55. }
  56. FallBack "Diffuse"
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement