173 lines
No EOL
8.7 KiB
Text
Executable file
173 lines
No EOL
8.7 KiB
Text
Executable file
// Made with Amplify Shader Editor v1.9.1.8
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "Alpha Blend Interactive/Mobile/General Transparent"
|
|
{
|
|
Properties
|
|
{
|
|
_Albedo("Albedo", 2D) = "white" {}
|
|
_Color("Color", Color) = (1,1,1,1)
|
|
_Normal("Normal", 2D) = "bump" {}
|
|
_NormalStrength("Normal Strength", Float) = 1
|
|
_EmissionMap("Emission Map", 2D) = "white" {}
|
|
[HDR]_EmissionColor("Emission Color", Color) = (0,0,0,0)
|
|
_SpecColor("Specular Color",Color)=(1,1,1,1)
|
|
_Specular("Specular", Range( 0.001 , 1)) = 1
|
|
_Gloss("Gloss", Range( 0 , 1)) = 0
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
[HideInInspector] __dirty( "", Int ) = 1
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" "IsEmissive" = "true" }
|
|
Cull Back
|
|
CGINCLUDE
|
|
#include "UnityStandardUtils.cginc"
|
|
#include "UnityPBSLighting.cginc"
|
|
#include "Lighting.cginc"
|
|
#pragma target 3.0
|
|
struct Input
|
|
{
|
|
float2 uv_texcoord;
|
|
};
|
|
|
|
uniform sampler2D _Normal;
|
|
uniform float4 _Normal_ST;
|
|
uniform float _NormalStrength;
|
|
uniform sampler2D _Albedo;
|
|
uniform float4 _Albedo_ST;
|
|
uniform float4 _Color;
|
|
uniform sampler2D _EmissionMap;
|
|
uniform float4 _EmissionMap_ST;
|
|
uniform float4 _EmissionColor;
|
|
uniform float _Specular;
|
|
uniform float _Gloss;
|
|
|
|
void surf( Input i , inout SurfaceOutput o )
|
|
{
|
|
float2 uv_Normal = i.uv_texcoord * _Normal_ST.xy + _Normal_ST.zw;
|
|
o.Normal = UnpackScaleNormal( tex2D( _Normal, uv_Normal ), _NormalStrength );
|
|
float2 uv_Albedo = i.uv_texcoord * _Albedo_ST.xy + _Albedo_ST.zw;
|
|
float4 temp_output_3_0 = ( tex2D( _Albedo, uv_Albedo ) * _Color );
|
|
o.Albedo = temp_output_3_0.rgb;
|
|
float2 uv_EmissionMap = i.uv_texcoord * _EmissionMap_ST.xy + _EmissionMap_ST.zw;
|
|
o.Emission = ( tex2D( _EmissionMap, uv_EmissionMap ) * _EmissionColor ).rgb;
|
|
o.Specular = _Specular;
|
|
o.Gloss = _Gloss;
|
|
o.Alpha = temp_output_3_0.a;
|
|
}
|
|
|
|
ENDCG
|
|
CGPROGRAM
|
|
#pragma surface surf BlinnPhong 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 tSpace0 : TEXCOORD3;
|
|
float4 tSpace1 : TEXCOORD4;
|
|
float4 tSpace2 : TEXCOORD5;
|
|
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 );
|
|
half3 worldTangent = UnityObjectToWorldDir( v.tangent.xyz );
|
|
half tangentSign = v.tangent.w * unity_WorldTransformParams.w;
|
|
half3 worldBinormal = cross( worldNormal, worldTangent ) * tangentSign;
|
|
o.tSpace0 = float4( worldTangent.x, worldBinormal.x, worldNormal.x, worldPos.x );
|
|
o.tSpace1 = float4( worldTangent.y, worldBinormal.y, worldNormal.y, worldPos.y );
|
|
o.tSpace2 = float4( worldTangent.z, worldBinormal.z, worldNormal.z, worldPos.z );
|
|
o.customPack1.xy = customInputData.uv_texcoord;
|
|
o.customPack1.xy = v.texcoord;
|
|
o.worldPos = worldPos;
|
|
TRANSFER_SHADOW_CASTER_NORMALOFFSET( o )
|
|
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 ) );
|
|
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=19108
|
|
Node;AmplifyShaderEditor.SamplerNode;1;-893.6182,-508.3708;Inherit;True;Property;_Albedo;Albedo;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;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;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.ColorNode;2;-892.9818,-251.4351;Inherit;False;Property;_Color;Color;1;0;Create;True;0;0;0;False;0;False;1,1,1,1;0.3773584,0.3773584,0.3773584,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;3;-509.5994,-384.4714;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.BreakToComponentsNode;4;-251.3174,-383.6263;Inherit;False;COLOR;1;0;COLOR;0,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.SamplerNode;19;-894.0881,-64.26387;Inherit;True;Property;_EmissionMap;Emission Map;4;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;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;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;22;-510.5864,2.035604;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.ColorNode;21;-890.1855,130.7354;Inherit;False;Property;_EmissionColor;Emission Color;5;1;[HDR];Create;True;0;0;0;False;0;False;0,0,0,0;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;775.3693,-0.9779136;Float;False;True;-1;2;ASEMaterialInspector;0;0;BlinnPhong;Alpha Blend Interactive/Mobile/General Transparent;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;False;False;False;Back;0;False;;0;False;;False;0;False;;0;False;;False;0;Transparent;0.5;True;True;0;False;Transparent;;Transparent;All;12;all;True;True;True;True;0;False;;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;2;15;10;25;False;0.5;True;2;5;False;;10;False;;0;0;False;;0;False;;0;False;;0;False;;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;True;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;;6;0;False;;0;0;0;False;0.1;False;;0;False;;False;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
|
|
Node;AmplifyShaderEditor.RangedFloatNode;27;-889.8058,422.549;Inherit;False;Property;_Gloss;Gloss;8;0;Create;True;0;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;18;-1152.25,515.1141;Inherit;False;Property;_NormalStrength;Normal Strength;3;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;26;-894.6061,324.9488;Inherit;False;Property;_Specular;Specular;7;0;Create;True;0;0;0;False;0;False;1;1;0.001;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SamplerNode;25;-890.754,517.1713;Inherit;True;Property;_Normal;Normal;2;0;Create;True;0;0;0;False;0;False;-1;None;fec4ec6726e06c24d9dd7f282f11c7c0;True;0;False;bump;Auto;True;Object;-1;Auto;Texture2D;8;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;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
WireConnection;3;0;1;0
|
|
WireConnection;3;1;2;0
|
|
WireConnection;4;0;3;0
|
|
WireConnection;22;0;19;0
|
|
WireConnection;22;1;21;0
|
|
WireConnection;0;0;3;0
|
|
WireConnection;0;1;25;0
|
|
WireConnection;0;2;22;0
|
|
WireConnection;0;3;26;0
|
|
WireConnection;0;4;27;0
|
|
WireConnection;0;9;4;3
|
|
WireConnection;25;5;18;0
|
|
ASEEND*/
|
|
//CHKSM=B68846E0B7977C9C817BFADC4AEEA3C11F7076A2 |