Skip to content

Commit d60e307

Browse files
committed
improve point rendering in wireframe debug mode
1 parent 7b74769 commit d60e307

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/styles/points/points.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ Object.assign(Points, {
9696
if (debugSettings.show_hidden_labels === true) {
9797
this.defines.TANGRAM_SHOW_HIDDEN_LABELS = true;
9898
}
99+
100+
// Enable wireframe for debugging
101+
if (debugSettings.wireframe === true) {
102+
this.defines.TANGRAM_WIREFRAME = true;
103+
}
99104
},
100105

101106
reset () {

src/styles/points/points_fragment.glsl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,15 @@ void main (void) {
109109
}
110110
#endif
111111

112+
// Make points more visible in wireframe debug mode
113+
#ifdef TANGRAM_WIREFRAME
114+
color = vec4(vec3(0.5), 1.); // use gray outline for textured points
115+
#ifdef TANGRAM_HAS_SHADER_POINTS
116+
if (u_point_type == TANGRAM_POINT_TYPE_SHADER) {
117+
color = vec4(v_color.rgb, 1.); // use original vertex color outline for shader points
118+
}
119+
#endif
120+
#endif
121+
112122
gl_FragColor = color;
113123
}

0 commit comments

Comments
 (0)