|
// Made with Amplify Shader Editor
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "ASESampleShaders/XRay"
|
|
{
|
|
Properties
|
|
{
|
|
_ASEOutlineWidth( "Outline Width", Float ) = 0
|
|
_TextureSample0("Texture Sample 0", 2D) = "white" {}
|
|
_XRayPower("XRayPower", Float) = 0
|
|
_XRayColor("XRayColor", Color) = (0,0,0,0)
|
|
_XRayScale("XRayScale", Float) = 0
|
|
_XRayBias("XRayBias", Float) = 0
|
|
_XRayIntensity("XRayIntensity", Float) = 0
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
[HideInInspector] __dirty( "", Int ) = 1
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
Pass
|
|
{
|
|
ColorMask 0
|
|
ZWrite On
|
|
}
|
|
|
|
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0"}
|
|
ZWrite Off
|
|
ZTest Always
|
|
Cull Back
|
|
CGPROGRAM
|
|
#pragma target 3.0
|
|
#pragma surface outlineSurf Outline nofog alpha:fade keepalpha noshadow noambient novertexlights nolightmap nodynlightmap nodirlightmap nometa noforwardadd vertex:outlineVertexDataFunc
|
|
|
|
|
|
|
|
struct Input
|
|
{
|
|
float3 worldPos;
|
|
float3 worldNormal;
|
|
INTERNAL_DATA
|
|
};
|
|
uniform float _XRayBias;
|
|
uniform float _XRayScale;
|
|
uniform float _XRayPower;
|
|
uniform float4 _XRayColor;
|
|
uniform float _XRayIntensity;
|
|
uniform fixed _ASEOutlineWidth;
|
|
|
|
void outlineVertexDataFunc( inout appdata_full v, out Input o )
|
|
{
|
|
UNITY_INITIALIZE_OUTPUT( Input, o );
|
|
v.vertex.xyz += ( v.normal * _ASEOutlineWidth );
|
|
}
|
|
inline fixed4 LightingOutline( SurfaceOutput s, half3 lightDir, half atten ) { return fixed4 ( 0,0,0, s.Alpha); }
|
|
void outlineSurf( Input i, inout SurfaceOutput o )
|
|
{
|
|
float3 ase_worldPos = i.worldPos;
|
|
float3 ase_worldViewDir = normalize( UnityWorldSpaceViewDir( ase_worldPos ) );
|
|
float3 ase_worldNormal = WorldNormalVector( i, float3( 0, 0, 1 ) );
|
|
float fresnelNDotV4 = dot( normalize( ase_worldNormal ), ase_worldViewDir );
|
|
float fresnelNode4 = ( _XRayBias + _XRayScale * pow( 1.0 - fresnelNDotV4, _XRayPower ) );
|
|
o.Emission = ( fresnelNode4 * _XRayColor ).rgb;
|
|
o.Alpha = ( fresnelNode4 * (_XRayColor).a * _XRayIntensity );
|
|
o.Normal = float3(0,0,-1);
|
|
}
|
|
ENDCG
|
|
|
|
|
|
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+1" }
|
|
Cull Back
|
|
ZWrite On
|
|
ZTest LEqual
|
|
CGPROGRAM
|
|
#pragma target 3.0
|
|
#pragma surface surf Standard keepalpha addshadow fullforwardshadows vertex:vertexDataFunc
|
|
struct Input
|
|
{
|
|
float2 uv_texcoord;
|
|
};
|
|
|
|
uniform sampler2D _TextureSample0;
|
|
uniform float4 _TextureSample0_ST;
|
|
|
|
void vertexDataFunc( inout appdata_full v, out Input o )
|
|
{
|
|
UNITY_INITIALIZE_OUTPUT( Input, o );
|
|
v.vertex.xyz += 0;
|
|
}
|
|
|
|
void surf( Input i , inout SurfaceOutputStandard o )
|
|
{
|
|
float2 uv_TextureSample0 = i.uv_texcoord * _TextureSample0_ST.xy + _TextureSample0_ST.zw;
|
|
o.Albedo = tex2D( _TextureSample0, uv_TextureSample0 ).rgb;
|
|
o.Alpha = 1;
|
|
}
|
|
|
|
ENDCG
|
|
}
|
|
Fallback "Diffuse"
|
|
CustomEditor "ASEMaterialInspector"
|
|
}
|
|
/*ASEBEGIN
|
|
Version=15305
|
|
579;92;844;805;1604.61;353.2161;2.502781;True;False
|
|
Node;AmplifyShaderEditor.RangedFloatNode;7;-900.287,517.881;Float;False;Property;_XRayPower;XRayPower;1;0;Create;True;0;0;False;0;0;1.24;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;11;-951.7518,442.8604;Float;False;Property;_XRayScale;XRayScale;3;0;Create;True;0;0;False;0;0;1.5;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;12;-938.6353,337.6537;Float;False;Property;_XRayBias;XRayBias;4;0;Create;True;0;0;False;0;0;0.07;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ColorNode;9;-820.4163,651.0913;Float;False;Property;_XRayColor;XRayColor;2;0;Create;True;0;0;False;0;0,0,0,0;0,0.297,1,1;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.FresnelNode;4;-714.0091,387.929;Float;True;Tangent;4;0;FLOAT3;0,0,1;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;5;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;16;-532.6353,870.6537;Float;False;Property;_XRayIntensity;XRayIntensity;5;0;Create;True;0;0;False;0;0;1.5;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SwizzleNode;14;-492.6353,739.6537;Float;False;FLOAT;3;1;2;3;1;0;COLOR;0,0,0,0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;15;-342.6353,585.6537;Float;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;10;-390.3535,478.4465;Float;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SamplerNode;1;-421.5808,-222.0275;Float;True;Property;_TextureSample0;Texture Sample 0;0;0;Create;True;0;0;False;0;None;e70a4cc9a27a530468623a76c6c025fe;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.OutlineNode;3;-143.3773,491.4906;Float;False;0;True;Transparent;2;7;Back;3;0;FLOAT3;0,0,0;False;2;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;9,-45;Float;False;True;2;Float;ASEMaterialInspector;0;0;Standard;ASESampleShaders/XRay;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;Back;1;False;-1;3;False;-1;False;1;False;-1;1;False;-1;True;0;Opaque;0.5;True;True;1;False;Opaque;;Geometry;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;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;-1;False;-1;-1;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;0;0;False;0;0;0;False;-1;-1;0;False;-1;16;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;5;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;4;1;12;0
|
|
WireConnection;4;2;11;0
|
|
WireConnection;4;3;7;0
|
|
WireConnection;14;0;9;0
|
|
WireConnection;15;0;4;0
|
|
WireConnection;15;1;14;0
|
|
WireConnection;15;2;16;0
|
|
WireConnection;10;0;4;0
|
|
WireConnection;10;1;9;0
|
|
WireConnection;3;0;10;0
|
|
WireConnection;3;2;15;0
|
|
WireConnection;0;0;1;0
|
|
WireConnection;0;11;3;0
|
|
ASEEND*/
|
|
//CHKSM=3009DBC60633C94AFDCB3E17B29986206D237EF6
|