50 lines
1.0 KiB
Plaintext
50 lines
1.0 KiB
Plaintext
|
Shader "Hidden/OutlineShader"
|
||
|
{
|
||
|
Properties
|
||
|
{
|
||
|
_OutlineColor ("Outline Color", Color) = (1,1,1,1)
|
||
|
}
|
||
|
SubShader
|
||
|
{
|
||
|
Tags { "RenderType"="Opaque" "Queue"="Transparent" }
|
||
|
Pass
|
||
|
{
|
||
|
Name "Outline"
|
||
|
Cull Off
|
||
|
Blend SrcAlpha OneMinusSrcAlpha
|
||
|
ZWrite Off
|
||
|
ZTest Always
|
||
|
|
||
|
HLSLPROGRAM
|
||
|
#pragma vertex vert
|
||
|
#pragma fragment frag
|
||
|
#include "UnityCG.cginc"
|
||
|
|
||
|
float4 _OutlineColor;
|
||
|
|
||
|
struct appdata
|
||
|
{
|
||
|
float4 vertex : POSITION;
|
||
|
};
|
||
|
|
||
|
struct v2f
|
||
|
{
|
||
|
float4 vertex : SV_POSITION;
|
||
|
};
|
||
|
|
||
|
v2f vert (appdata v)
|
||
|
{
|
||
|
v2f o;
|
||
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
||
|
return o;
|
||
|
}
|
||
|
|
||
|
fixed4 frag (v2f i) : SV_Target
|
||
|
{
|
||
|
return _OutlineColor;
|
||
|
}
|
||
|
ENDHLSL
|
||
|
}
|
||
|
}
|
||
|
}
|