This works fine on a PC but I'm using a Mac and it brings up the warning
No subshaders can run on this graphics card
Which for shaders then brings up the pink error shader.
Shader "Custom/wireframeShaderWithLambert" {
Properties {
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
_Color ("Line Color", Color) = (1,1,1,1)
_MainTex ("Main Texture", 2D) = "white" {}
_Thickness ("Thickness", Float) = 1
}
SubShader {
Tags { "RenderType" = "Opaque" }
CGPROGRAM
#pragma surface surf Lambert
struct Input {
float2 uv_MainTex;
};
sampler2D _MainTex;
void surf (Input IN, inout SurfaceOutput o) {
o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
}
ENDCG
Pass
{
Tags { "RenderType"="Opaque" "Queue"="Geometry" }
Blend SrcAlpha OneMinusSrcAlpha
Cull Off
LOD 200
CGPROGRAM
#pragma target 5.0
#include "UnityCG.cginc"
#pragma vertex vert
#pragma fragment frag
#pragma geometry geom
struct vertToGeom
{
float4 pos : POSITION; // vertex position
float2 uv : TEXCOORD0; // vertex uv coordinate
};
// Geometry to UCLAGL_fragment
struct geomToFrag
{
float4 pos : POSITION; // fragment position
float2 uv : TEXCOORD0; // fragment uv coordinate
float3 dist : TEXCOORD1; // distance to each edge of the triangle
};
// PARAMETERS //
//float4 _Texture_ST; // For the Main Tex UV transform
float _Thickness = 1; // Thickness of the wireframe line rendering
float4 _Color = {1,1,1,1}; // Color of the line
float4 _MainTex_ST; // For the Main Tex UV transform
sampler2D _MainTex; // Texture used for the line
// Vertex Shader
vertToGeom vertShader(appdata_base v)
{
//Random shader code
return output;
}
// Geometry Shader
[maxvertexcount(3)]
void geomShader(triangle UCLAGL_v2g p[3], inout TriangleStream<UCLAGL_g2f> triStream)
{
//Random shader code
}
ENDCG
}
}
}
I'm not sure why this is, the only thing I can think of is perhaps Cg doesn't work on Macs?
Plus, I can't seem to find a way to make it GLSL.