diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/TerrainZapperRenderHandler.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/TerrainZapperRenderHandler.java index 7d0713865..4e6be429d 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/TerrainZapperRenderHandler.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/TerrainZapperRenderHandler.java @@ -35,6 +35,7 @@ public class TerrainZapperRenderHandler { CreateClient.outliner.showCluster("terrainZapper", shape.stream() .map(pos -> pos.add(renderedPosition)) .collect(Collectors.toList())) + .colored(0x999999) .disableNormals() .lineWidth(1 / 32f) .withFaceTexture(AllSpecialTextures.CHECKERED); diff --git a/src/main/java/com/simibubi/create/content/schematics/client/SchematicHandler.java b/src/main/java/com/simibubi/create/content/schematics/client/SchematicHandler.java index 8fa30c538..6c5348ed0 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/SchematicHandler.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/SchematicHandler.java @@ -124,6 +124,13 @@ public class SchematicHandler { if (!active && !present) return; + if (active) { + ms.push(); + currentTool.getTool() + .renderTool(ms, buffer, light, overlay); + ms.pop(); + } + ms.push(); transformation.applyGLTransformations(ms); renderer.render(ms, buffer); @@ -132,12 +139,6 @@ public class SchematicHandler { .renderOnSchematic(ms, buffer, light, overlay); ms.pop(); - if (active) { - ms.push(); - currentTool.getTool() - .renderTool(ms, buffer, light, overlay); - ms.pop(); - } } public void renderOverlay(MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) { diff --git a/src/main/java/com/simibubi/create/content/schematics/client/tools/DeployTool.java b/src/main/java/com/simibubi/create/content/schematics/client/tools/DeployTool.java index bcc3c441a..ba3014aec 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/tools/DeployTool.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/tools/DeployTool.java @@ -69,8 +69,6 @@ public class DeployTool extends PlacementToolBase { .translateBack(origin); AABBOutline outline = schematicHandler.getOutline(); - outline.getParams() - .withFaceTexture(AllSpecialTextures.CHECKERED); outline.render(ms, buffer); outline.getParams() .clearTextures(); diff --git a/src/main/java/com/simibubi/create/content/schematics/client/tools/FlipTool.java b/src/main/java/com/simibubi/create/content/schematics/client/tools/FlipTool.java index da38da662..8219d6d58 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/tools/FlipTool.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/tools/FlipTool.java @@ -49,11 +49,11 @@ public class FlipTool extends PlacementToolBase { @Override public void renderOnSchematic(MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) { - super.renderOnSchematic(ms, buffer, light, overlay); - if (!schematicSelected || !selectedFace.getAxis() - .isHorizontal()) + .isHorizontal()) { + super.renderOnSchematic(ms, buffer, light, overlay); return; + } Direction facing = selectedFace.rotateY(); AxisAlignedBB bounds = schematicHandler.getBounds(); @@ -66,15 +66,18 @@ public class FlipTool extends PlacementToolBase { .grow(1 - directionVec.x, 1 - directionVec.y, 1 - directionVec.z); bounds = bounds.offset(directionVec.scale(.5f) .mul(boundsSize)); - + outline.setBounds(bounds); - AllSpecialTextures tex = AllSpecialTextures.HIGHLIGHT_CHECKERED; + AllSpecialTextures tex = AllSpecialTextures.CHECKERED; outline.getParams() .lineWidth(1 / 16f) + .disableCull() .disableNormals() - .colored(0x4d80e4) + .colored(0xdddddd) .withFaceTextures(tex, tex); outline.render(ms, buffer); + + super.renderOnSchematic(ms, buffer, light, overlay); } } diff --git a/src/main/java/com/simibubi/create/content/schematics/client/tools/RotateTool.java b/src/main/java/com/simibubi/create/content/schematics/client/tools/RotateTool.java index c964548d8..884449af0 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/tools/RotateTool.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/tools/RotateTool.java @@ -21,8 +21,6 @@ public class RotateTool extends PlacementToolBase { @Override public void renderOnSchematic(MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) { - super.renderOnSchematic(ms, buffer, light, overlay); - AxisAlignedBB bounds = schematicHandler.getBounds(); double height = bounds.getYSize() + Math.max(20, bounds.getYSize()); Vec3d center = bounds.getCenter() @@ -32,12 +30,14 @@ public class RotateTool extends PlacementToolBase { Vec3d end = center.add(0, height / 2, 0); line.getParams() - .colored(0x4d80e4) .disableCull() .disableNormals() + .colored(0xdddddd) .lineWidth(1 / 16f); line.set(start, end) .render(ms, buffer); + + super.renderOnSchematic(ms, buffer, light, overlay); } } diff --git a/src/main/java/com/simibubi/create/content/schematics/client/tools/SchematicToolBase.java b/src/main/java/com/simibubi/create/content/schematics/client/tools/SchematicToolBase.java index a99063f82..dd6faf060 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/tools/SchematicToolBase.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/tools/SchematicToolBase.java @@ -139,10 +139,13 @@ public abstract class SchematicToolBase implements ISchematicTool { AllKeys.ctrlDown() ? AllSpecialTextures.HIGHLIGHT_CHECKERED : AllSpecialTextures.CHECKERED); } outline.getParams() + .colored(0x6886c5) + .withFaceTexture(AllSpecialTextures.CHECKERED) + .lineWidth(1 / 32f) .disableCull(); outline.render(ms, buffer); outline.getParams() - .withFaceTextures(null, null); + .clearTextures(); ms.pop(); } diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/AABBOutline.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/AABBOutline.java index 860b05ed9..00afe8283 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/AABBOutline.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/AABBOutline.java @@ -2,6 +2,7 @@ package com.simibubi.create.foundation.utility.outliner; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.simibubi.create.AllSpecialTextures; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; @@ -40,6 +41,9 @@ public class AABBOutline extends Outline { Vec3d XyZ = new Vec3d(bb.maxX, bb.minY, bb.maxZ); Vec3d xYZ = new Vec3d(bb.minX, bb.maxY, bb.maxZ); Vec3d XYZ = new Vec3d(bb.maxX, bb.maxY, bb.maxZ); + + // Buffers with no Culling only seem to work right with when this line is present + buffer.getBuffer(RenderType.getEntityCutout(AllSpecialTextures.BLANK.getLocation())); Vec3d start = xyz; renderAACuboidLine(ms, buffer, start, Xyz, noCull); @@ -70,15 +74,16 @@ public class AABBOutline extends Outline { } - //TODO noCull has no effect protected void renderFace(MatrixStack ms, IRenderTypeBuffer buffer, Direction direction, Vec3d p1, Vec3d p2, Vec3d p3, Vec3d p4, boolean noCull) { if (!params.faceTexture.isPresent()) return; - - ResourceLocation faceTexture = params.faceTexture.get().getLocation(); + + ResourceLocation faceTexture = params.faceTexture.get() + .getLocation(); if (direction == params.getHighlightedFace() && params.hightlightedFaceTexture.isPresent()) - faceTexture = params.hightlightedFaceTexture.get().getLocation(); + faceTexture = params.hightlightedFaceTexture.get() + .getLocation(); RenderType translucentType = noCull ? RenderType.getEntityTranslucent(faceTexture) : RenderType.getEntityTranslucentCull(faceTexture); diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java index aee7c22ee..2b313a18a 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java @@ -31,7 +31,6 @@ public abstract class Outline { public abstract void render(MatrixStack ms, IRenderTypeBuffer buffer); - //TODO noCull has no effect public void renderAACuboidLine(MatrixStack ms, IRenderTypeBuffer buffer, Vec3d start, Vec3d end, boolean noCull) { ResourceLocation tex = AllSpecialTextures.BLANK.getLocation(); IVertexBuilder builder =