encode icon texture coordinate in buffer so we can render all pois with 1 draw call

This commit is contained in:
Konstantin Käfer
2014-05-15 17:19:14 +02:00
parent 264bcd34d9
commit 27f8ed29e4
22 changed files with 120 additions and 253 deletions

View File

@@ -28,7 +28,7 @@ void Painter::renderText(TextBucket& bucket, const std::string& layer_name, cons
}
// If layerStyle.size > bucket.info.fontSize then labels may collide
float fontSize = std::fmin(properties.size, bucket.geom_desc.font_size);
float fontSize = std::fmin(properties.size, bucket.geom_desc.size);
matrix::scale(exMatrix, exMatrix, fontSize / 24.0f, fontSize / 24.0f, 1.0f);
const mat4 &vtxMatrix = translatedMatrix(properties.translate, id, properties.translateAnchor);
@@ -47,7 +47,7 @@ void Painter::renderText(TextBucket& bucket, const std::string& layer_name, cons
float angle = std::round((map.getState().getAngle() + rotate) / M_PI * 128);
// adjust min/max zooms for variable font sies
float zoomAdjust = log(fontSize / bucket.geom_desc.font_size) / log(2);
float zoomAdjust = log(fontSize / bucket.geom_desc.size) / log(2);
textShader->setAngle((int32_t)(angle + 256) % 256);
textShader->setFlip(bucket.geom_desc.path == TextPathType::Curve ? 1 : 0);