Fix a bug where the shader ambient coefficient would accidentially be modified while rendering.