Skip to content

Commit

Permalink
improve point rendering in wireframe debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bcamper committed Feb 15, 2020
1 parent 7b74769 commit d60e307
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/styles/points/points.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ Object.assign(Points, {
if (debugSettings.show_hidden_labels === true) {
this.defines.TANGRAM_SHOW_HIDDEN_LABELS = true;
}

// Enable wireframe for debugging
if (debugSettings.wireframe === true) {
this.defines.TANGRAM_WIREFRAME = true;
}
},

reset () {
Expand Down
10 changes: 10 additions & 0 deletions src/styles/points/points_fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,15 @@ void main (void) {
}
#endif

// Make points more visible in wireframe debug mode
#ifdef TANGRAM_WIREFRAME
color = vec4(vec3(0.5), 1.); // use gray outline for textured points
#ifdef TANGRAM_HAS_SHADER_POINTS
if (u_point_type == TANGRAM_POINT_TYPE_SHADER) {
color = vec4(v_color.rgb, 1.); // use original vertex color outline for shader points
}
#endif
#endif

gl_FragColor = color;
}

0 comments on commit d60e307

Please sign in to comment.