aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-20 22:05:05 +0200
committermakamys <makamys@outlook.com>2022-06-20 22:05:05 +0200
commit413bee34e68e977a779a95a0c2e89d60c254d261 (patch)
tree415796ef6b57519195d0a952f89d884df78c928d /src/main/java
parent42b814f0470317661a23aa1403041cad27ec880f (diff)
downloadNeodymium-413bee34e68e977a779a95a0c2e89d60c254d261.tar.gz
Neodymium-413bee34e68e977a779a95a0c2e89d60c254d261.tar.bz2
Neodymium-413bee34e68e977a779a95a0c2e89d60c254d261.zip
Fix lava rendering
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/makamys/neodymium/renderer/MeshQuad.java16
1 files changed, 12 insertions, 4 deletions
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;