153 lines
4.2 KiB
Plaintext
153 lines
4.2 KiB
Plaintext
|
// Made with Amplify Shader Editor
|
||
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
||
|
Shader "LineShader"
|
||
|
{
|
||
|
Properties
|
||
|
{
|
||
|
[HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
|
||
|
[HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
|
||
|
|
||
|
}
|
||
|
|
||
|
SubShader
|
||
|
{
|
||
|
LOD 0
|
||
|
|
||
|
|
||
|
|
||
|
Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Transparent" "Queue"="Transparent" }
|
||
|
|
||
|
Cull Off
|
||
|
HLSLINCLUDE
|
||
|
#pragma target 2.0
|
||
|
ENDHLSL
|
||
|
|
||
|
|
||
|
Pass
|
||
|
{
|
||
|
Name "Unlit"
|
||
|
|
||
|
|
||
|
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
||
|
ZTest Always
|
||
|
ZWrite Off
|
||
|
Offset 0 , 0
|
||
|
ColorMask RGBA
|
||
|
|
||
|
|
||
|
HLSLPROGRAM
|
||
|
#define ASE_SRP_VERSION 999999
|
||
|
|
||
|
#pragma prefer_hlslcc gles
|
||
|
#pragma exclude_renderers d3d11_9x
|
||
|
|
||
|
#pragma vertex vert
|
||
|
#pragma fragment frag
|
||
|
|
||
|
#pragma multi_compile _ ETC1_EXTERNAL_ALPHA
|
||
|
|
||
|
#define _SURFACE_TYPE_TRANSPARENT 1
|
||
|
#define SHADERPASS_SPRITEUNLIT
|
||
|
|
||
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
||
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
||
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
||
|
|
||
|
#define ASE_NEEDS_FRAG_COLOR
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
struct VertexInput
|
||
|
{
|
||
|
float4 vertex : POSITION;
|
||
|
float3 normal : NORMAL;
|
||
|
float4 tangent : TANGENT;
|
||
|
float4 uv0 : TEXCOORD0;
|
||
|
float4 color : COLOR;
|
||
|
|
||
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||
|
};
|
||
|
|
||
|
struct VertexOutput
|
||
|
{
|
||
|
float4 clipPos : SV_POSITION;
|
||
|
float4 texCoord0 : TEXCOORD0;
|
||
|
float4 color : TEXCOORD1;
|
||
|
|
||
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||
|
UNITY_VERTEX_OUTPUT_STEREO
|
||
|
};
|
||
|
|
||
|
#if ETC1_EXTERNAL_ALPHA
|
||
|
TEXTURE2D( _AlphaTex ); SAMPLER( sampler_AlphaTex );
|
||
|
float _EnableAlphaTexture;
|
||
|
#endif
|
||
|
|
||
|
float4 _RendererColor;
|
||
|
|
||
|
|
||
|
VertexOutput vert( VertexInput v )
|
||
|
{
|
||
|
VertexOutput o = (VertexOutput)0;
|
||
|
UNITY_SETUP_INSTANCE_ID( v );
|
||
|
UNITY_TRANSFER_INSTANCE_ID( v, o );
|
||
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
|
||
|
|
||
|
|
||
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
||
|
float3 defaultVertexValue = v.vertex.xyz;
|
||
|
#else
|
||
|
float3 defaultVertexValue = float3( 0, 0, 0 );
|
||
|
#endif
|
||
|
float3 vertexValue = defaultVertexValue;
|
||
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
||
|
v.vertex.xyz = vertexValue;
|
||
|
#else
|
||
|
v.vertex.xyz += vertexValue;
|
||
|
#endif
|
||
|
v.normal = v.normal;
|
||
|
|
||
|
VertexPositionInputs vertexInput = GetVertexPositionInputs( v.vertex.xyz );
|
||
|
|
||
|
o.texCoord0 = v.uv0;
|
||
|
o.color = v.color;
|
||
|
o.clipPos = vertexInput.positionCS;
|
||
|
|
||
|
return o;
|
||
|
}
|
||
|
|
||
|
half4 frag( VertexOutput IN ) : SV_Target
|
||
|
{
|
||
|
UNITY_SETUP_INSTANCE_ID( IN );
|
||
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
|
||
|
|
||
|
|
||
|
float4 Color = IN.color;
|
||
|
|
||
|
#if ETC1_EXTERNAL_ALPHA
|
||
|
float4 alpha = SAMPLE_TEXTURE2D( _AlphaTex, sampler_AlphaTex, IN.texCoord0.xy );
|
||
|
Color.a = lerp( Color.a, alpha.r, _EnableAlphaTexture );
|
||
|
#endif
|
||
|
|
||
|
Color *= IN.color;
|
||
|
|
||
|
return Color;
|
||
|
}
|
||
|
|
||
|
ENDHLSL
|
||
|
}
|
||
|
}
|
||
|
CustomEditor "UnityEditor.ShaderGraph.PBRMasterGUI"
|
||
|
Fallback "Hidden/InternalErrorShader"
|
||
|
|
||
|
}
|
||
|
/*ASEBEGIN
|
||
|
Version=18500
|
||
|
274;468;995;455;812.0988;244.6024;1.3;True;False
|
||
|
Node;AmplifyShaderEditor.VertexColorNode;2;-374.1,-167.6;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
||
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;10;0,0;Float;False;True;-1;2;UnityEditor.ShaderGraph.PBRMasterGUI;0;13;LineShader;cf964e524c8e69742b1d21fbe2ebcc4a;True;Unlit;0;0;Unlit;3;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;0;0;True;2;5;False;-1;10;False;-1;3;1;False;-1;10;False;-1;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;2;False;-1;True;7;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;0;Hidden/InternalErrorShader;0;0;Standard;1;Vertex Position;1;0;1;True;False;;False;0
|
||
|
WireConnection;10;1;2;0
|
||
|
ASEEND*/
|
||
|
//CHKSM=DF8082957C13308D6E9DB118637C184F5B944E74
|