Skip to content
Snippets Groups Projects
Commit 7b46d3b6 authored by Johannes Fritz's avatar Johannes Fritz Committed by paramat
Browse files

Stairs: Add backface culling to stair meshes

If backface culling is not specified for a tile in 'images' it is set to true.
Slabs already have backface culling due to being defined as nodeboxes (which
are then converted to meshnodes).
parent bdc09d23
No related branches found
No related tags found
No related merge requests found
......@@ -46,12 +46,24 @@ end
-- Node will be called stairs:stair_<subname>
function stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
local stair_images = {}
for i, image in ipairs(images) do
if type(image) == "string" then
stair_images[i] = {
name = image,
backface_culling = true,
}
elseif image.backface_culling == nil then -- override using any other value
stair_images[i] = table.copy(image)
stair_images[i].backface_culling = true
end
end
groups.stair = 1
minetest.register_node(":stairs:stair_" .. subname, {
description = description,
drawtype = "mesh",
mesh = "stairs_stair.obj",
tiles = images,
tiles = stair_images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment