You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
7.1 KiB

  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "Animmal/Ice"
  4. {
  5. Properties
  6. {
  7. _Specularity("Specularity", Range( 0 , 5)) = 0.2041201
  8. _Color0("Color 0", Color) = (0,0.6275863,1,0)
  9. [Header(Translucency)]
  10. _Translucency("Strength", Range( 0 , 50)) = 1
  11. _TransNormalDistortion("Normal Distortion", Range( 0 , 1)) = 0.1
  12. _TransScattering("Scaterring Falloff", Range( 1 , 50)) = 2
  13. _TransDirect("Direct", Range( 0 , 1)) = 1
  14. _TransAmbient("Ambient", Range( 0 , 1)) = 0.2
  15. _TransShadow("Shadow", Range( 0 , 1)) = 0.9
  16. _Tint("Tint", Color) = (0.2867647,0.704868,1,0)
  17. _TextureSample0("Texture Sample 0", 2D) = "white" {}
  18. _TextureSample1("Texture Sample 1", 2D) = "bump" {}
  19. _TextureSample2("Texture Sample 2", 2D) = "white" {}
  20. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  21. [HideInInspector] __dirty( "", Int ) = 1
  22. }
  23. SubShader
  24. {
  25. Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" }
  26. Cull Back
  27. ZTest LEqual
  28. CGPROGRAM
  29. #include "UnityPBSLighting.cginc"
  30. #pragma target 3.0
  31. #pragma surface surf StandardSpecularCustom keepalpha addshadow fullforwardshadows exclude_path:deferred
  32. struct Input
  33. {
  34. fixed2 uv_texcoord;
  35. };
  36. struct SurfaceOutputStandardSpecularCustom
  37. {
  38. fixed3 Albedo;
  39. fixed3 Normal;
  40. half3 Emission;
  41. fixed3 Specular;
  42. half Smoothness;
  43. half Occlusion;
  44. fixed Alpha;
  45. fixed3 Translucency;
  46. };
  47. uniform sampler2D _TextureSample1;
  48. uniform float4 _TextureSample1_ST;
  49. uniform fixed4 _Tint;
  50. uniform sampler2D _TextureSample0;
  51. uniform float4 _TextureSample0_ST;
  52. uniform fixed _Specularity;
  53. uniform half _Translucency;
  54. uniform half _TransNormalDistortion;
  55. uniform half _TransScattering;
  56. uniform half _TransDirect;
  57. uniform half _TransAmbient;
  58. uniform half _TransShadow;
  59. uniform sampler2D _TextureSample2;
  60. uniform float4 _TextureSample2_ST;
  61. uniform fixed4 _Color0;
  62. inline half4 LightingStandardSpecularCustom(SurfaceOutputStandardSpecularCustom s, half3 viewDir, UnityGI gi )
  63. {
  64. #if !DIRECTIONAL
  65. float3 lightAtten = gi.light.color;
  66. #else
  67. float3 lightAtten = lerp( _LightColor0.rgb, gi.light.color, _TransShadow );
  68. #endif
  69. half3 lightDir = gi.light.dir + s.Normal * _TransNormalDistortion;
  70. half transVdotL = pow( saturate( dot( viewDir, -lightDir ) ), _TransScattering );
  71. half3 translucency = lightAtten * (transVdotL * _TransDirect + gi.indirect.diffuse * _TransAmbient) * s.Translucency;
  72. half4 c = half4( s.Albedo * translucency * _Translucency, 0 );
  73. SurfaceOutputStandardSpecular r;
  74. r.Albedo = s.Albedo;
  75. r.Normal = s.Normal;
  76. r.Emission = s.Emission;
  77. r.Specular = s.Specular;
  78. r.Smoothness = s.Smoothness;
  79. r.Occlusion = s.Occlusion;
  80. r.Alpha = s.Alpha;
  81. return LightingStandardSpecular (r, viewDir, gi) + c;
  82. }
  83. inline void LightingStandardSpecularCustom_GI(SurfaceOutputStandardSpecularCustom s, UnityGIInput data, inout UnityGI gi )
  84. {
  85. #if defined(UNITY_PASS_DEFERRED) && UNITY_ENABLE_REFLECTION_BUFFERS
  86. gi = UnityGlobalIllumination(data, s.Occlusion, s.Normal);
  87. #else
  88. UNITY_GLOSSY_ENV_FROM_SURFACE( g, s, data );
  89. gi = UnityGlobalIllumination( data, s.Occlusion, s.Normal, g );
  90. #endif
  91. }
  92. void surf( Input i , inout SurfaceOutputStandardSpecularCustom o )
  93. {
  94. float2 uv_TextureSample1 = i.uv_texcoord * _TextureSample1_ST.xy + _TextureSample1_ST.zw;
  95. o.Normal = UnpackNormal( tex2D( _TextureSample1, uv_TextureSample1 ) );
  96. float2 uv_TextureSample0 = i.uv_texcoord * _TextureSample0_ST.xy + _TextureSample0_ST.zw;
  97. o.Albedo = ( _Tint * tex2D( _TextureSample0, uv_TextureSample0 ) ).rgb;
  98. o.Smoothness = _Specularity;
  99. float2 uv_TextureSample2 = i.uv_texcoord * _TextureSample2_ST.xy + _TextureSample2_ST.zw;
  100. o.Translucency = ( tex2D( _TextureSample2, uv_TextureSample2 ) * _Color0 ).rgb;
  101. o.Alpha = 1;
  102. }
  103. ENDCG
  104. }
  105. Fallback "Diffuse"
  106. CustomEditor "ASEMaterialInspector"
  107. }
  108. /*ASEBEGIN
  109. Version=14501
  110. 293;259;1471;639;1695.362;671.7551;2.537881;True;True
  111. Node;AmplifyShaderEditor.SamplerNode;20;-742.1312,-287.4961;Float;True;Property;_TextureSample0;Texture Sample 0;9;0;Create;True;0;737f131984c164548aee0c624e31aa48;737f131984c164548aee0c624e31aa48;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  112. Node;AmplifyShaderEditor.ColorNode;10;-510.49,-479.5952;Float;False;Property;_Tint;Tint;8;0;Create;True;0;0.2867647,0.704868,1,0;0.4788062,0.495072,0.6029412,0;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  113. Node;AmplifyShaderEditor.ColorNode;6;-590.5064,383.8149;Float;False;Property;_Color0;Color 0;1;0;Create;True;0;0,0.6275863,1,0;0.5578504,0.8084208,0.9852941,0;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  114. Node;AmplifyShaderEditor.SamplerNode;22;-674.3599,195.6492;Float;True;Property;_TextureSample2;Texture Sample 2;11;0;Create;True;0;698873c7db0ff6e4da9444a6b59759dd;698873c7db0ff6e4da9444a6b59759dd;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  115. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;11;-125.2225,-328.4756;Float;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  116. Node;AmplifyShaderEditor.SamplerNode;21;-663.4288,-55.76118;Float;True;Property;_TextureSample1;Texture Sample 1;10;0;Create;True;0;942d2adca1ff4294882d85702de70666;942d2adca1ff4294882d85702de70666;True;0;True;bump;Auto;True;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  117. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;8;-93.79053,185.3298;Float;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  118. Node;AmplifyShaderEditor.RangedFloatNode;16;-169.3906,29.62976;Float;False;Property;_Specularity;Specularity;0;0;Create;True;0;0.2041201;2.5;0;5;0;1;FLOAT;0
  119. Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;186.6,-73.70001;Fixed;False;True;2;Fixed;ASEMaterialInspector;0;0;StandardSpecular;Animmal/Ice;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;Back;0;3;False;0;0;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;ForwardOnly;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;False;0;255;255;0;0;0;0;0;0;0;0;False;0;4;10;25;False;0.5;True;0;Zero;Zero;0;Zero;Zero;Add;Add;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;2;-1;-1;0;0;0;False;0;0;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT3;0,0,0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
  120. WireConnection;11;0;10;0
  121. WireConnection;11;1;20;0
  122. WireConnection;8;0;22;0
  123. WireConnection;8;1;6;0
  124. WireConnection;0;0;11;0
  125. WireConnection;0;1;21;0
  126. WireConnection;0;4;16;0
  127. WireConnection;0;7;8;0
  128. ASEEND*/
  129. //CHKSM=959FAEF07057D532A95CC854AA1E908B81518DF1