123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- // Made with Amplify Shader Editor
- // Available at the Unity Asset Store - http://u3d.as/y3X
- Shader "Knife/Soft Holo Cone"
- {
- Properties
- {
- _Softness("Softness", Range( 0 , 1)) = 0
- [HDR]_Color("Color", Color) = (0,0,0,0)
- _Mask("Mask", 2D) = "white" {}
- _DepthFadeDistance("DepthFadeDistance", Float) = 0
- _MaskSoftness("MaskSoftness", Range( 0 , 1)) = 0
- _MaskSoftness2("MaskSoftness 2", Range( 0 , 1)) = 0
- _Mask2("Mask 2", 2D) = "white" {}
- _Mask2Speed("Mask2Speed", Vector) = (0,0,0,0)
- _Alpha("Alpha", Range( 0 , 1)) = 1
- [HideInInspector] _texcoord( "", 2D ) = "white" {}
- [HideInInspector] __dirty( "", Int ) = 1
- }
- SubShader
- {
- Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" "IsEmissive" = "true" }
- Cull Off
- CGINCLUDE
- #include "UnityShaderVariables.cginc"
- #include "UnityCG.cginc"
- #include "UnityPBSLighting.cginc"
- #include "Lighting.cginc"
- #pragma target 3.0
- struct Input
- {
- float2 uv_texcoord;
- float3 worldNormal;
- float3 viewDir;
- float4 screenPos;
- };
- uniform float4 _Color;
- uniform float _MaskSoftness2;
- uniform sampler2D _Mask2;
- uniform float2 _Mask2Speed;
- uniform float4 _Mask2_ST;
- uniform float _MaskSoftness;
- uniform sampler2D _Mask;
- uniform float4 _Mask_ST;
- uniform float _Softness;
- UNITY_DECLARE_DEPTH_TEXTURE( _CameraDepthTexture );
- uniform float4 _CameraDepthTexture_TexelSize;
- uniform float _DepthFadeDistance;
- uniform float _Alpha;
- inline half4 LightingUnlit( SurfaceOutput s, half3 lightDir, half atten )
- {
- return half4 ( 0, 0, 0, s.Alpha );
- }
- void surf( Input i , inout SurfaceOutput o )
- {
- o.Emission = _Color.rgb;
- float2 uv0_Mask2 = i.uv_texcoord * _Mask2_ST.xy + _Mask2_ST.zw;
- float2 panner25 = ( 1.0 * _Time.y * _Mask2Speed + uv0_Mask2);
- float smoothstepResult23 = smoothstep( 0.0 , _MaskSoftness2 , tex2D( _Mask2, panner25 ).r);
- float2 uv_Mask = i.uv_texcoord * _Mask_ST.xy + _Mask_ST.zw;
- float smoothstepResult19 = smoothstep( 0.0 , _MaskSoftness , tex2D( _Mask, uv_Mask ).r);
- float3 ase_worldNormal = i.worldNormal;
- float dotResult4 = dot( ase_worldNormal , i.viewDir );
- float smoothstepResult7 = smoothstep( 0.0 , _Softness , abs( dotResult4 ));
- 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 screenDepth16 = LinearEyeDepth(SAMPLE_DEPTH_TEXTURE( _CameraDepthTexture, ase_screenPosNorm.xy ));
- float distanceDepth16 = abs( ( screenDepth16 - LinearEyeDepth( ase_screenPosNorm.z ) ) / ( _DepthFadeDistance ) );
- float clampResult18 = clamp( distanceDepth16 , 0.0 , 1.0 );
- o.Alpha = ( ( smoothstepResult23 * smoothstepResult19 * _Color.a ) * smoothstepResult7 * clampResult18 * _Alpha );
- }
- ENDCG
- CGPROGRAM
- #pragma surface surf Unlit alpha:fade keepalpha fullforwardshadows
- ENDCG
- Pass
- {
- Name "ShadowCaster"
- Tags{ "LightMode" = "ShadowCaster" }
- ZWrite On
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #pragma target 3.0
- #pragma multi_compile_shadowcaster
- #pragma multi_compile UNITY_PASS_SHADOWCASTER
- #pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2
- #include "HLSLSupport.cginc"
- #if ( SHADER_API_D3D11 || SHADER_API_GLCORE || SHADER_API_GLES || SHADER_API_GLES3 || SHADER_API_METAL || SHADER_API_VULKAN )
- #define CAN_SKIP_VPOS
- #endif
- #include "UnityCG.cginc"
- #include "Lighting.cginc"
- #include "UnityPBSLighting.cginc"
- sampler3D _DitherMaskLOD;
- struct v2f
- {
- V2F_SHADOW_CASTER;
- float2 customPack1 : TEXCOORD1;
- float3 worldPos : TEXCOORD2;
- float4 screenPos : TEXCOORD3;
- float3 worldNormal : TEXCOORD4;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- UNITY_VERTEX_OUTPUT_STEREO
- };
- v2f vert( appdata_full v )
- {
- v2f o;
- UNITY_SETUP_INSTANCE_ID( v );
- UNITY_INITIALIZE_OUTPUT( v2f, o );
- UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
- UNITY_TRANSFER_INSTANCE_ID( v, o );
- Input customInputData;
- float3 worldPos = mul( unity_ObjectToWorld, v.vertex ).xyz;
- half3 worldNormal = UnityObjectToWorldNormal( v.normal );
- o.worldNormal = worldNormal;
- o.customPack1.xy = customInputData.uv_texcoord;
- o.customPack1.xy = v.texcoord;
- o.worldPos = worldPos;
- TRANSFER_SHADOW_CASTER_NORMALOFFSET( o )
- o.screenPos = ComputeScreenPos( o.pos );
- return o;
- }
- half4 frag( v2f IN
- #if !defined( CAN_SKIP_VPOS )
- , UNITY_VPOS_TYPE vpos : VPOS
- #endif
- ) : SV_Target
- {
- UNITY_SETUP_INSTANCE_ID( IN );
- Input surfIN;
- UNITY_INITIALIZE_OUTPUT( Input, surfIN );
- surfIN.uv_texcoord = IN.customPack1.xy;
- float3 worldPos = IN.worldPos;
- half3 worldViewDir = normalize( UnityWorldSpaceViewDir( worldPos ) );
- surfIN.viewDir = worldViewDir;
- surfIN.worldNormal = IN.worldNormal;
- surfIN.screenPos = IN.screenPos;
- SurfaceOutput o;
- UNITY_INITIALIZE_OUTPUT( SurfaceOutput, o )
- surf( surfIN, o );
- #if defined( CAN_SKIP_VPOS )
- float2 vpos = IN.pos;
- #endif
- half alphaRef = tex3D( _DitherMaskLOD, float3( vpos.xy * 0.25, o.Alpha * 0.9375 ) ).a;
- clip( alphaRef - 0.01 );
- SHADOW_CASTER_FRAGMENT( IN )
- }
- ENDCG
- }
- }
- Fallback "Diffuse"
- CustomEditor "ASEMaterialInspector"
- }
- /*ASEBEGIN
- Version=18100
- -1920;0;1920;1018;1398.417;23.88959;1;True;False
- Node;AmplifyShaderEditor.Vector2Node;26;-1731.5,-340.5;Inherit;False;Property;_Mask2Speed;Mask2Speed;7;0;Create;True;0;0;False;0;False;0,0;0,0.1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
- Node;AmplifyShaderEditor.TextureCoordinatesNode;24;-1796.5,-491.5;Inherit;False;0;21;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.ViewDirInputsCoordNode;2;-1073.5,459.5;Inherit;False;World;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
- Node;AmplifyShaderEditor.WorldNormalVector;3;-1099.5,281.5;Inherit;False;False;1;0;FLOAT3;0,0,1;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
- Node;AmplifyShaderEditor.PannerNode;25;-1456.5,-563.5;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
- Node;AmplifyShaderEditor.RangedFloatNode;20;-900.5,46.5;Inherit;False;Property;_MaskSoftness;MaskSoftness;4;0;Create;True;0;0;False;0;False;0;0.897;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SamplerNode;13;-860.5,-201.5;Inherit;True;Property;_Mask;Mask;2;0;Create;True;0;0;False;0;False;-1;None;c6504c94fed70cf49a38669fda63c389;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.DotProductOpNode;4;-865.5,326.5;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;17;-823.5,898.5;Inherit;False;Property;_DepthFadeDistance;DepthFadeDistance;3;0;Create;True;0;0;False;0;False;0;0.5;0;0;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SamplerNode;21;-897.5,-561.5;Inherit;True;Property;_Mask2;Mask 2;6;0;Create;True;0;0;False;0;False;-1;None;f1d1e317c910b2a49a88762d16bfc211;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.RangedFloatNode;22;-864.5,-356.5;Inherit;False;Property;_MaskSoftness2;MaskSoftness 2;5;0;Create;True;0;0;False;0;False;0;1;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.AbsOpNode;15;-705.5,300.5;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.DepthFade;16;-622.5,806.5;Inherit;False;True;False;True;2;1;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.ColorNode;11;-627.5,13.5;Inherit;False;Property;_Color;Color;1;1;[HDR];Create;True;0;0;False;0;False;0,0,0,0;0.4139633,0.8850594,1.976675,0.6431373;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.SmoothstepOpNode;19;-518.5,-124.5;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;8;-735.5,658.5;Inherit;False;Property;_Softness;Softness;0;0;Create;True;0;0;False;0;False;0;1;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SmoothstepOpNode;23;-544.5,-434.5;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SmoothstepOpNode;7;-444.5,457.5;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.ClampOpNode;18;-363.5,806.5;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;14;-270.5,88.5;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;27;-363.417,613.1104;Inherit;False;Property;_Alpha;Alpha;8;0;Create;True;0;0;False;0;False;1;1;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;12;-265.5,445.5;Inherit;False;4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.StandardSurfaceOutputNode;10;139,211;Float;False;True;-1;2;ASEMaterialInspector;0;0;Unlit;Knife/Soft Holo Cone;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;True;0;False;Transparent;;Transparent;All;14;all;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;True;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;FLOAT;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;25;0;24;0
- WireConnection;25;2;26;0
- WireConnection;4;0;3;0
- WireConnection;4;1;2;0
- WireConnection;21;1;25;0
- WireConnection;15;0;4;0
- WireConnection;16;0;17;0
- WireConnection;19;0;13;1
- WireConnection;19;2;20;0
- WireConnection;23;0;21;1
- WireConnection;23;2;22;0
- WireConnection;7;0;15;0
- WireConnection;7;2;8;0
- WireConnection;18;0;16;0
- WireConnection;14;0;23;0
- WireConnection;14;1;19;0
- WireConnection;14;2;11;4
- WireConnection;12;0;14;0
- WireConnection;12;1;7;0
- WireConnection;12;2;18;0
- WireConnection;12;3;27;0
- WireConnection;10;2;11;0
- WireConnection;10;9;12;0
- ASEEND*/
- //CHKSM=39BA58FFC26ABFAA7087C0ED7B2E07687730C814
|