Skip to content

Commit

Permalink
fixed off-by-one error: left seam is always correctly specified now
Browse files Browse the repository at this point in the history
  • Loading branch information
dkogan committed Nov 25, 2013
1 parent c07bd4d commit df90ace
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion render_terrain.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static bool loadGeometry( float view_lat, float view_lon,

// left side; negative to indicate that this is a duplicate for the left seam
vertices[vertex_buf_idx++] = view_i;
vertices[vertex_buf_idx++] = -j;
vertices[vertex_buf_idx++] = -(j+1); // extra 1 because I can't assume that -0 < 0
vertices[vertex_buf_idx++] = sampleDEM(view_i_DEMcoords, j_dem,
dems[baseDEMfileE - renderStartDEMfileE][DEMfileN - renderStartDEMfileN]);

Expand Down
2 changes: 1 addition & 1 deletion vertex.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void main(void)
}
else if( vin.y < 0.0 )
{
vin.y *= -1.0;
vin.y = -vin.y - 1.0; // extra 1 because I can't assume that -0 < 0
at_right_seam = true;
}

Expand Down

0 comments on commit df90ace

Please sign in to comment.