Hi!
I upgraded a project to Unity 5, I had the usual " variable not fully initialized" error in a lot of shader, I fixed it by adding
UNITY_INITIALIZE_OUTPUT(Input, o);
No problem.
But now I have a shader that blends 2 * (diffuse+normal) texture pairs based on a blend texture I got a strange error.
The shader only throws the error when in playmode.
The shader error:
Shader error in 'VertexBlend': Too many output registers declared (12). When no output register has been declared with the semantic 'psize0', 11 o# registers are available. When an o# register has been declared with the semantic 'psize0' (same as 'psize'), 12 registers are available. at line 192 (on d3d9)
Compiling Vertex program with DIRECTIONAL SHADOWS_SCREEN LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF FOG_EXP2 VERTEXLIGHT_ON
It seems to work, but I am affraid it will break on some mobile devices.
Can anyone tall me what is wrong? What should I change to make it work?
My vert output structure:
struct Input {
float2 uv_MainTex : TEXCOORD0;
float2 uv_Diffuse2 : TEXCOORD1;
float2 uv_BlendMask : TEXCOORD2;
float4 color : COLOR;
float2 uv_Normal1 : TEXCOORD3;
float2 uv_Normal2 : TEXCOORD4;
};
Thanks!