Fix lighting crash when using environment mapping due to the addition of instancing