From ae35d5b6aa9e0187e7ac47543ef197405b2b2bdf Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sun, 2 Sep 2018 22:17:53 -0500 Subject: [PATCH] More fluid model fixes --- .../src/main/java/org/dynmap/hdmap/TexturePack.java | 3 ++- .../main/java/org/dynmap/hdmap/TexturePackHDShader.java | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/TexturePack.java b/DynmapCore/src/main/java/org/dynmap/hdmap/TexturePack.java index f13433c4..bb9759e2 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/TexturePack.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/TexturePack.java @@ -2717,8 +2717,9 @@ public class TexturePack { /* If clear-inside op, get out early */ if((textop == COLORMOD_CLEARINSIDE) || (textop == COLORMOD_MULTTONED_CLEARINSIDE)) { + DynmapBlockState lasthit = ss.getLastBlockHit(); // Last surface hit, vs last visited /* Check if previous block is same block type as we are: surface is transparent if it is */ - if ((blk.matchingBaseState(lastblocktype) || (blk.isWaterFilled() && lastblocktype.isWaterFilled())) && ps.isOnFace()) { + if (blk.matchingBaseState(lasthit) || ((blk.isWaterFilled() && lasthit.isWaterFilled()) && ps.isOnFace())) { rslt.setTransparent(); return; } diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/TexturePackHDShader.java b/DynmapCore/src/main/java/org/dynmap/hdmap/TexturePackHDShader.java index 8a27a9ab..0fe12de5 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/TexturePackHDShader.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/TexturePackHDShader.java @@ -108,6 +108,7 @@ public class TexturePackHDShader implements HDShader { final private TexturePack scaledtp; final private HDLighting lighting; protected DynmapBlockState lastblk; + protected DynmapBlockState lastblkhit; final boolean do_biome_shading; final boolean do_better_grass; DynLongHashMap ctm_cache; @@ -173,6 +174,7 @@ public class TexturePackHDShader implements HDShader { for(int i = 0; i < color.length; i++) color[i].setTransparent(); setLastBlockState(DynmapBlockState.AIR); + lastblkhit = DynmapBlockState.AIR; } /** @@ -186,6 +188,7 @@ public class TexturePackHDShader implements HDShader { } if (blocktype.isAir()) { + lastblkhit = blocktype; return false; } @@ -195,6 +198,7 @@ public class TexturePackHDShader implements HDShader { if (scaledtp != null) { scaledtp.readColor(ps, mapiter, c, blocktype, lastblocktype, ShaderState.this); } + lastblkhit = blocktype; if (c.getAlpha() > 0) { /* Scale brightness depending upon face */ @@ -318,6 +322,10 @@ public class TexturePackHDShader implements HDShader { public void setLastBlockState(DynmapBlockState new_lastbs) { lastblk = new_lastbs; } + // Return last blockc with surface hit + public DynmapBlockState getLastBlockHit() { + return lastblkhit; + } } /**