I’m following a shader tutorial and am hitting a confusing error. I’m planning to contact that tutorial author as well but in the meantime figured I should try looking it up first, and the closest I came was this old forum thread . Perhaps the error I’m getting is another bug? Specifically, here’s the code for my shader:
Shader "Holistic/BumpedEnv" {
Properties {
_myDiffuse ("Diffuse Texture", 2D) = "white" {}
_myBump ("Bump Texture", 2D) = "bump" {}
_myCube ("Cube Map", Cube) = "white" {}
}
SubShader {
CGPROGRAM
#pragma surface surf Lambert
sampler2D _myDiffuse;
sampler2D _myBump;
samplerCUBE _myCube;
struct Input {
float2 uv_myDiffuse;
float2 uv_myBump;
float3 worldRefl;
};
void surf (Input IN, inout SurfaceOutput o) {
o.Albedo = tex2D(_myDiffuse, IN.uv_myDiffuse).rgb;
o.Normal = UnpackNormal(tex2D(_myBump, IN.uv_myBump));
o.Emission = texCUBE(_myCube, IN.worldRefl).rgb;
}
ENDCG
}
FallBack "Diffuse"
}
When I comment out either the o.Normal line or o.Emission then it works, but when I try to do both at once there’s this error:
Am I just doing something wrong?