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.

393 lines
21 KiB

  1. // Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
  2. // Shader created with Shader Forge v1.30
  3. // Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
  4. // Note: Manually altering this data may prevent you from opening it in Shader Forge
  5. /*SF_DATA;ver:1.30;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,lico:1,lgpr:1,limd:1,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:True,hqlp:False,rprd:False,enco:False,rmgx:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:0,bsrc:3,bdst:7,dpts:2,wrdp:False,dith:0,rfrpo:True,rfrpn:Refraction,coma:15,ufog:True,aust:True,igpj:True,qofs:0,qpre:3,rntp:2,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,stcl:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:False,fnsp:False,fnfb:False;n:type:ShaderForge.SFN_Final,id:1,x:33430,y:32397,varname:node_1,prsc:2|diff-7524-OUT,alpha-677-OUT,voffset-4711-OUT;n:type:ShaderForge.SFN_Distance,id:9544,x:31798,y:32501,varname:node_9544,prsc:2|A-1960-UVOUT,B-7815-OUT;n:type:ShaderForge.SFN_TexCoord,id:1960,x:31563,y:32410,varname:node_1960,prsc:2,uv:0;n:type:ShaderForge.SFN_Vector2,id:7815,x:31563,y:32587,varname:node_7815,prsc:2,v1:0.5,v2:0.5;n:type:ShaderForge.SFN_Add,id:7248,x:32013,y:32501,varname:node_7248,prsc:2|A-9544-OUT,B-8808-OUT;n:type:ShaderForge.SFN_Sin,id:5748,x:32366,y:32520,varname:node_5748,prsc:2|IN-6766-OUT;n:type:ShaderForge.SFN_RemapRange,id:8808,x:31776,y:32721,varname:node_8808,prsc:2,frmn:0,frmx:2,tomn:0,tomx:1|IN-9742-OUT;n:type:ShaderForge.SFN_Multiply,id:6766,x:32198,y:32520,varname:node_6766,prsc:2|A-7248-OUT,B-1783-OUT;n:type:ShaderForge.SFN_Slider,id:1783,x:31895,y:32812,ptovrint:False,ptlb:Ring_Amount,ptin:_Ring_Amount,varname:node_1783,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:1,cur:19.17478,max:200;n:type:ShaderForge.SFN_Time,id:8294,x:31085,y:32629,varname:node_8294,prsc:2;n:type:ShaderForge.SFN_OneMinus,id:6695,x:31563,y:32739,varname:node_6695,prsc:2|IN-5972-OUT;n:type:ShaderForge.SFN_NormalVector,id:5768,x:32771,y:33002,prsc:2,pt:False;n:type:ShaderForge.SFN_Multiply,id:4711,x:33050,y:32857,varname:node_4711,prsc:2|A-118-OUT,B-5768-OUT;n:type:ShaderForge.SFN_Color,id:5556,x:32639,y:32012,ptovrint:False,ptlb:FoamColor,ptin:_FoamColor,varname:node_5556,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:1,c2:1,c3:1,c4:1;n:type:ShaderForge.SFN_Multiply,id:118,x:32652,y:32879,varname:node_118,prsc:2|A-5748-OUT,B-3985-OUT;n:type:ShaderForge.SFN_Slider,id:3985,x:32250,y:33044,ptovrint:False,ptlb:WaveHeight,ptin:_WaveHeight,varname:node_3985,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:1,cur:5.549279,max:10;n:type:ShaderForge.SFN_Slider,id:9742,x:30915,y:32824,ptovrint:False,ptlb:Speed,ptin:_Speed,varname:node_9742,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:-1,cur:-1,max:1.5;n:type:ShaderForge.SFN_Clamp01,id:1198,x:32804,y:32376,varname:node_1198,prsc:2|IN-5748-OUT;n:type:ShaderForge.SFN_Multiply,id:677,x:33117,y:32477,varname:node_677,prsc:2|A-1198-OUT,B-2892-OUT,C-6357-OUT;n:type:ShaderForge.SFN_OneMinus,id:9994,x:32013,y:32251,varname:node_9994,prsc:2|IN-9544-OUT;n:type:ShaderForge.SFN_Round,id:2892,x:32210,y:32251,varname:node_2892,prsc:2|IN-9994-OUT;n:type:ShaderForge.SFN_Multiply,id:7524,x:33117,y:32314,varname:node_7524,prsc:2|A-5556-RGB,B-1198-OUT;n:type:ShaderForge.SFN_Multiply,id:5972,x:31340,y:32739,varname:node_5972,prsc:2|A-8294-T,B-9742-OUT;n:type:ShaderForge.SFN_Slider,id:6357,x:32597,y:32713,ptovrint:False,ptlb:Fade,ptin:_Fade,varname:node_6357,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:0,cur:1,max:1;proporder:1783-5556-3985-9742-6357;pass:END;sub:END;*/
  6. Shader "LightHouse/WaterShader" {
  7. Properties {
  8. _Ring_Amount ("Ring_Amount", Range(1, 200)) = 19.17478
  9. _FoamColor ("FoamColor", Color) = (1,1,1,1)
  10. _WaveHeight ("WaveHeight", Range(1, 10)) = 5.549279
  11. _Speed ("Speed", Range(-1, 1.5)) = -1
  12. _Fade ("Fade", Range(0, 1)) = 1
  13. [HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
  14. }
  15. SubShader {
  16. Tags {
  17. "IgnoreProjector"="True"
  18. "Queue"="Transparent"
  19. "RenderType"="Transparent"
  20. }
  21. Pass {
  22. Name "FORWARD"
  23. Tags {
  24. "LightMode"="ForwardBase"
  25. }
  26. Blend SrcAlpha OneMinusSrcAlpha
  27. ZWrite Off
  28. CGPROGRAM
  29. #pragma vertex vert
  30. #pragma fragment frag
  31. #define UNITY_PASS_FORWARDBASE
  32. #define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
  33. #include "UnityCG.cginc"
  34. #include "Lighting.cginc"
  35. #include "UnityPBSLighting.cginc"
  36. #include "UnityStandardBRDF.cginc"
  37. #pragma multi_compile_fwdbase
  38. #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
  39. #pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
  40. #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
  41. #pragma multi_compile_fog
  42. #pragma exclude_renderers xbox360 ps3
  43. #pragma target 3.0
  44. uniform float _Ring_Amount;
  45. uniform float4 _FoamColor;
  46. uniform float _WaveHeight;
  47. uniform float _Speed;
  48. uniform float _Fade;
  49. struct VertexInput {
  50. float4 vertex : POSITION;
  51. float3 normal : NORMAL;
  52. float4 tangent : TANGENT;
  53. float2 texcoord0 : TEXCOORD0;
  54. float2 texcoord1 : TEXCOORD1;
  55. float2 texcoord2 : TEXCOORD2;
  56. };
  57. struct VertexOutput {
  58. float4 pos : SV_POSITION;
  59. float2 uv0 : TEXCOORD0;
  60. float2 uv1 : TEXCOORD1;
  61. float2 uv2 : TEXCOORD2;
  62. float4 posWorld : TEXCOORD3;
  63. float3 normalDir : TEXCOORD4;
  64. float3 tangentDir : TEXCOORD5;
  65. float3 bitangentDir : TEXCOORD6;
  66. UNITY_FOG_COORDS(7)
  67. #if defined(LIGHTMAP_ON) || defined(UNITY_SHOULD_SAMPLE_SH)
  68. float4 ambientOrLightmapUV : TEXCOORD8;
  69. #endif
  70. };
  71. VertexOutput vert (VertexInput v) {
  72. VertexOutput o = (VertexOutput)0;
  73. o.uv0 = v.texcoord0;
  74. o.uv1 = v.texcoord1;
  75. o.uv2 = v.texcoord2;
  76. #ifdef LIGHTMAP_ON
  77. o.ambientOrLightmapUV.xy = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw;
  78. o.ambientOrLightmapUV.zw = 0;
  79. #elif UNITY_SHOULD_SAMPLE_SH
  80. #endif
  81. #ifdef DYNAMICLIGHTMAP_ON
  82. o.ambientOrLightmapUV.zw = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
  83. #endif
  84. o.normalDir = UnityObjectToWorldNormal(v.normal);
  85. o.tangentDir = normalize( mul( unity_ObjectToWorld, float4( v.tangent.xyz, 0.0 ) ).xyz );
  86. o.bitangentDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
  87. float node_9544 = distance(o.uv0,float2(0.5,0.5));
  88. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  89. v.vertex.xyz += ((node_5748*_WaveHeight)*v.normal);
  90. o.posWorld = mul(unity_ObjectToWorld, v.vertex);
  91. float3 lightColor = _LightColor0.rgb;
  92. o.pos = mul(UNITY_MATRIX_MVP, v.vertex );
  93. UNITY_TRANSFER_FOG(o,o.pos);
  94. return o;
  95. }
  96. float4 frag(VertexOutput i) : COLOR {
  97. i.normalDir = normalize(i.normalDir);
  98. float3x3 tangentTransform = float3x3( i.tangentDir, i.bitangentDir, i.normalDir);
  99. float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
  100. float3 normalDirection = i.normalDir;
  101. float3 viewReflectDirection = reflect( -viewDirection, normalDirection );
  102. float3 lightDirection = normalize(_WorldSpaceLightPos0.xyz);
  103. float3 lightColor = _LightColor0.rgb;
  104. ////// Lighting:
  105. float attenuation = 1;
  106. float3 attenColor = attenuation * _LightColor0.xyz;
  107. /////// GI Data:
  108. UnityLight light;
  109. #ifdef LIGHTMAP_OFF
  110. light.color = lightColor;
  111. light.dir = lightDirection;
  112. light.ndotl = LambertTerm (normalDirection, light.dir);
  113. #else
  114. light.color = half3(0.f, 0.f, 0.f);
  115. light.ndotl = 0.0f;
  116. light.dir = half3(0.f, 0.f, 0.f);
  117. #endif
  118. UnityGIInput d;
  119. d.light = light;
  120. d.worldPos = i.posWorld.xyz;
  121. d.worldViewDir = viewDirection;
  122. d.atten = attenuation;
  123. #if defined(LIGHTMAP_ON) || defined(DYNAMICLIGHTMAP_ON)
  124. d.ambient = 0;
  125. d.lightmapUV = i.ambientOrLightmapUV;
  126. #else
  127. d.ambient = i.ambientOrLightmapUV;
  128. #endif
  129. Unity_GlossyEnvironmentData ugls_en_data;
  130. ugls_en_data.roughness = 1.0 - 0;
  131. ugls_en_data.reflUVW = viewReflectDirection;
  132. UnityGI gi = UnityGlobalIllumination(d, 1, normalDirection, ugls_en_data );
  133. lightDirection = gi.light.dir;
  134. lightColor = gi.light.color;
  135. /////// Diffuse:
  136. float NdotL = max(0.0,dot( normalDirection, lightDirection ));
  137. float3 directDiffuse = max( 0.0, NdotL) * attenColor;
  138. float3 indirectDiffuse = float3(0,0,0);
  139. indirectDiffuse += gi.indirect.diffuse;
  140. float node_9544 = distance(i.uv0,float2(0.5,0.5));
  141. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  142. float node_1198 = saturate(node_5748);
  143. float3 diffuseColor = (_FoamColor.rgb*node_1198);
  144. float3 diffuse = (directDiffuse + indirectDiffuse) * diffuseColor;
  145. /// Final Color:
  146. float3 finalColor = diffuse;
  147. fixed4 finalRGBA = fixed4(finalColor,(node_1198*round((1.0 - node_9544))*_Fade));
  148. UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
  149. return finalRGBA;
  150. }
  151. ENDCG
  152. }
  153. Pass {
  154. Name "FORWARD_DELTA"
  155. Tags {
  156. "LightMode"="ForwardAdd"
  157. }
  158. Blend One One
  159. ZWrite Off
  160. CGPROGRAM
  161. #pragma vertex vert
  162. #pragma fragment frag
  163. #define UNITY_PASS_FORWARDADD
  164. #define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
  165. #include "UnityCG.cginc"
  166. #include "AutoLight.cginc"
  167. #include "Lighting.cginc"
  168. #include "UnityPBSLighting.cginc"
  169. #include "UnityStandardBRDF.cginc"
  170. #pragma multi_compile_fwdadd
  171. #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
  172. #pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
  173. #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
  174. #pragma multi_compile_fog
  175. #pragma exclude_renderers xbox360 ps3
  176. #pragma target 3.0
  177. uniform float _Ring_Amount;
  178. uniform float4 _FoamColor;
  179. uniform float _WaveHeight;
  180. uniform float _Speed;
  181. uniform float _Fade;
  182. struct VertexInput {
  183. float4 vertex : POSITION;
  184. float3 normal : NORMAL;
  185. float4 tangent : TANGENT;
  186. float2 texcoord0 : TEXCOORD0;
  187. float2 texcoord1 : TEXCOORD1;
  188. float2 texcoord2 : TEXCOORD2;
  189. };
  190. struct VertexOutput {
  191. float4 pos : SV_POSITION;
  192. float2 uv0 : TEXCOORD0;
  193. float2 uv1 : TEXCOORD1;
  194. float2 uv2 : TEXCOORD2;
  195. float4 posWorld : TEXCOORD3;
  196. float3 normalDir : TEXCOORD4;
  197. float3 tangentDir : TEXCOORD5;
  198. float3 bitangentDir : TEXCOORD6;
  199. LIGHTING_COORDS(7,8)
  200. UNITY_FOG_COORDS(9)
  201. };
  202. VertexOutput vert (VertexInput v) {
  203. VertexOutput o = (VertexOutput)0;
  204. o.uv0 = v.texcoord0;
  205. o.uv1 = v.texcoord1;
  206. o.uv2 = v.texcoord2;
  207. o.normalDir = UnityObjectToWorldNormal(v.normal);
  208. o.tangentDir = normalize( mul( unity_ObjectToWorld, float4( v.tangent.xyz, 0.0 ) ).xyz );
  209. o.bitangentDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
  210. float node_9544 = distance(o.uv0,float2(0.5,0.5));
  211. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  212. v.vertex.xyz += ((node_5748*_WaveHeight)*v.normal);
  213. o.posWorld = mul(unity_ObjectToWorld, v.vertex);
  214. float3 lightColor = _LightColor0.rgb;
  215. o.pos = mul(UNITY_MATRIX_MVP, v.vertex );
  216. UNITY_TRANSFER_FOG(o,o.pos);
  217. TRANSFER_VERTEX_TO_FRAGMENT(o)
  218. return o;
  219. }
  220. float4 frag(VertexOutput i) : COLOR {
  221. i.normalDir = normalize(i.normalDir);
  222. float3x3 tangentTransform = float3x3( i.tangentDir, i.bitangentDir, i.normalDir);
  223. float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
  224. float3 normalDirection = i.normalDir;
  225. float3 lightDirection = normalize(lerp(_WorldSpaceLightPos0.xyz, _WorldSpaceLightPos0.xyz - i.posWorld.xyz,_WorldSpaceLightPos0.w));
  226. float3 lightColor = _LightColor0.rgb;
  227. ////// Lighting:
  228. float attenuation = LIGHT_ATTENUATION(i);
  229. float3 attenColor = attenuation * _LightColor0.xyz;
  230. /////// Diffuse:
  231. float NdotL = max(0.0,dot( normalDirection, lightDirection ));
  232. float3 directDiffuse = max( 0.0, NdotL) * attenColor;
  233. float node_9544 = distance(i.uv0,float2(0.5,0.5));
  234. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  235. float node_1198 = saturate(node_5748);
  236. float3 diffuseColor = (_FoamColor.rgb*node_1198);
  237. float3 diffuse = directDiffuse * diffuseColor;
  238. /// Final Color:
  239. float3 finalColor = diffuse;
  240. fixed4 finalRGBA = fixed4(finalColor * (node_1198*round((1.0 - node_9544))*_Fade),0);
  241. UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
  242. return finalRGBA;
  243. }
  244. ENDCG
  245. }
  246. Pass {
  247. Name "ShadowCaster"
  248. Tags {
  249. "LightMode"="ShadowCaster"
  250. }
  251. Offset 1, 1
  252. CGPROGRAM
  253. #pragma vertex vert
  254. #pragma fragment frag
  255. #define UNITY_PASS_SHADOWCASTER
  256. #define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
  257. #include "UnityCG.cginc"
  258. #include "Lighting.cginc"
  259. #include "UnityPBSLighting.cginc"
  260. #include "UnityStandardBRDF.cginc"
  261. #pragma fragmentoption ARB_precision_hint_fastest
  262. #pragma multi_compile_shadowcaster
  263. #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
  264. #pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
  265. #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
  266. #pragma multi_compile_fog
  267. #pragma exclude_renderers xbox360 ps3
  268. #pragma target 3.0
  269. uniform float _Ring_Amount;
  270. uniform float _WaveHeight;
  271. uniform float _Speed;
  272. struct VertexInput {
  273. float4 vertex : POSITION;
  274. float3 normal : NORMAL;
  275. float2 texcoord0 : TEXCOORD0;
  276. float2 texcoord1 : TEXCOORD1;
  277. float2 texcoord2 : TEXCOORD2;
  278. };
  279. struct VertexOutput {
  280. V2F_SHADOW_CASTER;
  281. float2 uv0 : TEXCOORD1;
  282. float2 uv1 : TEXCOORD2;
  283. float2 uv2 : TEXCOORD3;
  284. float4 posWorld : TEXCOORD4;
  285. float3 normalDir : TEXCOORD5;
  286. };
  287. VertexOutput vert (VertexInput v) {
  288. VertexOutput o = (VertexOutput)0;
  289. o.uv0 = v.texcoord0;
  290. o.uv1 = v.texcoord1;
  291. o.uv2 = v.texcoord2;
  292. o.normalDir = UnityObjectToWorldNormal(v.normal);
  293. float node_9544 = distance(o.uv0,float2(0.5,0.5));
  294. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  295. v.vertex.xyz += ((node_5748*_WaveHeight)*v.normal);
  296. o.posWorld = mul(unity_ObjectToWorld, v.vertex);
  297. o.pos = mul(UNITY_MATRIX_MVP, v.vertex );
  298. TRANSFER_SHADOW_CASTER(o)
  299. return o;
  300. }
  301. float4 frag(VertexOutput i) : COLOR {
  302. i.normalDir = normalize(i.normalDir);
  303. float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
  304. float3 normalDirection = i.normalDir;
  305. SHADOW_CASTER_FRAGMENT(i)
  306. }
  307. ENDCG
  308. }
  309. Pass {
  310. Name "Meta"
  311. Tags {
  312. "LightMode"="Meta"
  313. }
  314. Cull Off
  315. CGPROGRAM
  316. #pragma vertex vert
  317. #pragma fragment frag
  318. #define UNITY_PASS_META 1
  319. #define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
  320. #include "UnityCG.cginc"
  321. #include "Lighting.cginc"
  322. #include "UnityPBSLighting.cginc"
  323. #include "UnityStandardBRDF.cginc"
  324. #include "UnityMetaPass.cginc"
  325. #pragma fragmentoption ARB_precision_hint_fastest
  326. #pragma multi_compile_shadowcaster
  327. #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
  328. #pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
  329. #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
  330. #pragma multi_compile_fog
  331. #pragma exclude_renderers xbox360 ps3
  332. #pragma target 3.0
  333. uniform float _Ring_Amount;
  334. uniform float4 _FoamColor;
  335. uniform float _WaveHeight;
  336. uniform float _Speed;
  337. struct VertexInput {
  338. float4 vertex : POSITION;
  339. float3 normal : NORMAL;
  340. float2 texcoord0 : TEXCOORD0;
  341. float2 texcoord1 : TEXCOORD1;
  342. float2 texcoord2 : TEXCOORD2;
  343. };
  344. struct VertexOutput {
  345. float4 pos : SV_POSITION;
  346. float2 uv0 : TEXCOORD0;
  347. float2 uv1 : TEXCOORD1;
  348. float2 uv2 : TEXCOORD2;
  349. float4 posWorld : TEXCOORD3;
  350. float3 normalDir : TEXCOORD4;
  351. };
  352. VertexOutput vert (VertexInput v) {
  353. VertexOutput o = (VertexOutput)0;
  354. o.uv0 = v.texcoord0;
  355. o.uv1 = v.texcoord1;
  356. o.uv2 = v.texcoord2;
  357. o.normalDir = UnityObjectToWorldNormal(v.normal);
  358. float node_9544 = distance(o.uv0,float2(0.5,0.5));
  359. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  360. v.vertex.xyz += ((node_5748*_WaveHeight)*v.normal);
  361. o.posWorld = mul(unity_ObjectToWorld, v.vertex);
  362. o.pos = UnityMetaVertexPosition(v.vertex, v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST );
  363. return o;
  364. }
  365. float4 frag(VertexOutput i) : SV_Target {
  366. i.normalDir = normalize(i.normalDir);
  367. float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
  368. float3 normalDirection = i.normalDir;
  369. UnityMetaInput o;
  370. UNITY_INITIALIZE_OUTPUT( UnityMetaInput, o );
  371. o.Emission = 0;
  372. float node_9544 = distance(i.uv0,float2(0.5,0.5));
  373. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  374. float node_1198 = saturate(node_5748);
  375. float3 diffColor = (_FoamColor.rgb*node_1198);
  376. o.Albedo = diffColor;
  377. return UnityMetaFragment( o );
  378. }
  379. ENDCG
  380. }
  381. }
  382. FallBack "Diffuse"
  383. CustomEditor "ShaderForgeMaterialInspector"
  384. }