Hey! Thanks for the suggestion! I did try that already previously and got the following errors:
Shader error in 'Outline2D': redefinition of '_ST' at line 202 (on glcore)
Shader error in 'Outline2D': not enough actual parameters for macro 'TRANSFORM_TEX' at line 213 (on glcore)
Strange thing is, my shader ends at line 161. Here's my full code:
Shader "Outline2D" {
Properties {
_Color ("Main Tint", Color) = (1,1,1,1)
_OutlineColor ("Outline Color", Color) = (1,1,1,1)
_ShadowDetectColor ("Shadow Detect Color", Color) = (0,0,0,1)
_ShadowDrawColor ("Shadow Draw Color", Color) = (0.31,0.13,0.25,0.5)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_BumpTex ("Normal Map (RGB)", 2D) = "bump" {}
_Cutoff ("Main Alpha Cutoff", Range(0,1)) = 0.5
_OutlineCutoff ("Outline Alpha Cutoff", Range(0,1)) = 0.25
_LineOffset ("Outline Depth Offset", Range(0,-10000)) = -1000
_CharOffset ("Character Sort Layer", Range(-10000,10000)) = 2
_ShadowOffset ("Shadow Sort Layer", Range(-10000,10000)) = 2
_Color ("Tint Color", Color) = (1,1,1,1)
_Black ("Black Point", Color) = (0,0,0,0)
}
SubShader {
//Outline Pass
Tags {"Queue"="Transparent" "RenderType"="Transparent" "LightMode"="ForwardBase"}
Offset 1, [_LineOffset]
Cull Off
ZWrite On
CGPROGRAM
#pragma surface surf Lambert alpha:fade
#pragma target 3.0
sampler2D _MainTex;
sampler2D _BumpTex;
struct Input {
float2 uv_MainTex;
float2 uv_BumpTex;
fixed4 color :COLOR;
};
fixed4 _OutlineColor;
half _OutlineCutoff;
fixed4 _ShadowDetectColor;
void surf (Input IN, inout SurfaceOutput o) {
fixed4 albedo = tex2D (_MainTex, IN.uv_MainTex);
clip (albedo.a - _OutlineCutoff);
if (albedo.r == _ShadowDetectColor.r )
if (albedo.g == _ShadowDetectColor.g )
if (albedo.b == _ShadowDetectColor.b )
discard;
o.Albedo = _OutlineColor.rgb;
o.Alpha = IN.color.a;
}
ENDCG
//Standard Pass
Tags {"Queue"="Transparent" "RenderType"="Transparent"}
LOD 200
Cull Off
Offset -3, [_CharrOffset]
ZWrite On
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma surface surf Standard alpha:fade
#pragma target 3.0
sampler2D _MainTex;
sampler2D _BumpTex;
struct Input {
float2 uv_MainTex;
float2 uv1;
float2 uv2;
fixed4 vertexColor :COLOR;
};
half _Cutoff;
fixed4 _ShadowDetectColor;
float4 _Black;
void surf (Input IN, inout SurfaceOutputStandard o) {
fixed4 albedo = tex2D (_MainTex, IN.uv_MainTex);
clip (albedo.a - _Cutoff);
if (albedo.b == _ShadowDetectColor.b )
discard;
o.Albedo = (albedo * IN.vertexColor.rgb) +float4(((1-albedo.rgb) * (_Black.rgb + float3(IN.uv1.r, IN.uv1.g, IN.uv2.r)) * albedo.a*IN.vertexColor.a), 0);
o.Alpha = IN.vertexColor.a * albedo.a;
}
ENDCG
//Shadow Pass
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Offset -1, [_ShadowOffset]
Cull Off
ZWrite On
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma surface surf Lambert alpha
#pragma target 3.0
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
float4 vertexColor : COLOR;
};
fixed4 _ShadowDetectColor;
fixed4 _ShadowDrawColor;
half _Cutoff;
void surf (Input IN, inout SurfaceOutput o) {
fixed4 albedo = tex2D (_MainTex, IN.uv_MainTex);
clip (albedo.a - 0.3);
if (albedo.r != _ShadowDetectColor.r )
if (albedo.g != _ShadowDetectColor.g )
if (albedo.b != _ShadowDetectColor.b )
discard;
albedo.r = _ShadowDrawColor.r;
albedo.g = _ShadowDrawColor.g;
albedo.b = _ShadowDrawColor.b;
o.Albedo = albedo.rgb;
o.Alpha = albedo.a;
}
ENDCG
}
FallBack "Diffuse"
}
Look for the //Standard Pass