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.

395 lines
21 KiB

7 years ago
7 years ago
7 years ago
7 years ago
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. // Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
  3. // Shader created with Shader Forge v1.30
  4. // Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
  5. // Note: Manually altering this data may prevent you from opening it in Shader Forge
  6. /*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;*/
  7. Shader "LightHouse/WaterShader" {
  8. Properties {
  9. _Ring_Amount ("Ring_Amount", Range(1, 200)) = 19.17478
  10. _FoamColor ("FoamColor", Color) = (1,1,1,1)
  11. _WaveHeight ("WaveHeight", Range(1, 10)) = 5.549279
  12. _Speed ("Speed", Range(-1, 1.5)) = -1
  13. _Fade ("Fade", Range(0, 1)) = 1
  14. [HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
  15. }
  16. SubShader {
  17. Tags {
  18. "IgnoreProjector"="True"
  19. "Queue"="Transparent"
  20. "RenderType"="Transparent"
  21. }
  22. Pass {
  23. Name "FORWARD"
  24. Tags {
  25. "LightMode"="ForwardBase"
  26. }
  27. Blend SrcAlpha OneMinusSrcAlpha
  28. ZWrite Off
  29. CGPROGRAM
  30. #pragma vertex vert
  31. #pragma fragment frag
  32. #define UNITY_PASS_FORWARDBASE
  33. #define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
  34. #include "UnityCG.cginc"
  35. #include "Lighting.cginc"
  36. #include "UnityPBSLighting.cginc"
  37. #include "UnityStandardBRDF.cginc"
  38. #pragma multi_compile_fwdbase
  39. #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
  40. #pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
  41. #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
  42. #pragma multi_compile_fog
  43. #pragma exclude_renderers xbox360 ps3
  44. #pragma target 3.0
  45. uniform float _Ring_Amount;
  46. uniform float4 _FoamColor;
  47. uniform float _WaveHeight;
  48. uniform float _Speed;
  49. uniform float _Fade;
  50. struct VertexInput {
  51. float4 vertex : POSITION;
  52. float3 normal : NORMAL;
  53. float4 tangent : TANGENT;
  54. float2 texcoord0 : TEXCOORD0;
  55. float2 texcoord1 : TEXCOORD1;
  56. float2 texcoord2 : TEXCOORD2;
  57. };
  58. struct VertexOutput {
  59. float4 pos : SV_POSITION;
  60. float2 uv0 : TEXCOORD0;
  61. float2 uv1 : TEXCOORD1;
  62. float2 uv2 : TEXCOORD2;
  63. float4 posWorld : TEXCOORD3;
  64. float3 normalDir : TEXCOORD4;
  65. float3 tangentDir : TEXCOORD5;
  66. float3 bitangentDir : TEXCOORD6;
  67. UNITY_FOG_COORDS(7)
  68. #if defined(LIGHTMAP_ON) || defined(UNITY_SHOULD_SAMPLE_SH)
  69. float4 ambientOrLightmapUV : TEXCOORD8;
  70. #endif
  71. };
  72. VertexOutput vert (VertexInput v) {
  73. VertexOutput o = (VertexOutput)0;
  74. o.uv0 = v.texcoord0;
  75. o.uv1 = v.texcoord1;
  76. o.uv2 = v.texcoord2;
  77. #ifdef LIGHTMAP_ON
  78. o.ambientOrLightmapUV.xy = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw;
  79. o.ambientOrLightmapUV.zw = 0;
  80. #elif UNITY_SHOULD_SAMPLE_SH
  81. #endif
  82. #ifdef DYNAMICLIGHTMAP_ON
  83. o.ambientOrLightmapUV.zw = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
  84. #endif
  85. o.normalDir = UnityObjectToWorldNormal(v.normal);
  86. o.tangentDir = normalize( mul( unity_ObjectToWorld, float4( v.tangent.xyz, 0.0 ) ).xyz );
  87. o.bitangentDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
  88. float node_9544 = distance(o.uv0,float2(0.5,0.5));
  89. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  90. v.vertex.xyz += ((node_5748*_WaveHeight)*v.normal);
  91. o.posWorld = mul(unity_ObjectToWorld, v.vertex);
  92. float3 lightColor = _LightColor0.rgb;
  93. o.pos = UnityObjectToClipPos(v.vertex );
  94. UNITY_TRANSFER_FOG(o,o.pos);
  95. return o;
  96. }
  97. float4 frag(VertexOutput i) : COLOR {
  98. i.normalDir = normalize(i.normalDir);
  99. float3x3 tangentTransform = float3x3( i.tangentDir, i.bitangentDir, i.normalDir);
  100. float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
  101. float3 normalDirection = i.normalDir;
  102. float3 viewReflectDirection = reflect( -viewDirection, normalDirection );
  103. float3 lightDirection = normalize(_WorldSpaceLightPos0.xyz);
  104. float3 lightColor = _LightColor0.rgb;
  105. ////// Lighting:
  106. float attenuation = 1;
  107. float3 attenColor = attenuation * _LightColor0.xyz;
  108. /////// GI Data:
  109. UnityLight light;
  110. #ifdef LIGHTMAP_OFF
  111. light.color = lightColor;
  112. light.dir = lightDirection;
  113. light.ndotl = LambertTerm (normalDirection, light.dir);
  114. #else
  115. light.color = half3(0.f, 0.f, 0.f);
  116. light.ndotl = 0.0f;
  117. light.dir = half3(0.f, 0.f, 0.f);
  118. #endif
  119. UnityGIInput d;
  120. d.light = light;
  121. d.worldPos = i.posWorld.xyz;
  122. d.worldViewDir = viewDirection;
  123. d.atten = attenuation;
  124. #if defined(LIGHTMAP_ON) || defined(DYNAMICLIGHTMAP_ON)
  125. d.ambient = 0;
  126. d.lightmapUV = i.ambientOrLightmapUV;
  127. #else
  128. d.ambient = i.ambientOrLightmapUV;
  129. #endif
  130. Unity_GlossyEnvironmentData ugls_en_data;
  131. ugls_en_data.roughness = 1.0 - 0;
  132. ugls_en_data.reflUVW = viewReflectDirection;
  133. UnityGI gi = UnityGlobalIllumination(d, 1, normalDirection, ugls_en_data );
  134. lightDirection = gi.light.dir;
  135. lightColor = gi.light.color;
  136. /////// Diffuse:
  137. float NdotL = max(0.0,dot( normalDirection, lightDirection ));
  138. float3 directDiffuse = max( 0.0, NdotL) * attenColor;
  139. float3 indirectDiffuse = float3(0,0,0);
  140. indirectDiffuse += gi.indirect.diffuse;
  141. float node_9544 = distance(i.uv0,float2(0.5,0.5));
  142. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  143. float node_1198 = saturate(node_5748);
  144. float3 diffuseColor = (_FoamColor.rgb*node_1198);
  145. float3 diffuse = (directDiffuse + indirectDiffuse) * diffuseColor;
  146. /// Final Color:
  147. float3 finalColor = diffuse;
  148. fixed4 finalRGBA = fixed4(finalColor,(node_1198*round((1.0 - node_9544))*_Fade));
  149. UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
  150. return finalRGBA;
  151. }
  152. ENDCG
  153. }
  154. Pass {
  155. Name "FORWARD_DELTA"
  156. Tags {
  157. "LightMode"="ForwardAdd"
  158. }
  159. Blend One One
  160. ZWrite Off
  161. CGPROGRAM
  162. #pragma vertex vert
  163. #pragma fragment frag
  164. #define UNITY_PASS_FORWARDADD
  165. #define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
  166. #include "UnityCG.cginc"
  167. #include "AutoLight.cginc"
  168. #include "Lighting.cginc"
  169. #include "UnityPBSLighting.cginc"
  170. #include "UnityStandardBRDF.cginc"
  171. #pragma multi_compile_fwdadd
  172. #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
  173. #pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
  174. #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
  175. #pragma multi_compile_fog
  176. #pragma exclude_renderers xbox360 ps3
  177. #pragma target 3.0
  178. uniform float _Ring_Amount;
  179. uniform float4 _FoamColor;
  180. uniform float _WaveHeight;
  181. uniform float _Speed;
  182. uniform float _Fade;
  183. struct VertexInput {
  184. float4 vertex : POSITION;
  185. float3 normal : NORMAL;
  186. float4 tangent : TANGENT;
  187. float2 texcoord0 : TEXCOORD0;
  188. float2 texcoord1 : TEXCOORD1;
  189. float2 texcoord2 : TEXCOORD2;
  190. };
  191. struct VertexOutput {
  192. float4 pos : SV_POSITION;
  193. float2 uv0 : TEXCOORD0;
  194. float2 uv1 : TEXCOORD1;
  195. float2 uv2 : TEXCOORD2;
  196. float4 posWorld : TEXCOORD3;
  197. float3 normalDir : TEXCOORD4;
  198. float3 tangentDir : TEXCOORD5;
  199. float3 bitangentDir : TEXCOORD6;
  200. LIGHTING_COORDS(7,8)
  201. UNITY_FOG_COORDS(9)
  202. };
  203. VertexOutput vert (VertexInput v) {
  204. VertexOutput o = (VertexOutput)0;
  205. o.uv0 = v.texcoord0;
  206. o.uv1 = v.texcoord1;
  207. o.uv2 = v.texcoord2;
  208. o.normalDir = UnityObjectToWorldNormal(v.normal);
  209. o.tangentDir = normalize( mul( unity_ObjectToWorld, float4( v.tangent.xyz, 0.0 ) ).xyz );
  210. o.bitangentDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
  211. float node_9544 = distance(o.uv0,float2(0.5,0.5));
  212. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  213. v.vertex.xyz += ((node_5748*_WaveHeight)*v.normal);
  214. o.posWorld = mul(unity_ObjectToWorld, v.vertex);
  215. float3 lightColor = _LightColor0.rgb;
  216. o.pos = UnityObjectToClipPos(v.vertex );
  217. UNITY_TRANSFER_FOG(o,o.pos);
  218. TRANSFER_VERTEX_TO_FRAGMENT(o)
  219. return o;
  220. }
  221. float4 frag(VertexOutput i) : COLOR {
  222. i.normalDir = normalize(i.normalDir);
  223. float3x3 tangentTransform = float3x3( i.tangentDir, i.bitangentDir, i.normalDir);
  224. float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
  225. float3 normalDirection = i.normalDir;
  226. float3 lightDirection = normalize(lerp(_WorldSpaceLightPos0.xyz, _WorldSpaceLightPos0.xyz - i.posWorld.xyz,_WorldSpaceLightPos0.w));
  227. float3 lightColor = _LightColor0.rgb;
  228. ////// Lighting:
  229. float attenuation = LIGHT_ATTENUATION(i);
  230. float3 attenColor = attenuation * _LightColor0.xyz;
  231. /////// Diffuse:
  232. float NdotL = max(0.0,dot( normalDirection, lightDirection ));
  233. float3 directDiffuse = max( 0.0, NdotL) * attenColor;
  234. float node_9544 = distance(i.uv0,float2(0.5,0.5));
  235. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  236. float node_1198 = saturate(node_5748);
  237. float3 diffuseColor = (_FoamColor.rgb*node_1198);
  238. float3 diffuse = directDiffuse * diffuseColor;
  239. /// Final Color:
  240. float3 finalColor = diffuse;
  241. fixed4 finalRGBA = fixed4(finalColor * (node_1198*round((1.0 - node_9544))*_Fade),0);
  242. UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
  243. return finalRGBA;
  244. }
  245. ENDCG
  246. }
  247. Pass {
  248. Name "ShadowCaster"
  249. Tags {
  250. "LightMode"="ShadowCaster"
  251. }
  252. Offset 1, 1
  253. CGPROGRAM
  254. #pragma vertex vert
  255. #pragma fragment frag
  256. #define UNITY_PASS_SHADOWCASTER
  257. #define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
  258. #include "UnityCG.cginc"
  259. #include "Lighting.cginc"
  260. #include "UnityPBSLighting.cginc"
  261. #include "UnityStandardBRDF.cginc"
  262. #pragma fragmentoption ARB_precision_hint_fastest
  263. #pragma multi_compile_shadowcaster
  264. #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
  265. #pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
  266. #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
  267. #pragma multi_compile_fog
  268. #pragma exclude_renderers xbox360 ps3
  269. #pragma target 3.0
  270. uniform float _Ring_Amount;
  271. uniform float _WaveHeight;
  272. uniform float _Speed;
  273. struct VertexInput {
  274. float4 vertex : POSITION;
  275. float3 normal : NORMAL;
  276. float2 texcoord0 : TEXCOORD0;
  277. float2 texcoord1 : TEXCOORD1;
  278. float2 texcoord2 : TEXCOORD2;
  279. };
  280. struct VertexOutput {
  281. V2F_SHADOW_CASTER;
  282. float2 uv0 : TEXCOORD1;
  283. float2 uv1 : TEXCOORD2;
  284. float2 uv2 : TEXCOORD3;
  285. float4 posWorld : TEXCOORD4;
  286. float3 normalDir : TEXCOORD5;
  287. };
  288. VertexOutput vert (VertexInput v) {
  289. VertexOutput o = (VertexOutput)0;
  290. o.uv0 = v.texcoord0;
  291. o.uv1 = v.texcoord1;
  292. o.uv2 = v.texcoord2;
  293. o.normalDir = UnityObjectToWorldNormal(v.normal);
  294. float node_9544 = distance(o.uv0,float2(0.5,0.5));
  295. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  296. v.vertex.xyz += ((node_5748*_WaveHeight)*v.normal);
  297. o.posWorld = mul(unity_ObjectToWorld, v.vertex);
  298. o.pos = UnityObjectToClipPos(v.vertex );
  299. TRANSFER_SHADOW_CASTER(o)
  300. return o;
  301. }
  302. float4 frag(VertexOutput i) : COLOR {
  303. i.normalDir = normalize(i.normalDir);
  304. float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
  305. float3 normalDirection = i.normalDir;
  306. SHADOW_CASTER_FRAGMENT(i)
  307. }
  308. ENDCG
  309. }
  310. Pass {
  311. Name "Meta"
  312. Tags {
  313. "LightMode"="Meta"
  314. }
  315. Cull Off
  316. CGPROGRAM
  317. #pragma vertex vert
  318. #pragma fragment frag
  319. #define UNITY_PASS_META 1
  320. #define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
  321. #include "UnityCG.cginc"
  322. #include "Lighting.cginc"
  323. #include "UnityPBSLighting.cginc"
  324. #include "UnityStandardBRDF.cginc"
  325. #include "UnityMetaPass.cginc"
  326. #pragma fragmentoption ARB_precision_hint_fastest
  327. #pragma multi_compile_shadowcaster
  328. #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
  329. #pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
  330. #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
  331. #pragma multi_compile_fog
  332. #pragma exclude_renderers xbox360 ps3
  333. #pragma target 3.0
  334. uniform float _Ring_Amount;
  335. uniform float4 _FoamColor;
  336. uniform float _WaveHeight;
  337. uniform float _Speed;
  338. struct VertexInput {
  339. float4 vertex : POSITION;
  340. float3 normal : NORMAL;
  341. float2 texcoord0 : TEXCOORD0;
  342. float2 texcoord1 : TEXCOORD1;
  343. float2 texcoord2 : TEXCOORD2;
  344. };
  345. struct VertexOutput {
  346. float4 pos : SV_POSITION;
  347. float2 uv0 : TEXCOORD0;
  348. float2 uv1 : TEXCOORD1;
  349. float2 uv2 : TEXCOORD2;
  350. float4 posWorld : TEXCOORD3;
  351. float3 normalDir : TEXCOORD4;
  352. };
  353. VertexOutput vert (VertexInput v) {
  354. VertexOutput o = (VertexOutput)0;
  355. o.uv0 = v.texcoord0;
  356. o.uv1 = v.texcoord1;
  357. o.uv2 = v.texcoord2;
  358. o.normalDir = UnityObjectToWorldNormal(v.normal);
  359. float node_9544 = distance(o.uv0,float2(0.5,0.5));
  360. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  361. v.vertex.xyz += ((node_5748*_WaveHeight)*v.normal);
  362. o.posWorld = mul(unity_ObjectToWorld, v.vertex);
  363. o.pos = UnityMetaVertexPosition(v.vertex, v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST );
  364. return o;
  365. }
  366. float4 frag(VertexOutput i) : SV_Target {
  367. i.normalDir = normalize(i.normalDir);
  368. float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
  369. float3 normalDirection = i.normalDir;
  370. UnityMetaInput o;
  371. UNITY_INITIALIZE_OUTPUT( UnityMetaInput, o );
  372. o.Emission = 0;
  373. float node_9544 = distance(i.uv0,float2(0.5,0.5));
  374. float node_5748 = sin(((node_9544+(_Speed*0.5+0.0))*_Ring_Amount));
  375. float node_1198 = saturate(node_5748);
  376. float3 diffColor = (_FoamColor.rgb*node_1198);
  377. o.Albedo = diffColor;
  378. return UnityMetaFragment( o );
  379. }
  380. ENDCG
  381. }
  382. }
  383. FallBack "Diffuse"
  384. CustomEditor "ShaderForgeMaterialInspector"
  385. }