diff --git a/game_api.txt b/game_api.txt index 3f311336..98a8200b 100644 --- a/game_api.txt +++ b/game_api.txt @@ -792,7 +792,9 @@ Creates panes that automatically connect to each other groups = {group = rating}, -- Uses the known node groups, see [Known damage and digging time defining groups] sounds = SoundSpec, -- See [#Default sounds] recipe = {{"","","","","","","","",""}}, -- Recipe field only - use_texture_alpha = true, -- Optional boolean (default: `false`) for colored glass panes + use_texture_alpha = true, + -- ^ Set to 'false' for opaque panes, to increase rendering + -- performance. Default is 'true' } diff --git a/mods/beds/api.lua b/mods/beds/api.lua index cab2def5..18ad064f 100644 --- a/mods/beds/api.lua +++ b/mods/beds/api.lua @@ -31,6 +31,7 @@ function beds.register_bed(name, def) wield_image = def.wield_image, drawtype = "nodebox", tiles = def.tiles.bottom, + use_texture_alpha = true, paramtype = "light", paramtype2 = "facedir", is_ground_content = false, @@ -151,6 +152,7 @@ function beds.register_bed(name, def) minetest.register_node(name .. "_top", { drawtype = "nodebox", tiles = def.tiles.top, + use_texture_alpha = true, paramtype = "light", paramtype2 = "facedir", is_ground_content = false, diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 3a4f8fc9..2f3e59a6 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -449,6 +449,7 @@ function default.register_mesepost(name, def) }, paramtype = "light", tiles = {def.texture, def.texture, post_texture_dark, post_texture_dark, post_texture, post_texture}, + use_texture_alpha = true, light_source = default.LIGHT_MAX, sunlight_propagates = true, is_ground_content = false, diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 4b6fb509..81c19948 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -2565,6 +2565,7 @@ local function register_sign(material, desc, def) description = desc, drawtype = "nodebox", tiles = {"default_sign_wall_" .. material .. ".png"}, + use_texture_alpha = true, inventory_image = "default_sign_" .. material .. ".png", wield_image = "default_sign_" .. material .. ".png", paramtype = "light", @@ -2793,6 +2794,7 @@ minetest.register_node("default:glass", { description = S("Glass"), drawtype = "glasslike_framed_optional", tiles = {"default_glass.png", "default_glass_detail.png"}, + use_texture_alpha = true, paramtype = "light", paramtype2 = "glasslikeliquidlevel", sunlight_propagates = true, @@ -2805,6 +2807,7 @@ minetest.register_node("default:obsidian_glass", { description = S("Obsidian Glass"), drawtype = "glasslike_framed_optional", tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"}, + use_texture_alpha = true, paramtype = "light", paramtype2 = "glasslikeliquidlevel", is_ground_content = false, diff --git a/mods/default/torch.lua b/mods/default/torch.lua index c06dee8f..465d4429 100644 --- a/mods/default/torch.lua +++ b/mods/default/torch.lua @@ -29,6 +29,7 @@ minetest.register_node("default:torch", { name = "default_torch_on_floor_animated.png", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3} }}, + use_texture_alpha = true, paramtype = "light", paramtype2 = "wallmounted", sunlight_propagates = true, @@ -81,6 +82,7 @@ minetest.register_node("default:torch_wall", { name = "default_torch_on_floor_animated.png", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3} }}, + use_texture_alpha = true, paramtype = "light", paramtype2 = "wallmounted", sunlight_propagates = true, @@ -105,6 +107,7 @@ minetest.register_node("default:torch_ceiling", { name = "default_torch_on_floor_animated.png", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3} }}, + use_texture_alpha = true, paramtype = "light", paramtype2 = "wallmounted", sunlight_propagates = true, diff --git a/mods/doors/init.lua b/mods/doors/init.lua index 2048a643..6aab79b9 100644 --- a/mods/doors/init.lua +++ b/mods/doors/init.lua @@ -428,6 +428,7 @@ function doors.register(name, def) def.drawtype = "mesh" def.paramtype = "light" def.paramtype2 = "facedir" + def.use_texture_alpha = true def.sunlight_propagates = true def.walkable = true def.is_ground_content = false @@ -578,6 +579,7 @@ function doors.register_trapdoor(name, def) def.drawtype = "nodebox" def.paramtype = "light" def.paramtype2 = "facedir" + def.use_texture_alpha = true def.is_ground_content = false if def.protected then diff --git a/mods/flowers/init.lua b/mods/flowers/init.lua index 97317501..c1a7cac3 100644 --- a/mods/flowers/init.lua +++ b/mods/flowers/init.lua @@ -277,6 +277,7 @@ local waterlily_def = { paramtype = "light", paramtype2 = "facedir", tiles = {"flowers_waterlily.png", "flowers_waterlily_bottom.png"}, + use_texture_alpha = true, inventory_image = "flowers_waterlily.png", wield_image = "flowers_waterlily.png", liquids_pointable = true, diff --git a/mods/stairs/init.lua b/mods/stairs/init.lua index bba6e62b..b9daab06 100644 --- a/mods/stairs/init.lua +++ b/mods/stairs/init.lua @@ -61,6 +61,8 @@ end function stairs.register_stair(subname, recipeitem, groups, images, description, sounds, worldaligntex) + local src_def = minetest.registered_nodes[recipeitem] + -- Set backface culling and world-aligned textures local stair_images = {} for i, image in ipairs(images) do @@ -82,6 +84,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description, end end end + local new_groups = table.copy(groups) new_groups.stair = 1 warn_if_exists("stairs:stair_" .. subname) @@ -89,6 +92,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description, description = description, drawtype = "nodebox", tiles = stair_images, + use_texture_alpha = src_def and src_def.use_texture_alpha, paramtype = "light", paramtype2 = "facedir", is_ground_content = false, @@ -160,6 +164,8 @@ end function stairs.register_slab(subname, recipeitem, groups, images, description, sounds, worldaligntex) + local src_def = minetest.registered_nodes[recipeitem] + -- Set world-aligned textures local slab_images = {} for i, image in ipairs(images) do @@ -184,6 +190,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description, description = description, drawtype = "nodebox", tiles = slab_images, + use_texture_alpha = src_def and src_def.use_texture_alpha, paramtype = "light", paramtype2 = "facedir", is_ground_content = false, @@ -297,6 +304,8 @@ end function stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds, worldaligntex, full_description) + local src_def = minetest.registered_nodes[recipeitem] + -- Set backface culling and world-aligned textures local stair_images = {} for i, image in ipairs(images) do @@ -330,6 +339,7 @@ function stairs.register_stair_inner(subname, recipeitem, groups, images, description = description, drawtype = "nodebox", tiles = stair_images, + use_texture_alpha = src_def and src_def.use_texture_alpha, paramtype = "light", paramtype2 = "facedir", is_ground_content = false, @@ -384,6 +394,8 @@ end function stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds, worldaligntex, full_description) + local src_def = minetest.registered_nodes[recipeitem] + -- Set backface culling and world-aligned textures local stair_images = {} for i, image in ipairs(images) do @@ -417,6 +429,7 @@ function stairs.register_stair_outer(subname, recipeitem, groups, images, description = description, drawtype = "nodebox", tiles = stair_images, + use_texture_alpha = src_def and src_def.use_texture_alpha, paramtype = "light", paramtype2 = "facedir", is_ground_content = false, diff --git a/mods/xpanes/init.lua b/mods/xpanes/init.lua index e195dbbc..3180d929 100644 --- a/mods/xpanes/init.lua +++ b/mods/xpanes/init.lua @@ -113,10 +113,10 @@ function xpanes.register_pane(name, def) def.textures[1], def.textures[1] }, + use_texture_alpha = def.use_texture_alpha ~= false, groups = flatgroups, drop = "xpanes:" .. name .. "_flat", sounds = def.sounds, - use_texture_alpha = def.use_texture_alpha or false, node_box = { type = "fixed", fixed = {{-1/2, -1/2, -1/32, 1/2, 1/2, 1/32}}, @@ -142,10 +142,10 @@ function xpanes.register_pane(name, def) def.textures[3], def.textures[1] }, + use_texture_alpha = def.use_texture_alpha ~= false, groups = groups, drop = "xpanes:" .. name .. "_flat", sounds = def.sounds, - use_texture_alpha = def.use_texture_alpha or false, node_box = { type = "connected", fixed = {{-1/32, -1/2, -1/32, 1/32, 1/2, 1/32}},