From f335ceba3a860b293c28cfbced1273f4918b6ff4 Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Fri, 14 Feb 2020 20:20:49 +0100 Subject: [PATCH] transparent water --- static/js/test.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/static/js/test.js b/static/js/test.js index 73ea90b..573eacc 100644 --- a/static/js/test.js +++ b/static/js/test.js @@ -22,6 +22,13 @@ function getMaterial(nodeName){ var color = new THREE.Color( colorObj.r/256, colorObj.g/256, colorObj.b/256 ); material = new THREE.MeshBasicMaterial( { color: color } ); + + if (nodeName == "default:water_source"){ + material.transparent = true; + material.opacity = 0.8; + material.clipIntersection = true; + } + materialCache[nodeName] = material; } @@ -36,7 +43,7 @@ function isNodeHidden(mapblock,x,y,z){ function isTransparent(contentId){ var nodeName = mapblock.blockmapping[contentId]; - return nodeName == "air"; + return nodeName == "air" || nodeName == "default:water_source"; } if (isTransparent(mapblock.contentid[getNodePos(x-1,y,z)]))