I never noticed it before, but I have this (title) warning in a shader.
In my shader’s code I do not have the ‘__ST’ variable.
It can be found in the generated code but I do not know where it comes from.
How do I fix that?
// ************************************************************************************************************************************************ \\
// ************************************************************************************************************************************************ \\
// Adds an outline to a mesh
// It is using vertex color to set the color of the OUTLINE
// Only the 3 less significant bits of the red channel are used to get the index of the color to use
// The 7 resulting colors can be configured, the first will always remain transparent
// ************************************************************************************************************************************************ \\
// ************************************************************************************************************************************************ \\
Shader "Outlined/Silhouette Only"
{
Properties
{
m_OutlineWidth ("Outline width", Range (0.0, 0.5)) = 0.2 // The width of the outline
}
CGINCLUDE
#include "UnityCG.cginc"
// Vertex input structure
struct appdata
{
float4 vertex : POSITION;
float3 normal : NORMAL;
float4 color : COLOR;
};
// Vertex to fragment structure
struct v2f
{
float4 pos : POSITION;
float4 color : COLOR;
};
// The width of the outline
uniform float m_OutlineWidth;
// The colors per color index, the first one must always be (0, 0, 0, 0)
uniform float4 m_OutlineColors[8];
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Just make a copy of incoming vertex data but scaled according to normal direction
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
v2f vert(appdata v)
{
v2f o;
// Some pre-calculations
o.pos = UnityObjectToClipPos(v.vertex);
float3 Normal = mul ((float3x3)UNITY_MATRIX_IT_MV, v.normal);
float2 Offset = TransformViewToProjection(Normal.xy);
// Get the index of the outline color
int r = round(v.color.r * 255);
int ColorIndex = fmod(r, 8);
// Move the vertex a bit in order to create the outline effect
o.pos.xy += Offset * o.pos.z * m_OutlineWidth;
// Set the outline color
o.color = m_OutlineColors[ColorIndex];
return o;
}
ENDCG
SubShader
{
Tags { "Queue" = "Transparent" }
Pass
{
Name "BASE"
Cull Back
Blend Zero One
// Uncomment this to hide inner details:
//Offset -8, -8
SetTexture [_]
{
ConstantColor (0,0,0,0)
Combine constant
}
}
Pass
{
Name "OUTLINE"
Tags { "LightMode" = "Always" }
Cull Front
// You can choose what kind of blending mode you want for the outline
Blend SrcAlpha OneMinusSrcAlpha // Normal
//Blend One One // Additive
//Blend One OneMinusDstColor // Soft Additive
//Blend DstColor Zero // Multiplicative
//Blend DstColor SrcColor // 2x Multiplicative
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
half4 frag(v2f i) : COLOR
{
return i.color;
}
ENDCG
}
}
Fallback "Diffuse"
}