I made a prefab with simple cube and applied “Display Normals” shader to check the normal of faces of the model.
If I put one prefab instance into the scene, rotation of the model does not change face colors. But if I put one more instance into the scene the face colors of both two instances change immediately. Face colors varies when I rotate them.
It seems like the face color is decided not by local coordinate but world coordinate with multiple prefab instances. Is this a bug or just a improper setting problem?


Shader "Display Normals" {
SubShader{
Pass{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
// vertex input: position, normal
struct appdata
{
float4 vertex : POSITION;
float3 normal : NORMAL;
};
struct v2f
{
float4 pos : SV_POSITION;
fixed4 color : COLOR;
};
v2f vert(appdata v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.color.xyz = v.normal * 0.5 + 0.5;
o.color.w = 1.0;
return o;
}
fixed4 frag(v2f i) : SV_Target{ return i.color; }
ENDCG
}
}
}