diff --git a/src/main/java/org/osm2world/core/world/modules/building/WallSurface.java b/src/main/java/org/osm2world/core/world/modules/building/WallSurface.java index 392c067d..205f25b6 100644 --- a/src/main/java/org/osm2world/core/world/modules/building/WallSurface.java +++ b/src/main/java/org/osm2world/core/world/modules/building/WallSurface.java @@ -173,24 +173,26 @@ public void renderTo(Target target, VectorXZ textureOrigin, /* draw insets around the elements */ - for (WallElement e : elements) { - if (e.insetDistance() > 0) { + if (renderElements) { + for (WallElement e : elements) { + if (e.insetDistance() > 0) { - PolygonXYZ frontOutline = convertTo3D(e.outline()); - PolygonXYZ backOutline = frontOutline.add(normalAt(e.outline().getCentroid()).mult(-e.insetDistance())); + PolygonXYZ frontOutline = convertTo3D(e.outline()); + PolygonXYZ backOutline = frontOutline.add(normalAt(e.outline().getCentroid()).mult(-e.insetDistance())); - List vsWall = createTriangleStripBetween( - backOutline.vertices(), frontOutline.vertices()); + List vsWall = createTriangleStripBetween( + backOutline.vertices(), frontOutline.vertices()); - Material material = this.material; - // TODO attempt to simulate ambient occlusion with a different baked ao texture? + Material material = this.material; + // TODO attempt to simulate ambient occlusion with a different baked ao texture? - target.drawTriangleStrip(material, vsWall, - texCoordLists(vsWall, material, NamedTexCoordFunction.STRIP_WALL)); + target.drawTriangleStrip(material, vsWall, + texCoordLists(vsWall, material, NamedTexCoordFunction.STRIP_WALL)); + } } } - + /* decompose and triangulate the empty wall surface */ List holes = elements.stream().map(WallElement::outline).collect(toList());