How do I stop a displacement modifier from breaking the edges of its mesh into many small parts? I have a mesh grid. I have selected all the edges of it that run in one direction and applied a freestyle color mix to them so their start is pink, their middle is white, and their end is green.

When I view the rendered mesh like that I can see that each edge is rendered as a single line, with all the colors nicely lined up:


Now I apply a displacement modifier to the mesh, using an image. I would expect that each edge would remain as a single, uninterrupted line, warped to fit the displacement map, and with the color placement the same as above – pink on the left, white in the middle, and green on the right.

Instead of that I see a random distribution of colors, indicating that my edges now appear to be made up of many small lines:


How can I correct that and achieve a displaced mesh with single, unbroken edges running the full width of my mesh?

(FWIW applying the displacement modifier has no effect on the issue.)

Update: May 7th, 2017 – I tried turning off the "Visibility" setting, as per TK's suggestion, but that didn't fix my problem. The lines are still mostly broken up into small pieces.


Here's another version of the file that I created from scratch, just to make sure I hadn't unchecked any default settings while fiddling about. It exhibits the same problems. I've applied the Displace modifier to keep thing simple.


Thank you.

Dunstan
With the displacement modifier, the edges are occluded by bumps created by the modifier and hence are no longer fully visible from the camera.  Freestyle identifies both visible and hidden lines, and by default draws only visible lines.  If you want to draw all lines no matter whether they are visible or hidden, then you need to turn off the selection by visibility (i.e., disable the "Visibility" toggle in the "Selection By" section of the Freestyle Line Set panel).

Update on May 12, 2017

Setting the mesh faces to the smooth shading and turning on the Face Smoothness option could improve the result as you expect.

That said, there seems a bug in Freestyle that prevents visible and hidden lines from getting chained into a single stroke.  For instance, the following render shows lines composed of visible and hidden parts.  Most lines are consistent in the sense that they start in red and end in green, while some lines are not.



The next image shows some of those inconsistent lines that are expected to be long continuous red-green strokes rather than being split into short pieces.



The render below shows the visibility of line segments in question (visible and hidden parts in red and green, respectively).



By comparing the last two renders, it is seen that in some cases visible and hidden line segments can be chained to form a consistent line, while not in some other cases.  I think this is a bug in Freestyle (to be fixed as soon as time permits).