Unity 5 Surface Shader - Ambient issue

Hey everyone,

I am trying the new Unity 5 and it is really great but I am facing an issue when using Surface shader. As the issue is the same when using the Legacy Diffuse shader I’ll talk about this issue using this shader.

If I apply the Legacy Diffuse shader, the material uses the ambient light defined in the Scene Render Settings. But if I turn my object static, it uses the Indirect lighting provided by the Global illumination AND the ambient light setting defined in the Scene Render Settings which gives a too bright result.

I would like to know how can I turn off the ambient light when the object is static ?

Thank you !

Did you try a separate surface shader with the noambient option applied?

Yep, noambient deactivate real-time ambient lighting, but I think that creating two shaders is not the good solution. And the Unity 5 Default shader handles this correctly.

I haven’t tried Unity 5 myself yet. It’s just my experience that the legacy lightmapped shaders in Unity 4 should have noambient applied to fit in with shaders without a light map.

This double ambient lighting in Unity 5 when marking static might actually be a bug. Usage of global illumination should turn of the fixed ambient term.

I didn’t know that lightmapped shaders should have noambient in Unity 4.
It seems that this is the same behaviour in Unity 5 but the strange thing is that it’s handled in the Default shader. I searched in the built-in shaders but I didn’t found anything relevant.
Maybe @Aras has an explanation about it. :slight_smile:

Well, that’s just my opinion. I’ve made my own lightmapped shaders with noambient, because that way I can combine lightmapped with non-lightmapped. It does seem the issue is similar in Unity 5.