geojs icon indicating copy to clipboard operation
geojs copied to clipboard

Triangular artifacts in contourFeature

Open manthey opened this issue 6 years ago • 0 comments

Because square meshes are divided into triangles for rendering, there can be a bias in how they are drawn in the contour feature (and, also, in polygons with more than three vertices and fill colors that vary by vertex). The triangular partition creates artifacts in the rendered contour.

I think the correct solution for square meshes in the contourFeature would be to modify the shaders to perform the appropriate quadrilateral interpolation. Since the vertex shader, by default, interpolates between three points, this could be done by passing the values at the four vertices, plus a value that would be 0,0, 0,1, 1,0, or 1,1 for each vertex. The vertex shader could then interpolate the 0-1 values, which would then be used in the fragment shader to compute the value.

manthey avatar May 31 '18 17:05 manthey