249 lines
14 KiB
Plaintext
249 lines
14 KiB
Plaintext
Shader "ERB/HDRP/Particles/LightGlow"
|
|
{
|
|
Properties
|
|
{
|
|
_MainTex("MainTex", 2D) = "white" {}
|
|
_Noise("Noise", 2D) = "white" {}
|
|
_SpeedMainTexUVNoiseZW("Speed MainTex U/V + Noise Z/W", Vector) = (0,0,0,0)
|
|
_Emission("Emission", Float) = 2
|
|
_Color("Color", Color) = (0.5,0.5,0.5,1)
|
|
_Mask("Mask", 2D) = "white" {}
|
|
_Opacity("Opacity", Range( 0 , 1)) = 1
|
|
[MaterialToggle] _Usedepth ("Use depth?", Float ) = 0
|
|
_Depthpower ("Depth power", Float ) = 1
|
|
[Toggle]_Usecenterglow("Use center glow?", Float) = 0
|
|
[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 "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_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
|
|
#if UNITY_VERSION >= 560
|
|
UNITY_DECLARE_DEPTH_TEXTURE( _CameraDepthTexture );
|
|
#else
|
|
uniform sampler2D_float _CameraDepthTexture;
|
|
#endif
|
|
|
|
//Don't delete this comment
|
|
// uniform sampler2D_float _CameraDepthTexture;
|
|
|
|
uniform sampler2D _MainTex;
|
|
uniform float4 _MainTex_ST;
|
|
uniform float _Usecenterglow;
|
|
uniform float4 _SpeedMainTexUVNoiseZW;
|
|
uniform sampler2D _Noise;
|
|
uniform float4 _Noise_ST;
|
|
uniform float4 _Color;
|
|
uniform sampler2D _Mask;
|
|
uniform float4 _Mask_ST;
|
|
uniform float _Emission;
|
|
uniform float _Opacity;
|
|
uniform fixed _Usedepth;
|
|
uniform float _Depthpower;
|
|
|
|
v2f vert ( appdata_t v )
|
|
{
|
|
v2f o;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
|
|
|
|
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
|
|
{
|
|
float lp = 1;
|
|
#ifdef SOFTPARTICLES_ON
|
|
float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
|
|
float partZ = i.projPos.z;
|
|
float fade = saturate ((sceneZ-partZ) / _Depthpower);
|
|
lp *= lerp(1, fade, _Usedepth);
|
|
i.color.a *= lp;
|
|
#endif
|
|
|
|
float2 appendResult21 = (float2(_SpeedMainTexUVNoiseZW.x , _SpeedMainTexUVNoiseZW.y));
|
|
float2 uv0_MainTex = i.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw;
|
|
float4 tex2DNode13 = tex2D( _MainTex, ( ( appendResult21 * _Time.y ) + uv0_MainTex ) );
|
|
float2 appendResult22 = (float2(_SpeedMainTexUVNoiseZW.z , _SpeedMainTexUVNoiseZW.w));
|
|
float3 uv0_Noise = i.texcoord.xyz;
|
|
uv0_Noise.xy = i.texcoord.xyz.xy * _Noise_ST.xy + _Noise_ST.zw;
|
|
float4 tex2DNode14 = tex2D( _Noise, ( float3( ( _Time.y * appendResult22 ) , 0.0 ) + (uv0_Noise).xyz ).xy );
|
|
float3 temp_output_54_0 = (( tex2DNode13 * tex2DNode14 * _Color * i.color )).rgb;
|
|
float2 uv_Mask = i.texcoord.xy * _Mask_ST.xy + _Mask_ST.zw;
|
|
float3 temp_output_58_0 = (tex2D( _Mask, uv_Mask )).rgb;
|
|
float3 temp_cast_2 = ((1.0 + (uv0_Noise.z - 0.0) * (0.0 - 1.0) / (1.0 - 0.0))).xxx;
|
|
float3 temp_output_51_0 = ( lerp(temp_output_54_0,( temp_output_54_0 * saturate( ( temp_output_58_0 * saturate( ( temp_output_58_0 - temp_cast_2 ) ) ) ) ),_Usecenterglow) * _Emission );
|
|
float4 appendResult98 = (float4(temp_output_51_0 , ( ( tex2DNode13.a * tex2DNode14.a * _Color.a * i.color.a ) * _Opacity )));
|
|
|
|
fixed4 col = appendResult98;
|
|
UNITY_APPLY_FOG(i.fogCoord, col);
|
|
return col;
|
|
}
|
|
ENDCG
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*ASEBEGIN
|
|
Version=16900
|
|
324;130;1213;989;4548.957;1310.119;3.596032;True;False
|
|
Node;AmplifyShaderEditor.Vector4Node;15;-3103.802,24.82627;Float;False;Property;_SpeedMainTexUVNoiseZW;Speed MainTex U/V + Noise Z/W;2;0;Create;True;0;0;False;0;0,0,0,0;0,0,0,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;21;-2742.397,-37.24139;Float;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;22;-2739.856,185.038;Float;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.TimeNode;17;-2772.28,53.38881;Float;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;82;-2651.676,746.8742;Float;False;0;14;3;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SamplerNode;33;-2267.097,648.0693;Float;True;Property;_Mask;Mask;5;0;Create;True;0;0;False;0;None;None;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
|
|
Node;AmplifyShaderEditor.TFHCRemapNode;36;-1923.092,912.1827;Float;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;1;False;4;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;23;-2512.882,197.5063;Float;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;83;-2378.556,31.04088;Float;False;0;13;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.ComponentMaskNode;58;-1941.441,650.6088;Float;False;True;True;True;False;1;0;COLOR;0,0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.ComponentMaskNode;94;-2346.908,288.2555;Float;False;True;True;True;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;24;-2525.724,-35.90024;Float;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;27;-2106.339,199.8013;Float;False;2;2;0;FLOAT2;0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;26;-2135.255,-39.36416;Float;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SimpleSubtractOpNode;37;-1700.092,897.7924;Float;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.VertexColorNode;32;-1670.612,486.0577;Float;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.ColorNode;31;-1728.612,316.0578;Float;False;Property;_Color;Color;4;0;Create;True;0;0;False;0;0.5,0.5,0.5,1;0.5,0.5,0.5,1;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SamplerNode;13;-1803.192,-66.2159;Float;True;Property;_MainTex;MainTex;0;0;Create;True;0;0;False;0;None;None;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
|
|
Node;AmplifyShaderEditor.SaturateNode;95;-1540.088,898.3631;Float;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SamplerNode;14;-1804.579,119.2214;Float;True;Property;_Noise;Noise;1;0;Create;True;0;0;False;0;None;None;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
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;39;-1344.594,664.8295;Float;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;30;-1344.176,87.61483;Float;False;4;4;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.ComponentMaskNode;54;-1200.63,93.90314;Float;False;True;True;True;False;1;0;COLOR;0,0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SaturateNode;96;-1178.938,662.1377;Float;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;41;-948.7514,306.9257;Float;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;60;-1324.839,396.5218;Float;False;4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;62;-844.6942,504.8437;Float;False;Property;_Opacity;Opacity;6;0;Create;True;0;0;False;0;1;1;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;52;-729.1033,211.2775;Float;False;Property;_Emission;Emission;3;0;Create;True;0;0;False;0;2;2;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ToggleSwitchNode;84;-760.6181,103.0466;Float;False;Property;_Usecenterglow;Use center glow?;9;0;Create;True;0;0;False;0;0;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;51;-493.1035,107.5727;Float;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;61;-545.6591,397.0074;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;81;427.4916,-383.4084;Float;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SimpleMaxOpNode;76;-159.3444,-452.5628;Float;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.PowerNode;72;-471.2549,-331.9796;Float;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.WorldSpaceLightPos;68;-935.1523,-479.6185;Float;False;0;3;FLOAT4;0;FLOAT3;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.RangedFloatNode;73;-673.3799,-346.3619;Float;False;Property;_LightFalloff;Light Falloff;7;0;Create;True;0;0;False;0;0.5;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;74;-492.373,-536.4464;Float;False;Property;_LightRange;Light Range;8;0;Create;True;0;0;False;0;2;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleSubtractOpNode;75;-315.92,-453.3664;Float;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TFHCRemapNode;77;16.5519,-452.2668;Float;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;80;12.16329,-291.314;Float;False;Constant;_LightEmission;Light Emission;13;0;Create;True;0;0;False;0;2;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.LightColorNode;79;34.16329,-580.3141;Float;False;0;3;COLOR;0;FLOAT3;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;78;243.1631,-469.3141;Float;False;3;3;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;98;-246.1797,231.9282;Float;False;FLOAT4;4;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
|
|
Node;AmplifyShaderEditor.WorldPosInputsNode;69;-1037.484,-378.9421;Float;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;70;-839.1216,-358.3128;Float;False;FLOAT4;4;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
|
|
Node;AmplifyShaderEditor.DistanceOpNode;71;-674.4135,-460.4146;Float;False;2;0;FLOAT3;0,0,0;False;1;FLOAT4;0,0,0,0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;93;99.1432,258.3285;Float;False;True;2;Float;;0;10;ERB/HDRP/Particles/LightGlow;0b6a9f8b4f707c74ca64c0be8e590de0;True;SubShader 0 Pass 0;0;0;SubShader 0 Pass 0;2;True;2;5;False;-1;10;False;-1;0;1;False;-1;0;False;-1;False;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;False;True;0;0;;0;0;Standard;0;0;1;True;False;2;0;FLOAT4;0,0,0,0;False;1;FLOAT3;0,0,0;False;0
|
|
WireConnection;21;0;15;1
|
|
WireConnection;21;1;15;2
|
|
WireConnection;22;0;15;3
|
|
WireConnection;22;1;15;4
|
|
WireConnection;36;0;82;3
|
|
WireConnection;23;0;17;2
|
|
WireConnection;23;1;22;0
|
|
WireConnection;58;0;33;0
|
|
WireConnection;94;0;82;0
|
|
WireConnection;24;0;21;0
|
|
WireConnection;24;1;17;2
|
|
WireConnection;27;0;23;0
|
|
WireConnection;27;1;94;0
|
|
WireConnection;26;0;24;0
|
|
WireConnection;26;1;83;0
|
|
WireConnection;37;0;58;0
|
|
WireConnection;37;1;36;0
|
|
WireConnection;13;1;26;0
|
|
WireConnection;95;0;37;0
|
|
WireConnection;14;1;27;0
|
|
WireConnection;39;0;58;0
|
|
WireConnection;39;1;95;0
|
|
WireConnection;30;0;13;0
|
|
WireConnection;30;1;14;0
|
|
WireConnection;30;2;31;0
|
|
WireConnection;30;3;32;0
|
|
WireConnection;54;0;30;0
|
|
WireConnection;96;0;39;0
|
|
WireConnection;41;0;54;0
|
|
WireConnection;41;1;96;0
|
|
WireConnection;60;0;13;4
|
|
WireConnection;60;1;14;4
|
|
WireConnection;60;2;31;4
|
|
WireConnection;60;3;32;4
|
|
WireConnection;84;0;54;0
|
|
WireConnection;84;1;41;0
|
|
WireConnection;51;0;84;0
|
|
WireConnection;51;1;52;0
|
|
WireConnection;61;0;60;0
|
|
WireConnection;61;1;62;0
|
|
WireConnection;81;1;51;0
|
|
WireConnection;76;0;75;0
|
|
WireConnection;72;0;71;0
|
|
WireConnection;72;1;73;0
|
|
WireConnection;75;0;74;0
|
|
WireConnection;75;1;72;0
|
|
WireConnection;77;0;76;0
|
|
WireConnection;77;2;74;0
|
|
WireConnection;78;0;79;0
|
|
WireConnection;78;1;77;0
|
|
WireConnection;78;2;80;0
|
|
WireConnection;98;0;51;0
|
|
WireConnection;98;3;61;0
|
|
WireConnection;70;0;69;0
|
|
WireConnection;70;3;69;3
|
|
WireConnection;71;0;68;1
|
|
WireConnection;71;1;70;0
|
|
WireConnection;93;0;98;0
|
|
ASEEND*/
|
|
//CHKSM=8994500FCA1FD36437AD1C761168523F835D666E |