From 413bee34e68e977a779a95a0c2e89d60c254d261 Mon Sep 17 00:00:00 2001 From: makamys Date: Mon, 20 Jun 2022 22:05:05 +0200 Subject: Fix lava rendering --- src/main/java/makamys/neodymium/renderer/MeshQuad.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/makamys/neodymium/renderer/MeshQuad.java b/src/main/java/makamys/neodymium/renderer/MeshQuad.java index 3759c65..ff1cb40 100644 --- a/src/main/java/makamys/neodymium/renderer/MeshQuad.java +++ b/src/main/java/makamys/neodymium/renderer/MeshQuad.java @@ -134,10 +134,18 @@ public class MeshQuad { out.writeInt(c); - out.writeByte(us[vi] == us[provokingI] ? 0 : (byte)quadCountByUVDirection(false)); - out.writeByte(vs[vi] == vs[provokingI] ? 0 : (byte)quadCountByUVDirection(true)); - out.writeByte(us[vi] == us[provokingI] ? (byte)0 : 1); - out.writeByte(vs[vi] == vs[provokingI] ? (byte)0 : 1); + if((quadCountByUVDirection(false) == 1 && quadCountByUVDirection(true) == 1)) { + // let the fragment shader know this is not a megaquad + out.writeByte((byte)255); + out.writeByte((byte)255); + out.writeByte((byte)255); + out.writeByte((byte)255); + } else { + out.writeByte(us[vi] == us[provokingI] ? 0 : (byte)quadCountByUVDirection(false)); + out.writeByte(vs[vi] == vs[provokingI] ? 0 : (byte)quadCountByUVDirection(true)); + out.writeByte(us[vi] == us[provokingI] ? (byte)0 : 1); + out.writeByte(vs[vi] == vs[provokingI] ? (byte)0 : 1); + } assert out.position() % getStride() == 0; -- cgit