206 lines
13 KiB
Plaintext
206 lines
13 KiB
Plaintext
// Made with Amplify Shader Editor
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "JDJ/Effect_mask_add"
|
|
{
|
|
Properties
|
|
{
|
|
_liandu("亮度", Float) = 0
|
|
_Color("颜色", Color) = (1,1,1,1)
|
|
[Toggle(_DESATURATESWITCH_ON)] _DesaturateSwitch("去色开关", Float) = 0
|
|
_DesaturateIntensity("去色强度", Range( 0 , 1)) = 1
|
|
_Maintex("颜色贴图", 2D) = "white" {}
|
|
_MaintexUV("颜色贴图UV动画", Vector) = (0,0,0,0)
|
|
_MaintexRotrtor("旋转颜色贴图", Range( 0 , 360)) = 0
|
|
_MaintexRotrtorSpeed("颜色贴图自动旋转", Float) = 0
|
|
[Toggle(_MASKSWITCH_ON)] _MaskSwitch("遮罩开关", Float) = 0
|
|
_Masktex("遮罩贴图", 2D) = "white" {}
|
|
_MaskIntensity("遮罩强度", Float) = 3
|
|
_MaskRotator("旋转遮罩贴图", Range( 0 , 360)) = 0
|
|
_MaskUV("遮罩贴图UV动画", Vector) = (0,0,0,0)
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
[HideInInspector] __dirty( "", Int ) = 1
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
Tags{ "RenderType" = "TransparentCutout" "Queue" = "Transparent+0" "ForceNoShadowCasting" = "True" "IsEmissive" = "true" }
|
|
Cull Off
|
|
ZWrite Off
|
|
Blend One One
|
|
|
|
CGPROGRAM
|
|
#include "UnityPBSLighting.cginc"
|
|
#include "UnityShaderVariables.cginc"
|
|
#pragma target 3.0
|
|
#pragma multi_compile_instancing
|
|
#pragma shader_feature _DESATURATESWITCH_ON
|
|
#pragma shader_feature _MASKSWITCH_ON
|
|
#pragma surface surf StandardCustomLighting keepalpha noshadow noambient novertexlights nolightmap nodynlightmap nodirlightmap nofog nometa noforwardadd
|
|
struct Input
|
|
{
|
|
half2 uv_texcoord;
|
|
float4 vertexColor : COLOR;
|
|
};
|
|
|
|
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 _Maintex_ST;
|
|
uniform half2 _MaintexUV;
|
|
uniform half _MaintexRotrtor;
|
|
uniform half _MaintexRotrtorSpeed;
|
|
uniform half _DesaturateIntensity;
|
|
uniform half4 _Color;
|
|
uniform half _liandu;
|
|
uniform sampler2D _Masktex;
|
|
uniform float4 _Masktex_ST;
|
|
uniform half2 _MaskUV;
|
|
uniform half _MaskRotator;
|
|
uniform half _MaskIntensity;
|
|
|
|
inline half4 LightingStandardCustomLighting( inout SurfaceOutputCustomLightingCustom s, half3 viewDir, UnityGI gi )
|
|
{
|
|
UnityGIInput data = s.GIData;
|
|
Input i = s.SurfInput;
|
|
half4 c = 0;
|
|
c.rgb = 0;
|
|
c.a = 1;
|
|
return c;
|
|
}
|
|
|
|
inline void LightingStandardCustomLighting_GI( inout SurfaceOutputCustomLightingCustom s, UnityGIInput data, inout UnityGI gi )
|
|
{
|
|
s.GIData = data;
|
|
}
|
|
|
|
void surf( Input i , inout SurfaceOutputCustomLightingCustom o )
|
|
{
|
|
o.SurfInput = i;
|
|
float2 uv0_Maintex = i.uv_texcoord * _Maintex_ST.xy + _Maintex_ST.zw;
|
|
float cos13 = cos( ( ( (0.0 + (_MaintexRotrtor - 0.0) * (2.0 - 0.0) / (360.0 - 0.0)) * UNITY_PI ) + ( _Time.y * _MaintexRotrtorSpeed ) ) );
|
|
float sin13 = sin( ( ( (0.0 + (_MaintexRotrtor - 0.0) * (2.0 - 0.0) / (360.0 - 0.0)) * UNITY_PI ) + ( _Time.y * _MaintexRotrtorSpeed ) ) );
|
|
float2 rotator13 = mul( ( uv0_Maintex + ( _MaintexUV * _Time.y ) ) - float2( 0.5,0.5 ) , float2x2( cos13 , -sin13 , sin13 , cos13 )) + float2( 0.5,0.5 );
|
|
half4 tex2DNode14 = tex2D( _Maintex, rotator13 );
|
|
float3 desaturateInitialColor24 = tex2DNode14.rgb;
|
|
float desaturateDot24 = dot( desaturateInitialColor24, float3( 0.299, 0.587, 0.114 ));
|
|
float3 desaturateVar24 = lerp( desaturateInitialColor24, desaturateDot24.xxx, _DesaturateIntensity );
|
|
#ifdef _DESATURATESWITCH_ON
|
|
float4 staticSwitch22 = half4( desaturateVar24 , 0.0 );
|
|
#else
|
|
float4 staticSwitch22 = tex2DNode14;
|
|
#endif
|
|
float temp_output_41_0 = ( tex2DNode14.a * i.vertexColor.a * _Color.a );
|
|
float2 uv0_Masktex = i.uv_texcoord * _Masktex_ST.xy + _Masktex_ST.zw;
|
|
float cos30 = cos( ( (0.0 + (_MaskRotator - 0.0) * (2.0 - 0.0) / (360.0 - 0.0)) * UNITY_PI ) );
|
|
float sin30 = sin( ( (0.0 + (_MaskRotator - 0.0) * (2.0 - 0.0) / (360.0 - 0.0)) * UNITY_PI ) );
|
|
float2 rotator30 = mul( ( uv0_Masktex + ( _MaskUV * _Time.y ) ) - float2( 0,0 ) , float2x2( cos30 , -sin30 , sin30 , cos30 )) + float2( 0,0 );
|
|
#ifdef _MASKSWITCH_ON
|
|
float staticSwitch42 = ( temp_output_41_0 * pow( tex2D( _Masktex, rotator30 ).r , _MaskIntensity ) * i.vertexColor.a );
|
|
#else
|
|
float staticSwitch42 = temp_output_41_0;
|
|
#endif
|
|
o.Emission = ( ( staticSwitch22 * _Color * _Color.a ) * i.vertexColor * _liandu * staticSwitch42 ).rgb;
|
|
}
|
|
|
|
ENDCG
|
|
}
|
|
Fallback "Legacy Shaders/Diffuse"
|
|
CustomEditor "ASEMaterialInspector"
|
|
}
|
|
/*ASEBEGIN
|
|
Version=16800
|
|
204;149;1603;803;1153.667;462.5426;1.3;True;True
|
|
Node;AmplifyShaderEditor.RangedFloatNode;2;-2472.932,-458.3415;Half;False;Property;_MaintexRotrtor;MaintexRotrtor;7;0;Create;True;0;0;False;0;0;0;0;360;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector2Node;9;-2080.5,-654.1526;Half;False;Property;_MaintexUV;MaintexUV;6;0;Create;True;0;0;False;0;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.RangedFloatNode;7;-2018.202,-296.6201;Half;False;Property;_MaintexRotrtorSpeed;MaintexRotrtorSpeed;8;0;Create;True;0;0;False;0;0;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TFHCRemapNode;5;-2181.834,-453.08;Float;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;360;False;3;FLOAT;0;False;4;FLOAT;2;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleTimeNode;3;-2082.035,-529.3799;Float;False;1;0;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleTimeNode;44;-1945.243,175.0149;Float;False;1;0;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector2Node;43;-1887.09,39.85474;Float;False;Property;_MaskUV;MaskUV;13;0;Create;True;0;0;False;0;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.RangedFloatNode;32;-2033.616,273.1092;Half;False;Property;_MaskRotator;MaskRotator;12;0;Create;True;0;0;False;0;0;0;0;360;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;1;-1883.417,-759.2157;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.SimpleMultiplyOpNode;18;-1738.575,-434.8538;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.PiNode;4;-1967.921,-450.8731;Float;False;1;0;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;10;-1786.9,-604.4524;Float;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;31;-2010.461,-128.152;Float;False;0;29;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.TFHCRemapNode;33;-1742.518,278.3707;Float;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;360;False;3;FLOAT;0;False;4;FLOAT;2;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;46;-1642.255,85.80054;Float;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.PiNode;34;-1528.603,280.5776;Float;False;1;0;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;47;-1452.863,27.64093;Float;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;11;-1537.699,-664.7527;Float;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;21;-1532.575,-500.8538;Float;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RotatorNode;13;-1312.798,-627.0526;Float;True;3;0;FLOAT2;0,0;False;1;FLOAT2;0.5,0.5;False;2;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.RotatorNode;30;-1283.121,101.1239;Float;False;3;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;2;FLOAT;1;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.VertexColorNode;36;-951.8115,-334.7639;Float;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.RangedFloatNode;25;-975.1449,-435.3;Half;False;Property;_DesaturateIntensity;DesaturateIntensity;4;0;Create;True;0;0;False;0;1;1;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SamplerNode;29;-987.7012,-78.4798;Float;True;Property;_Masktex;Masktex;10;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.RangedFloatNode;39;-883.8806,145.3345;Half;False;Property;_MaskIntensity;MaskIntensity;11;0;Create;True;0;0;False;0;3;3;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SamplerNode;14;-996.8989,-623.1523;Float;True;Property;_Maintex;Maintex;5;0;Create;True;0;0;False;0;None;96205a4b927fb0c4bad8f5ed1133e46c;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.ColorNode;27;-358.4877,-536.4235;Half;False;Property;_Color;Color;2;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;41;-47.48853,-289.956;Float;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.DesaturateOpNode;24;-650.8376,-553.6996;Float;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.PowerNode;38;-567.2813,-22.77946;Float;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;40;117.5115,-94.95615;Float;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.StaticSwitch;22;-426.3322,-652.6002;Float;False;Property;_DesaturateSwitch;DesaturateSwitch;3;0;Create;True;0;0;False;0;0;0;0;True;;Toggle;2;Key0;Key1;Create;False;9;1;COLOR;0,0,0,0;False;0;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;4;COLOR;0,0,0,0;False;5;COLOR;0,0,0,0;False;6;COLOR;0,0,0,0;False;7;COLOR;0,0,0,0;False;8;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.StaticSwitch;42;264.7114,-218.4558;Float;False;Property;_MaskSwitch;MaskSwitch;9;0;Create;True;0;0;False;0;0;0;0;True;;Toggle;2;Key0;Key1;Create;False;9;1;FLOAT;0;False;0;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;37;184.66,-605.674;Half;False;Property;_liandu;liandu;0;0;Create;True;0;0;False;0;0;1;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;28;-72.96472,-542.6221;Float;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;35;488.5884,-471.2642;Float;False;4;4;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;701.2965,-558.3419;Half;False;True;2;Half;ASEMaterialInspector;0;0;CustomLighting;JDJ/Effect_mask_add;False;False;False;False;True;True;True;True;True;True;True;True;False;False;False;True;True;False;False;False;False;Off;2;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Custom;0.5;True;False;0;True;TransparentCutout;;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;4;1;False;-1;1;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;Legacy Shaders/Diffuse;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;5;0;2;0
|
|
WireConnection;18;0;3;0
|
|
WireConnection;18;1;7;0
|
|
WireConnection;4;0;5;0
|
|
WireConnection;10;0;9;0
|
|
WireConnection;10;1;3;0
|
|
WireConnection;33;0;32;0
|
|
WireConnection;46;0;43;0
|
|
WireConnection;46;1;44;0
|
|
WireConnection;34;0;33;0
|
|
WireConnection;47;0;31;0
|
|
WireConnection;47;1;46;0
|
|
WireConnection;11;0;1;0
|
|
WireConnection;11;1;10;0
|
|
WireConnection;21;0;4;0
|
|
WireConnection;21;1;18;0
|
|
WireConnection;13;0;11;0
|
|
WireConnection;13;2;21;0
|
|
WireConnection;30;0;47;0
|
|
WireConnection;30;2;34;0
|
|
WireConnection;29;1;30;0
|
|
WireConnection;14;1;13;0
|
|
WireConnection;41;0;14;4
|
|
WireConnection;41;1;36;4
|
|
WireConnection;41;2;27;4
|
|
WireConnection;24;0;14;0
|
|
WireConnection;24;1;25;0
|
|
WireConnection;38;0;29;1
|
|
WireConnection;38;1;39;0
|
|
WireConnection;40;0;41;0
|
|
WireConnection;40;1;38;0
|
|
WireConnection;40;2;36;4
|
|
WireConnection;22;1;14;0
|
|
WireConnection;22;0;24;0
|
|
WireConnection;42;1;41;0
|
|
WireConnection;42;0;40;0
|
|
WireConnection;28;0;22;0
|
|
WireConnection;28;1;27;0
|
|
WireConnection;28;2;27;4
|
|
WireConnection;35;0;28;0
|
|
WireConnection;35;1;36;0
|
|
WireConnection;35;2;37;0
|
|
WireConnection;35;3;42;0
|
|
WireConnection;0;2;35;0
|
|
ASEEND*/
|
|
//CHKSM=DE663947D784250C70CA2E42D6C7A589F3733210 |