I have the following simple shader, which worked perfectly earlier. I don’t know, since when it stopped rendering my objects, as I have not used it since a while, because I am working on other variants, which are much more complex, but based on this one. They all work well, as expected.
I have absolutelly no idea, what the errors mean and if they are the cause for my objects being invisible during play. The properties are set correctly during play, as can be observed in the inspector. The preview is empty as well.
The line number 27 is not related to the source code, as it keeps unchanged when inserting more lines. I’m working in Win7, Unity Pro 4.0.1f2.
Any suggestions?
Shader "MyProject/Interpolated" {
Properties {
_FirstTex ("Image (RGB) Transparency (A) - First", 2D) = "white" {}
_SecondTex ("Image (RGB) Transparency (A) - Second", 2D) = "white" {}
_t ("Interpolation Coefficient (t)", Range(0,1)) = 0.5
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 200
CGPROGRAM
#pragma surface surf Lambert alpha
float _t;
sampler2D _FirstTex, _SecondTex;
struct Input {
float2 uv;
};
void surf (Input IN, inout SurfaceOutput o) {
fixed4 c = tex2D(_FirstTex, IN.uv) * (1.0 - _t);
c += tex2D(_SecondTex, IN.uv) * _t;
o.Emission = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
Fallback "Transparent/Cutout/VertexLit"
}
Compilation gives the following warnings:
Shader warning in ‘Lightfield/Interpolated’: Program ‘vert_surf’, not enough actual parameters for macro ‘TRANSFORM_TEX’ (compiling for d3d11) at line 27
Shader warning in ‘Lightfield/Interpolated’: Program ‘vert_surf’, not enough actual parameters for macro ‘TRANSFORM_TEX’ (compiling for d3d11_9x) at line 27
Shader warning in ‘Lightfield/Interpolated’: Program ‘vert_surf’, undeclared identifier ‘TRANSFORM_TEX’ (compiling for d3d11) at line 27
Shader warning in ‘Lightfield/Interpolated’: Program ‘vert_surf’, undeclared identifier ‘TRANSFORM_TEX’ (compiling for d3d11_9x) at line 27