@@ -385,9 +385,16 @@ void MapblockMeshGenerator::prepareLiquidNodeDrawing()
385
385
getSpecialTile (1 , &tile_liquid);
386
386
387
387
MapNode ntop = data->m_vmanip .getNodeNoEx (blockpos_nodes + v3s16 (p.X , p.Y + 1 , p.Z ));
388
+ MapNode nbottom = data->m_vmanip .getNodeNoEx (blockpos_nodes + v3s16 (p.X , p.Y - 1 , p.Z ));
388
389
c_flowing = nodedef->getId (f->liquid_alternative_flowing );
389
390
c_source = nodedef->getId (f->liquid_alternative_source );
390
391
top_is_same_liquid = (ntop.getContent () == c_flowing) || (ntop.getContent () == c_source);
392
+ draw_liquid_bottom = (nbottom.getContent () != c_flowing) && (nbottom.getContent () != c_source);
393
+ if (draw_liquid_bottom) {
394
+ const ContentFeatures &f2 = nodedef->get (nbottom.getContent ());
395
+ if (f2.solidness > 1 )
396
+ draw_liquid_bottom = false ;
397
+ }
391
398
392
399
if (data->m_smooth_lighting )
393
400
return ; // don't need to pre-compute anything in this case
@@ -595,6 +602,24 @@ void MapblockMeshGenerator::drawLiquidTop()
595
602
collector->append (tile_liquid_top, vertices, 4 , quad_indices, 6 );
596
603
}
597
604
605
+ void MapblockMeshGenerator::drawLiquidBottom ()
606
+ {
607
+ video::S3DVertex vertices[4 ] = {
608
+ video::S3DVertex (-BS / 2 , -BS / 2 , -BS / 2 , 0 , 0 , 0 , color_liquid_top, 0 , 0 ),
609
+ video::S3DVertex ( BS / 2 , -BS / 2 , -BS / 2 , 0 , 0 , 0 , color_liquid_top, 1 , 0 ),
610
+ video::S3DVertex ( BS / 2 , -BS / 2 , BS / 2 , 0 , 0 , 0 , color_liquid_top, 1 , 1 ),
611
+ video::S3DVertex (-BS / 2 , -BS / 2 , BS / 2 , 0 , 0 , 0 , color_liquid_top, 0 , 1 ),
612
+ };
613
+
614
+ for (int i = 0 ; i < 4 ; i++) {
615
+ if (data->m_smooth_lighting )
616
+ vertices[i].Color = blendLightColor (vertices[i].Pos );
617
+ vertices[i].Pos += origin;
618
+ }
619
+
620
+ collector->append (tile_liquid_top, vertices, 4 , quad_indices, 6 );
621
+ }
622
+
598
623
void MapblockMeshGenerator::drawLiquidNode ()
599
624
{
600
625
prepareLiquidNodeDrawing ();
@@ -603,6 +628,8 @@ void MapblockMeshGenerator::drawLiquidNode()
603
628
drawLiquidSides ();
604
629
if (!top_is_same_liquid)
605
630
drawLiquidTop ();
631
+ if (draw_liquid_bottom)
632
+ drawLiquidBottom ();
606
633
}
607
634
608
635
void MapblockMeshGenerator::drawGlasslikeNode ()
0 commit comments