transparent water

This commit is contained in:
Thomas Rudin 2020-02-14 20:20:49 +01:00
parent 11347a270d
commit f335ceba3a

View File

@ -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)]))