This is a follow up question to an issue i was having understanding and fixing an issue with a shader not rendering on an Android Device (Samsung Galaxy S III mini).
The issue I have is that with an specific set of shaders the object renders to black. For some unknown reason the line that gives the color to the surface is not doing it. why? I have no clue So here is the code.
Shader "MatCap/Vertex/Textured Lit"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_MatCap ("MatCap (RGB)", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
CGPROGRAM
#pragma exclude_renderers d3d11 d3d11_9x
#pragma surface surf Lambert vertex:vert
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
uniform sampler2D _MatCap;
uniform float4 _Color;
struct Input
{
half2 uv_MainTex : TEXCOORD0;
float2 matcapUV;
};
void vert (inout appdata_full v, out Input o)
{
o.matcapUV = float2(dot(UNITY_MATRIX_IT_MV[0].xyz,v.normal),dot(UNITY_MATRIX_IT_MV[1].xyz,v.normal)) * 0.5 + 0.5;
}
void surf (Input IN, inout SurfaceOutput o)
{
o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgb * tex2D(_MatCap, IN.matcapUV) * _Color * 2.0;
}
ENDCG
}
Fallback "Diffuse Detail"
}
I assume the error is in the Albedo but i canβt seem to figure out how to fix it. So does anyone have a clue why a shader on an specific device would render a surface as black being that you are trying to change the color?