// Made with Amplify Shader Editor // Available at the Unity Asset Store - http://u3d.as/y3X Shader "FAE/Sunshaft Particle" { Properties { _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5) _MainTex ("Particle Texture", 2D) = "white" {} _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 _Fadedistance("Fade distance", Range( 0 , 150)) = 6 _Opacity("Opacity", Range( 0 , 1)) = 0.3 [HideInInspector] _texcoord( "", 2D ) = "white" {} } Category { SubShader { Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } Blend SrcAlpha OneMinusSrcAlpha ColorMask RGB Cull Off Lighting Off ZWrite Off ZTest LEqual Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag #pragma target 2.0 #pragma multi_compile_particles #pragma multi_compile_fog #include "Lighting.cginc" #include "UnityShaderVariables.cginc" #include "UnityCG.cginc" struct appdata_t { float4 vertex : POSITION; fixed4 color : COLOR; float4 texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; fixed4 color : COLOR; float4 texcoord : TEXCOORD0; UNITY_FOG_COORDS(1) #ifdef SOFTPARTICLES_ON float4 projPos : TEXCOORD2; #endif UNITY_VERTEX_OUTPUT_STEREO float4 ase_texcoord3 : TEXCOORD3; }; uniform sampler2D _MainTex; uniform fixed4 _TintColor; uniform float4 _MainTex_ST; uniform sampler2D_float _CameraDepthTexture; uniform float _InvFade; uniform float _Opacity; uniform float _Fadedistance; v2f vert ( appdata_t v ) { v2f o; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); float3 ase_worldPos = mul(unity_ObjectToWorld, v.vertex).xyz; o.ase_texcoord3.xyz = ase_worldPos; //setting value to unused interpolator channels and avoid initialization warnings o.ase_texcoord3.w = 0; v.vertex.xyz += float3( 0, 0, 0 ) ; o.vertex = UnityObjectToClipPos(v.vertex); #ifdef SOFTPARTICLES_ON o.projPos = ComputeScreenPos (o.vertex); COMPUTE_EYEDEPTH(o.projPos.z); #endif o.color = v.color; o.texcoord = v.texcoord; UNITY_TRANSFER_FOG(o,o.vertex); return o; } fixed4 frag ( v2f i ) : SV_Target { #ifdef SOFTPARTICLES_ON float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))); float partZ = i.projPos.z; float fade = saturate (_InvFade * (sceneZ-partZ)); i.color.a *= fade; #endif #if defined(LIGHTMAP_ON) && UNITY_VERSION < 560 //aselc float4 ase_lightColor = 0; #else //aselc float4 ase_lightColor = _LightColor0; #endif //aselc float3 break43 = ( ase_lightColor.rgb * (i.color).rgb ); float2 uv_MainTex = i.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw; float temp_output_34_0 = ( i.color.a * tex2D( _MainTex, uv_MainTex ).a ); float3 ase_worldPos = i.ase_texcoord3.xyz; float4 appendResult42 = (float4(break43.x , break43.y , break43.z , saturate( ( _Opacity * ( temp_output_34_0 * ( temp_output_34_0 * ( distance( _WorldSpaceCameraPos , ase_worldPos ) / _Fadedistance ) ) * _InvFade ) ) ))); fixed4 col = appendResult42; UNITY_APPLY_FOG(i.fogCoord, col); return col; } ENDCG } } } } /*ASEBEGIN Version=15700 1928;29;1905;1004;-1167.279;300.4025;1.082702;True;True Node;AmplifyShaderEditor.WorldSpaceCameraPos;13;535.6252,316.2769;Float;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3 Node;AmplifyShaderEditor.WorldPosInputsNode;14;611.3344,478.8737;Float;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3 Node;AmplifyShaderEditor.TemplateShaderPropertyNode;45;593.7608,168.6325;Float;False;0;0;_MainTex;Shader;0;5;SAMPLER2D;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.DistanceOpNode;15;925.3344,409.8737;Float;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;17;765.3344,676.8737;Float;False;Property;_Fadedistance;Fade distance;0;0;Create;True;0;0;False;0;6;12.3;0;150;0;1;FLOAT;0 Node;AmplifyShaderEditor.SamplerNode;29;981.6983,174.1721;Float;True;Property;_Alpha;Alpha;1;0;Create;True;0;0;False;0;None;None;True;0;False;white;Auto;False;Object;-1;Auto;ProceduralTexture;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;0;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.VertexColorNode;30;1049.204,-107.348;Float;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SimpleDivideOpNode;16;1180.334,482.8737;Float;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;34;1420.45,122.9503;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;35;1668.366,348.2147;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.TemplateShaderPropertyNode;44;1605.361,496.9932;Float;False;0;0;_InvFade;Shader;0;5;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;36;1937.677,300.393;Float;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;46;1842.962,161.0311;Float;False;Property;_Opacity;Opacity;1;0;Create;True;0;0;False;0;0.3;0.3;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.SwizzleNode;33;1293.346,-122.4494;Float;False;FLOAT3;0;1;2;3;1;0;COLOR;0,0,0,0;False;1;FLOAT3;0 Node;AmplifyShaderEditor.LightColorNode;31;1070.598,-245.7783;Float;False;0;3;COLOR;0;FLOAT3;1;FLOAT;2 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;32;1553.846,-197.957;Float;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;37;2198.178,241.2455;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.BreakToComponentsNode;43;2204.279,-33.56119;Float;False;FLOAT3;1;0;FLOAT3;0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15 Node;AmplifyShaderEditor.SaturateNode;39;2390.49,235.0446;Float;False;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.DynamicAppendNode;42;2648.439,142.5447;Float;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;41;2872.652,146.0635;Float;False;True;2;Float;;0;6;FAE/Sunshaft Particle;0b6a9f8b4f707c74ca64c0be8e590de0;0;0;;2;True;2;5;False;-1;10;False;-1;0;1;False;-1;0;False;-1;False;True;2;False;-1;True;True;True;True;False;0;False;-1;False;True;2;False;-1;True;3;False;-1;False;True;4;Queue=Transparent=Queue=0;IgnoreProjector=True;RenderType=Transparent=RenderType;PreviewType=Plane;False;0;False;False;False;False;False;False;False;False;False;True;0;0;;0;0;Standard;0;2;0;FLOAT4;0,0,0,0;False;1;FLOAT3;0,0,0;False;0 WireConnection;15;0;13;0 WireConnection;15;1;14;0 WireConnection;29;0;45;0 WireConnection;16;0;15;0 WireConnection;16;1;17;0 WireConnection;34;0;30;4 WireConnection;34;1;29;4 WireConnection;35;0;34;0 WireConnection;35;1;16;0 WireConnection;36;0;34;0 WireConnection;36;1;35;0 WireConnection;36;2;44;0 WireConnection;33;0;30;0 WireConnection;32;0;31;1 WireConnection;32;1;33;0 WireConnection;37;0;46;0 WireConnection;37;1;36;0 WireConnection;43;0;32;0 WireConnection;39;0;37;0 WireConnection;42;0;43;0 WireConnection;42;1;43;1 WireConnection;42;2;43;2 WireConnection;42;3;39;0 WireConnection;41;0;42;0 ASEEND*/ //CHKSM=8146B74BE6DDD755E9F4C90431B1CE409A05B9D6