diff options
author | Paramat <paramat@users.noreply.github.com> | 2019-03-27 00:18:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-27 00:18:43 +0000 |
commit | 42e1a127140965cac1be6e51e48192e341c2a29e (patch) | |
tree | 9c1d824e6b70838a13afa4870f219108d4d97899 /src/nodedef.cpp | |
parent | 5e7662ca168b47ed3e81901d53bff2eb712f571c (diff) | |
download | minetest-42e1a127140965cac1be6e51e48192e341c2a29e.tar.gz minetest-42e1a127140965cac1be6e51e48192e341c2a29e.tar.bz2 minetest-42e1a127140965cac1be6e51e48192e341c2a29e.zip |
Require 'waving = 3' in a nodedef to apply the liquid waving shader (#8418)
Makes the liquid waving shader per-nodedef like waving leaves/plants,
instead of being applied to all liquids.
Like the waving leaves/plants shaders, the liquid waving shader can
also be applied to meshes and nodeboxes.
Derived from a PR by t0ny2.
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r-- | src/nodedef.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp index 03a163bd3..83e3968c3 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -798,6 +798,8 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc material_type = TILE_MATERIAL_WAVING_PLANTS; else if (waving == 2) material_type = TILE_MATERIAL_WAVING_LEAVES; + else if (waving == 3) + material_type = TILE_MATERIAL_WAVING_LIQUID_BASIC; break; case NDT_TORCHLIKE: case NDT_SIGNLIKE: @@ -815,8 +817,14 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc correctAlpha(tdef, 6); correctAlpha(tdef_overlay, 6); correctAlpha(tdef_spec, CF_SPECIAL_COUNT); - material_type = (alpha == 255) ? - TILE_MATERIAL_LIQUID_OPAQUE : TILE_MATERIAL_LIQUID_TRANSPARENT; + + if (waving == 3) { + material_type = (alpha == 255) ? TILE_MATERIAL_WAVING_LIQUID_OPAQUE : + TILE_MATERIAL_WAVING_LIQUID_TRANSPARENT; + } else { + material_type = (alpha == 255) ? TILE_MATERIAL_LIQUID_OPAQUE : + TILE_MATERIAL_LIQUID_TRANSPARENT; + } } u32 tile_shader = shdsrc->getShader("nodes_shader", material_type, drawtype); |