More fluid model fixes

This commit is contained in:
Mike Primm 2018-09-02 22:17:53 -05:00
parent ff54f1abe0
commit ae35d5b6aa
2 changed files with 10 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;
}
}
/**