123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- // Shader created with Shader Forge v1.37
- // Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
- // Note: Manually altering this data may prevent you from opening it in Shader Forge
- /*SF_DATA;ver:1.37;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,cgin:,lico:1,lgpr:1,limd:1,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,imps:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:2,bsrc:0,bdst:0,dpts:2,wrdp:True,dith:0,atcv:False,rfrpo:True,rfrpn:Refraction,coma:15,ufog:True,aust:True,igpj:False,qofs:0,qpre:2,rntp:3,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,fsmp:False;n:type:ShaderForge.SFN_Final,id:4013,x:33035,y:32715,varname:node_4013,prsc:2|diff-4199-OUT,emission-4199-OUT,clip-3423-A;n:type:ShaderForge.SFN_Color,id:1304,x:32387,y:32638,ptovrint:False,ptlb:Color,ptin:_Color,varname:node_1304,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_Tex2d,id:3423,x:32325,y:32833,ptovrint:False,ptlb:node_3423,ptin:_node_3423,varname:node_3423,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,ntxv:0,isnm:False|UVIN-123-UVOUT;n:type:ShaderForge.SFN_Multiply,id:4199,x:32663,y:32737,varname:node_4199,prsc:2|A-1304-RGB,B-3423-RGB;n:type:ShaderForge.SFN_TexCoord,id:129,x:31725,y:32688,varname:node_129,prsc:2,uv:0,uaff:False;n:type:ShaderForge.SFN_Panner,id:123,x:32086,y:32729,varname:node_123,prsc:2,spu:0,spv:0.01|UVIN-129-UVOUT,DIST-6203-OUT;n:type:ShaderForge.SFN_Slider,id:7551,x:31746,y:33139,ptovrint:False,ptlb:node_7551,ptin:_node_7551,varname:node_7551,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:0,cur:1,max:1;n:type:ShaderForge.SFN_Slider,id:7419,x:31561,y:32996,ptovrint:False,ptlb:node_7419,ptin:_node_7419,varname:node_7419,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:0,cur:0,max:12;n:type:ShaderForge.SFN_Time,id:8662,x:31702,y:32847,varname:node_8662,prsc:2;n:type:ShaderForge.SFN_Multiply,id:6203,x:31928,y:32867,varname:node_6203,prsc:2|A-8662-T,B-7419-OUT;proporder:1304-3423-7551-7419;pass:END;sub:END;*/
- Shader "Shader Forge/LiZi01" {
- Properties {
- _Color ("Color", Color) = (1,1,1,1)
- _node_3423 ("node_3423", 2D) = "white" {}
- _node_7551 ("node_7551", Range(0, 1)) = 1
- _node_7419 ("node_7419", Range(0, 12)) = 0
- [HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
- }
- SubShader {
- Tags {
- "Queue"="AlphaTest"
- "RenderType"="TransparentCutout"
- }
- Pass {
- Name "FORWARD"
- Tags {
- "LightMode"="ForwardBase"
- }
- Blend One One
- Cull Off
-
-
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #define UNITY_PASS_FORWARDBASE
- #include "UnityCG.cginc"
- #include "AutoLight.cginc"
- #pragma multi_compile_fwdbase_fullshadows
- #pragma multi_compile_fog
- #pragma only_renderers d3d9 d3d11 glcore gles gles3 metal d3d11_9x xboxone
- #pragma target 3.0
- uniform float4 _LightColor0;
- uniform float4 _TimeEditor;
- uniform float4 _Color;
- uniform sampler2D _node_3423; uniform float4 _node_3423_ST;
- uniform float _node_7419;
- struct VertexInput {
- float4 vertex : POSITION;
- float3 normal : NORMAL;
- float2 texcoord0 : TEXCOORD0;
- };
- struct VertexOutput {
- float4 pos : SV_POSITION;
- float2 uv0 : TEXCOORD0;
- float4 posWorld : TEXCOORD1;
- float3 normalDir : TEXCOORD2;
- LIGHTING_COORDS(3,4)
- UNITY_FOG_COORDS(5)
- };
- VertexOutput vert (VertexInput v) {
- VertexOutput o = (VertexOutput)0;
- o.uv0 = v.texcoord0;
- o.normalDir = UnityObjectToWorldNormal(v.normal);
- o.posWorld = mul(unity_ObjectToWorld, v.vertex);
- float3 lightColor = _LightColor0.rgb;
- o.pos = UnityObjectToClipPos( v.vertex );
- UNITY_TRANSFER_FOG(o,o.pos);
- TRANSFER_VERTEX_TO_FRAGMENT(o)
- return o;
- }
- float4 frag(VertexOutput i, float facing : VFACE) : COLOR {
- float isFrontFace = ( facing >= 0 ? 1 : 0 );
- float faceSign = ( facing >= 0 ? 1 : -1 );
- i.normalDir = normalize(i.normalDir);
- i.normalDir *= faceSign;
- float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
- float3 normalDirection = i.normalDir;
- float4 node_8662 = _Time + _TimeEditor;
- float2 node_123 = (i.uv0+(node_8662.g*_node_7419)*float2(0,0.01));
- float4 _node_3423_var = tex2D(_node_3423,TRANSFORM_TEX(node_123, _node_3423));
- clip(_node_3423_var.a - 0.5);
- float3 lightDirection = normalize(_WorldSpaceLightPos0.xyz);
- float3 lightColor = _LightColor0.rgb;
- ////// Lighting:
- float attenuation = LIGHT_ATTENUATION(i);
- float3 attenColor = attenuation * _LightColor0.xyz;
- /////// Diffuse:
- float NdotL = max(0.0,dot( normalDirection, lightDirection ));
- float3 directDiffuse = max( 0.0, NdotL) * attenColor;
- float3 indirectDiffuse = float3(0,0,0);
- indirectDiffuse += UNITY_LIGHTMODEL_AMBIENT.rgb; // Ambient Light
- float3 node_4199 = (_Color.rgb*_node_3423_var.rgb);
- float3 diffuseColor = node_4199;
- float3 diffuse = (directDiffuse + indirectDiffuse) * diffuseColor;
- ////// Emissive:
- float3 emissive = node_4199;
- /// Final Color:
- float3 finalColor = diffuse + emissive;
- fixed4 finalRGBA = fixed4(finalColor,1);
- UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
- return finalRGBA;
- }
- ENDCG
- }
- Pass {
- Name "FORWARD_DELTA"
- Tags {
- "LightMode"="ForwardAdd"
- }
- Blend One One
- Cull Off
-
-
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #define UNITY_PASS_FORWARDADD
- #include "UnityCG.cginc"
- #include "AutoLight.cginc"
- #pragma multi_compile_fwdadd_fullshadows
- #pragma multi_compile_fog
- #pragma only_renderers d3d9 d3d11 glcore gles gles3 metal d3d11_9x xboxone
- #pragma target 3.0
- uniform float4 _LightColor0;
- uniform float4 _TimeEditor;
- uniform float4 _Color;
- uniform sampler2D _node_3423; uniform float4 _node_3423_ST;
- uniform float _node_7419;
- struct VertexInput {
- float4 vertex : POSITION;
- float3 normal : NORMAL;
- float2 texcoord0 : TEXCOORD0;
- };
- struct VertexOutput {
- float4 pos : SV_POSITION;
- float2 uv0 : TEXCOORD0;
- float4 posWorld : TEXCOORD1;
- float3 normalDir : TEXCOORD2;
- LIGHTING_COORDS(3,4)
- UNITY_FOG_COORDS(5)
- };
- VertexOutput vert (VertexInput v) {
- VertexOutput o = (VertexOutput)0;
- o.uv0 = v.texcoord0;
- o.normalDir = UnityObjectToWorldNormal(v.normal);
- o.posWorld = mul(unity_ObjectToWorld, v.vertex);
- float3 lightColor = _LightColor0.rgb;
- o.pos = UnityObjectToClipPos( v.vertex );
- UNITY_TRANSFER_FOG(o,o.pos);
- TRANSFER_VERTEX_TO_FRAGMENT(o)
- return o;
- }
- float4 frag(VertexOutput i, float facing : VFACE) : COLOR {
- float isFrontFace = ( facing >= 0 ? 1 : 0 );
- float faceSign = ( facing >= 0 ? 1 : -1 );
- i.normalDir = normalize(i.normalDir);
- i.normalDir *= faceSign;
- float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
- float3 normalDirection = i.normalDir;
- float4 node_8662 = _Time + _TimeEditor;
- float2 node_123 = (i.uv0+(node_8662.g*_node_7419)*float2(0,0.01));
- float4 _node_3423_var = tex2D(_node_3423,TRANSFORM_TEX(node_123, _node_3423));
- clip(_node_3423_var.a - 0.5);
- float3 lightDirection = normalize(lerp(_WorldSpaceLightPos0.xyz, _WorldSpaceLightPos0.xyz - i.posWorld.xyz,_WorldSpaceLightPos0.w));
- float3 lightColor = _LightColor0.rgb;
- ////// Lighting:
- float attenuation = LIGHT_ATTENUATION(i);
- float3 attenColor = attenuation * _LightColor0.xyz;
- /////// Diffuse:
- float NdotL = max(0.0,dot( normalDirection, lightDirection ));
- float3 directDiffuse = max( 0.0, NdotL) * attenColor;
- float3 node_4199 = (_Color.rgb*_node_3423_var.rgb);
- float3 diffuseColor = node_4199;
- float3 diffuse = directDiffuse * diffuseColor;
- /// Final Color:
- float3 finalColor = diffuse;
- fixed4 finalRGBA = fixed4(finalColor * 1,0);
- UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
- return finalRGBA;
- }
- ENDCG
- }
- Pass {
- Name "ShadowCaster"
- Tags {
- "LightMode"="ShadowCaster"
- }
- Offset 1, 1
- Cull Off
-
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #define UNITY_PASS_SHADOWCASTER
- #include "UnityCG.cginc"
- #include "Lighting.cginc"
- #pragma fragmentoption ARB_precision_hint_fastest
- #pragma multi_compile_shadowcaster
- #pragma multi_compile_fog
- #pragma only_renderers d3d9 d3d11 glcore gles gles3 metal d3d11_9x xboxone
- #pragma target 3.0
- uniform float4 _TimeEditor;
- uniform sampler2D _node_3423; uniform float4 _node_3423_ST;
- uniform float _node_7419;
- struct VertexInput {
- float4 vertex : POSITION;
- float2 texcoord0 : TEXCOORD0;
- };
- struct VertexOutput {
- V2F_SHADOW_CASTER;
- float2 uv0 : TEXCOORD1;
- };
- VertexOutput vert (VertexInput v) {
- VertexOutput o = (VertexOutput)0;
- o.uv0 = v.texcoord0;
- o.pos = UnityObjectToClipPos( v.vertex );
- TRANSFER_SHADOW_CASTER(o)
- return o;
- }
- float4 frag(VertexOutput i, float facing : VFACE) : COLOR {
- float isFrontFace = ( facing >= 0 ? 1 : 0 );
- float faceSign = ( facing >= 0 ? 1 : -1 );
- float4 node_8662 = _Time + _TimeEditor;
- float2 node_123 = (i.uv0+(node_8662.g*_node_7419)*float2(0,0.01));
- float4 _node_3423_var = tex2D(_node_3423,TRANSFORM_TEX(node_123, _node_3423));
- clip(_node_3423_var.a - 0.5);
- SHADOW_CASTER_FRAGMENT(i)
- }
- ENDCG
- }
- }
- FallBack "Diffuse"
- CustomEditor "ShaderForgeMaterialInspector"
- }
|