[core] Don't use depth test unless text is pitch-aligned to map (#6404)

* [core, ios, android] Use `auto` value for properties with calculated defaults

* Fix render tests

* [core] Don't use depth test unless text is pitch-aligned to map.

* Bump mapbox-gl-test-suite

* TransformState pitch is already in radians

* Reduce setDepthSublayer calls

* Bump test suite
This commit is contained in:
Young Hahn
2016-09-22 19:51:41 -04:00
committed by GitHub
parent 4d3356dc1e
commit 08c08f6705
2 changed files with 5 additions and 9 deletions

View File

@@ -22,7 +22,7 @@
"express": "^4.11.1",
"mapbox-gl-shaders": "mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747",
"mapbox-gl-style-spec": "mapbox/mapbox-gl-style-spec#a6c95d33ff5ced2c0d7df995fd89eb557c0a353c",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#e05680a27f93d7284fce31b9b42a19c80df96b13",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#880c1879b29ccdb473b3888fc2134d5261efb7d3",
"mkdirp": "^0.5.1",
"node-cmake": "^1.2.1",
"request": "^2.72.0",

View File

@@ -67,7 +67,7 @@ void Painter::renderSDF(SymbolBucket& bucket,
sdfShader.u_rotate_with_map = rotateWithMap;
sdfShader.u_pitch_with_map = pitchWithMap;
sdfShader.u_texture = 0;
sdfShader.u_pitch = state.getPitch() * util::DEG2RAD;
sdfShader.u_pitch = state.getPitch();
sdfShader.u_bearing = -1.0f * state.getAngle();
sdfShader.u_aspect_ratio = (state.getWidth() * 1.0f) / (state.getHeight() * 1.0f);
@@ -94,8 +94,6 @@ void Painter::renderSDF(SymbolBucket& bucket,
sdfShader.u_color = haloColor;
sdfShader.u_opacity = opacity;
sdfShader.u_buffer = (haloOffset - haloWidth / fontScale) / sdfPx;
setDepthSublayer(0);
(bucket.*drawSDF)(sdfShader, store, paintMode());
}
@@ -105,8 +103,6 @@ void Painter::renderSDF(SymbolBucket& bucket,
sdfShader.u_color = color;
sdfShader.u_opacity = opacity;
sdfShader.u_buffer = (256.0f - 64.0f) / 256.0f;
setDepthSublayer(1);
(bucket.*drawSDF)(sdfShader, store, paintMode());
}
}
@@ -141,6 +137,8 @@ void Painter::renderSymbol(PaintParameters& parameters,
config.stencilTest = GL_TRUE;
}
setDepthSublayer(0);
if (bucket.hasIconData()) {
if (layout.iconRotationAlignment == AlignmentType::Map) {
config.depthFunc.reset();
@@ -218,13 +216,12 @@ void Painter::renderSymbol(PaintParameters& parameters,
frameHistory.bind(store, config, 1);
iconShader.u_fadetexture = 1;
setDepthSublayer(0);
bucket.drawIcons(iconShader, store, paintMode());
}
}
if (bucket.hasTextData()) {
if (layout.textRotationAlignment == AlignmentType::Map) {
if (layout.textPitchAlignment == AlignmentType::Map) {
config.depthFunc.reset();
config.depthTest = GL_TRUE;
} else {
@@ -265,7 +262,6 @@ void Painter::renderSymbol(PaintParameters& parameters,
collisionBoxShader.u_maxzoom = (tile.id.canonical.z + 1) * 10;
config.lineWidth = 1.0f;
setDepthSublayer(0);
bucket.drawCollisionBoxes(collisionBoxShader, store);
}