213 lines
13 KiB
Plaintext
213 lines
13 KiB
Plaintext
// Made with Amplify Shader Editor
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "Hovl/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)
|
|
_Opacity("Opacity", Range( 0 , 1)) = 1
|
|
_LightFalloff("Light Falloff", Float) = 0.5
|
|
_LightRange("Light Range", Float) = 2
|
|
_LightEmission("Light Emission", Float) = 2
|
|
[Toggle]_Usedepth("Use depth?", Float) = 0
|
|
_Depthpower("Depth power", Float) = 1
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
[HideInInspector] __dirty( "", Int ) = 1
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" "IsEmissive" = "true" }
|
|
Cull Off
|
|
CGPROGRAM
|
|
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
|
|
#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
|
|
#endif
|
|
#include "UnityPBSLighting.cginc"
|
|
#include "UnityShaderVariables.cginc"
|
|
#include "UnityCG.cginc"
|
|
#pragma target 3.0
|
|
#pragma surface surf StandardCustomLighting alpha:fade keepalpha noshadow
|
|
struct Input
|
|
{
|
|
float2 uv_texcoord;
|
|
float4 vertexColor : COLOR;
|
|
float4 screenPos;
|
|
float3 worldPos;
|
|
};
|
|
|
|
struct SurfaceOutputCustomLightingCustom
|
|
{
|
|
half3 Albedo;
|
|
half3 Normal;
|
|
half3 Emission;
|
|
half Metallic;
|
|
half Smoothness;
|
|
half Occlusion;
|
|
half Alpha;
|
|
Input SurfInput;
|
|
UnityGIInput GIData;
|
|
};
|
|
|
|
uniform sampler2D _MainTex;
|
|
uniform float4 _SpeedMainTexUVNoiseZW;
|
|
uniform float4 _MainTex_ST;
|
|
uniform sampler2D _Noise;
|
|
uniform float4 _Noise_ST;
|
|
uniform float4 _Color;
|
|
uniform float _Emission;
|
|
uniform float _Usedepth;
|
|
UNITY_DECLARE_DEPTH_TEXTURE( _CameraDepthTexture );
|
|
uniform float4 _CameraDepthTexture_TexelSize;
|
|
uniform float _Depthpower;
|
|
uniform float _Opacity;
|
|
uniform float _LightRange;
|
|
uniform float _LightFalloff;
|
|
uniform float _LightEmission;
|
|
|
|
inline half4 LightingStandardCustomLighting( inout SurfaceOutputCustomLightingCustom s, half3 viewDir, UnityGI gi )
|
|
{
|
|
UnityGIInput data = s.GIData;
|
|
Input i = s.SurfInput;
|
|
half4 c = 0;
|
|
float2 appendResult21 = (float2(_SpeedMainTexUVNoiseZW.x , _SpeedMainTexUVNoiseZW.y));
|
|
float2 uv0_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
|
|
float4 tex2DNode13 = tex2D( _MainTex, ( ( appendResult21 * _Time.y ) + uv0_MainTex ) );
|
|
float2 uv0_Noise = i.uv_texcoord * _Noise_ST.xy + _Noise_ST.zw;
|
|
float2 appendResult22 = (float2(_SpeedMainTexUVNoiseZW.z , _SpeedMainTexUVNoiseZW.w));
|
|
float4 tex2DNode14 = tex2D( _Noise, ( uv0_Noise + ( _Time.y * appendResult22 ) ) );
|
|
float temp_output_60_0 = ( tex2DNode13.a * tex2DNode14.a * _Color.a * i.vertexColor.a );
|
|
float4 ase_screenPos = float4( i.screenPos.xyz , i.screenPos.w + 0.00000000001 );
|
|
float4 ase_screenPosNorm = ase_screenPos / ase_screenPos.w;
|
|
ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
|
|
float screenDepth91 = LinearEyeDepth(SAMPLE_DEPTH_TEXTURE( _CameraDepthTexture, ase_screenPosNorm.xy ));
|
|
float distanceDepth91 = abs( ( screenDepth91 - LinearEyeDepth( ase_screenPosNorm.z ) ) / ( _Depthpower ) );
|
|
#if defined(LIGHTMAP_ON) && ( UNITY_VERSION < 560 || ( defined(LIGHTMAP_SHADOW_MIXING) && !defined(SHADOWS_SHADOWMASK) && defined(SHADOWS_SCREEN) ) )//aselc
|
|
float4 ase_lightColor = 0;
|
|
#else //aselc
|
|
float4 ase_lightColor = _LightColor0;
|
|
#endif //aselc
|
|
float4 ase_vertex4Pos = mul( unity_WorldToObject, float4( i.worldPos , 1 ) );
|
|
c.rgb = ( ase_lightColor * (0.0 + (max( ( _LightRange - pow( distance( float4( _WorldSpaceLightPos0.xyz , 0.0 ) , ase_vertex4Pos ) , _LightFalloff ) ) , 0.0 ) - 0.0) * (1.0 - 0.0) / (_LightRange - 0.0)) * _LightEmission ).rgb;
|
|
c.a = ( lerp(temp_output_60_0,( temp_output_60_0 * saturate( distanceDepth91 ) ),_Usedepth) * _Opacity );
|
|
return c;
|
|
}
|
|
|
|
inline void LightingStandardCustomLighting_GI( inout SurfaceOutputCustomLightingCustom s, UnityGIInput data, inout UnityGI gi )
|
|
{
|
|
s.GIData = data;
|
|
}
|
|
|
|
void surf( Input i , inout SurfaceOutputCustomLightingCustom o )
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID( i );
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( i );
|
|
o.SurfInput = i;
|
|
float2 appendResult21 = (float2(_SpeedMainTexUVNoiseZW.x , _SpeedMainTexUVNoiseZW.y));
|
|
float2 uv0_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
|
|
float4 tex2DNode13 = tex2D( _MainTex, ( ( appendResult21 * _Time.y ) + uv0_MainTex ) );
|
|
float2 uv0_Noise = i.uv_texcoord * _Noise_ST.xy + _Noise_ST.zw;
|
|
float2 appendResult22 = (float2(_SpeedMainTexUVNoiseZW.z , _SpeedMainTexUVNoiseZW.w));
|
|
float4 tex2DNode14 = tex2D( _Noise, ( uv0_Noise + ( _Time.y * appendResult22 ) ) );
|
|
o.Emission = ( (( tex2DNode13 * tex2DNode14 * _Color * i.vertexColor )).rgb * _Emission );
|
|
}
|
|
|
|
ENDCG
|
|
}
|
|
}
|
|
/*ASEBEGIN
|
|
Version=17000
|
|
165;194;1326;839;1344.195;123.8034;1;True;False
|
|
Node;AmplifyShaderEditor.Vector4Node;15;-2810.396,131.8803;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;-2448.991,69.81263;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;-2478.874,160.4428;Float;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;22;-2446.45,292.092;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.SimpleMultiplyOpNode;24;-2232.318,71.15379;Float;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.WorldSpaceLightPos;68;-918.2552,-98.22426;Float;False;0;3;FLOAT4;0;FLOAT3;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.PosVertexDataNode;96;-873.1953,-0.8034363;Float;False;1;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;82;-2081.909,262.6832;Float;False;0;14;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.TextureCoordinatesNode;83;-2085.15,138.0949;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.SimpleMultiplyOpNode;23;-2232.875,379.9315;Float;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;90;-1066.599,835.4142;Float;False;Property;_Depthpower;Depth power;10;0;Create;True;0;0;False;0;1;1;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.DistanceOpNode;71;-657.5163,-79.02029;Float;False;2;0;FLOAT3;0,0,0;False;1;FLOAT4;0,0,0,0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;26;-1841.848,67.68987;Float;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;27;-1807.908,363.8024;Float;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;73;-656.4827,35.03231;Float;False;Property;_LightFalloff;Light Falloff;6;0;Create;True;0;0;False;0;0.5;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;74;-475.4758,-155.0521;Float;False;Property;_LightRange;Light Range;7;0;Create;True;0;0;False;0;2;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SamplerNode;14;-1511.172,226.2754;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.VertexColorNode;32;-1377.205,593.1118;Float;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.PowerNode;72;-464.3577,-57.58532;Float;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SamplerNode;13;-1509.785,40.83811;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.DepthFade;91;-855.554,779.9915;Float;False;True;False;True;2;1;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ColorNode;31;-1435.205,423.1118;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.SimpleMultiplyOpNode;60;-636.2719,433.2454;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.SaturateNode;95;-584.7843,672.3278;Float;False;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleSubtractOpNode;75;-299.0228,-71.97218;Float;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;30;-830.4134,181.5917;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.SimpleMultiplyOpNode;93;-419.1616,560.3955;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMaxOpNode;76;-142.4472,-71.16853;Float;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;62;-119.2192,570.4644;Float;False;Property;_Opacity;Opacity;5;0;Create;True;0;0;False;0;1;1;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;80;29.0605,90.08022;Float;False;Property;_LightEmission;Light Emission;8;0;Create;True;0;0;False;0;2;2;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ComponentMaskNode;54;-638.2562,169.7882;Float;False;True;True;True;False;1;0;COLOR;0,0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;52;16.44016,286.3999;Float;False;Property;_Emission;Emission;3;0;Create;True;0;0;False;0;2;2;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TFHCRemapNode;77;33.44911,-70.87257;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.ToggleSwitchNode;94;-165.7123,436.4895;Float;False;Property;_Usedepth;Use depth?;9;0;Create;True;0;0;False;0;0;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.LightColorNode;79;51.0605,-198.9199;Float;False;0;3;COLOR;0;FLOAT3;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;61;262.643,402.9155;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;78;260.0603,-87.91986;Float;False;3;3;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;51;252.44,190.3999;Float;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;89;912.1331,65.57289;Float;False;True;2;Float;;0;0;CustomLighting;Hovl/Particles/LightGlow;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;False;False;False;Off;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Transparent;0.5;True;False;0;False;Transparent;;Transparent;All;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;False;2;5;False;-1;10;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT3;0,0,0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;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;24;0;21;0
|
|
WireConnection;24;1;17;2
|
|
WireConnection;23;0;17;2
|
|
WireConnection;23;1;22;0
|
|
WireConnection;71;0;68;1
|
|
WireConnection;71;1;96;0
|
|
WireConnection;26;0;24;0
|
|
WireConnection;26;1;83;0
|
|
WireConnection;27;0;82;0
|
|
WireConnection;27;1;23;0
|
|
WireConnection;14;1;27;0
|
|
WireConnection;72;0;71;0
|
|
WireConnection;72;1;73;0
|
|
WireConnection;13;1;26;0
|
|
WireConnection;91;0;90;0
|
|
WireConnection;60;0;13;4
|
|
WireConnection;60;1;14;4
|
|
WireConnection;60;2;31;4
|
|
WireConnection;60;3;32;4
|
|
WireConnection;95;0;91;0
|
|
WireConnection;75;0;74;0
|
|
WireConnection;75;1;72;0
|
|
WireConnection;30;0;13;0
|
|
WireConnection;30;1;14;0
|
|
WireConnection;30;2;31;0
|
|
WireConnection;30;3;32;0
|
|
WireConnection;93;0;60;0
|
|
WireConnection;93;1;95;0
|
|
WireConnection;76;0;75;0
|
|
WireConnection;54;0;30;0
|
|
WireConnection;77;0;76;0
|
|
WireConnection;77;2;74;0
|
|
WireConnection;94;0;60;0
|
|
WireConnection;94;1;93;0
|
|
WireConnection;61;0;94;0
|
|
WireConnection;61;1;62;0
|
|
WireConnection;78;0;79;0
|
|
WireConnection;78;1;77;0
|
|
WireConnection;78;2;80;0
|
|
WireConnection;51;0;54;0
|
|
WireConnection;51;1;52;0
|
|
WireConnection;89;2;51;0
|
|
WireConnection;89;9;61;0
|
|
WireConnection;89;13;78;0
|
|
ASEEND*/
|
|
//CHKSM=349C4477CD22C7260745BEF6630FCE22EDDACB07 |