Why zero height mesh gets black independent of shader

When altering the scale of a gameobject with a mesh built procedurally, I’ve realized it gets all blacked out in Unity5, instead of dark gray in previous versions.

Testing with the default 3D cube from “GameObject → 3D object → Cube” the same thing happenned, so I’m confident there’s nothing particularly wrong with the mesh generation.

After a couple of trial and error experiments, 1e-12 is the smallest height for which material and color properties seem to take effect in Unity5. In Unity 4.6.1f1 it rendered the expected color with height as low as 1e-19.

Anyone knows why you can’t have a zero height render itself correctly and how to do it if there’s a way?
The project where it’s being used doesn’t need them to be actually zero height, but the work around for this small problem is quite a lot of work.

Thanks in advance

Unity automatically flips face normals according to the sign of the numbers in the scale-vector, to prevent negatively scaled objects from turning inside out. At 0 scale, this breaks.

The cutoff at 1e-12 doesn’t really make any difference compared to 1e-19, neither visaully nor mathematically. There is not much that you cannot do with 12 orders of magnitude that would be possible with 19. Especially if you factor in float-inaccuracies.

If you need flat geometry, use flat geometry, like Planes (NOT aircrafts) or Quads.