[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:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user