I'm experimenting with procedural terrain generation of entire planets. This means I tend to render very big objects from very close up, and as a result I occasionally run into precision loss issues.
My latest terrain generator is producing images that look as follows. As you can see, there are lines in between some of the polygons.
Thing is, I'm reasonably sure that my terrain generator is outputting a correct mesh --- hand observation shows that the triangles seem to be sharing vertices, and the vertex:face ratio is about 2:1, which is correct. So I don't see how the polygons cannot precisely butt up against each other.
Does this look like it could be another precision loss issue? The camera is about 0.1 world units above the surface, which is about 1750 world units from the origin. This doesn't seem large enough to be an issue with Povray's double precision floats, but...
(If anyone feels like looking at the source code to the terrain generator, which is in C++, it's here: https://code.google.com/p/flooded-moon/source/browse/terrainmaker/sphericalroam.h)
Update: Here's a better image exhibiting the problem.
The camera's now 0.002 world units above the surface. The surface is about 1750 world units from the origin. My scale is 1 world unit to a kilometre; this means that the weird artifacting is on the order of centimetres, or about 0.00001. This is a difference of about 10^8. Is that enough for rounding errors to be significant?