parent
857b2318f9
commit
c0efc78d37
@ -47,6 +47,11 @@ public class BuildingLayer extends Layer implements TileLoaderThemeHook, ZoomLim
|
||||
public final static int MIN_ZOOM = 17;
|
||||
|
||||
public static boolean POST_AA = false;
|
||||
|
||||
/**
|
||||
* Don't draw extrusions which are covered by others.
|
||||
* Especially if the side of extrusion is translucent.
|
||||
*/
|
||||
public static boolean TRANSLUCENT = true;
|
||||
|
||||
private static final Object BUILDING_DATA = BuildingLayer.class.getName();
|
||||
@ -83,8 +88,9 @@ public class BuildingLayer extends Layer implements TileLoaderThemeHook, ZoomLim
|
||||
// Use zoomMin as zoomLimit to render buildings only once
|
||||
mZoomLimiter = new ZoomLimiter(tileLayer.getManager(), zoomMin, zoomMax, zoomMin);
|
||||
|
||||
// Covered extrusions must be drawn for mesh renderer
|
||||
mRenderer = new BuildingRenderer(tileLayer.tileRenderer(), mZoomLimiter,
|
||||
mesh, !mesh && TRANSLUCENT); // alpha must be disabled for mesh renderer
|
||||
mesh, !mesh && TRANSLUCENT);
|
||||
if (POST_AA)
|
||||
mRenderer = new OffscreenRenderer(Mode.SSAO_FXAA, mRenderer);
|
||||
}
|
||||
|
@ -54,8 +54,8 @@ public class BuildingRenderer extends ExtrusionRenderer {
|
||||
private boolean mShow;
|
||||
|
||||
public BuildingRenderer(TileRenderer tileRenderer, ZoomLimiter zoomLimiter,
|
||||
boolean mesh, boolean alpha) {
|
||||
super(mesh, alpha);
|
||||
boolean mesh, boolean translucent) {
|
||||
super(mesh, translucent);
|
||||
|
||||
mZoomLimiter = zoomLimiter;
|
||||
mTileRenderer = tileRenderer;
|
||||
|
@ -32,7 +32,9 @@ import static org.oscim.renderer.MapRenderer.COORD_SCALE;
|
||||
public abstract class ExtrusionRenderer extends LayerRenderer {
|
||||
static final Logger log = LoggerFactory.getLogger(ExtrusionRenderer.class);
|
||||
|
||||
// Don't draw extrusions which are covered by others
|
||||
private final boolean mTranslucent;
|
||||
|
||||
private final int mMode;
|
||||
private Shader mShader;
|
||||
|
||||
@ -42,9 +44,9 @@ public abstract class ExtrusionRenderer extends LayerRenderer {
|
||||
|
||||
private float mZLimit = Float.MAX_VALUE;
|
||||
|
||||
public ExtrusionRenderer(boolean mesh, boolean alpha) {
|
||||
public ExtrusionRenderer(boolean mesh, boolean translucent) {
|
||||
mMode = mesh ? 1 : 0;
|
||||
mTranslucent = alpha;
|
||||
mTranslucent = translucent;
|
||||
}
|
||||
|
||||
public static class Shader extends GLShader {
|
||||
|
Loading…
x
Reference in New Issue
Block a user