when compiling a cg shader to glsl with #pragma glsl the lit function no longer works. It compiles but it shows textures as white wherever they have any specular. This is in unity 3.5.7, and the same shader works correctly with ARB
Here is my workaround which does work, I add the following to the top:
#ifdef SHADER_TARGET_GLSL
float4 lit2(float NdotL, float NdotH, float m)
{
float spec = (NdotL > 0) ? pow(max(0.0, NdotH), m) : 0;
return float4(1.0, max(0.0, NdotL), spec, 1.0);
}
#define lit lit2
#endif