3 local S = minetest.get_translator("testnodes")
5 minetest.register_node("testnodes:6sides", {
6 description = S("Six Textures Test Node"),
8 "testnodes_normal1.png",
9 "testnodes_normal2.png",
10 "testnodes_normal3.png",
11 "testnodes_normal4.png",
12 "testnodes_normal5.png",
13 "testnodes_normal6.png",
16 groups = { dig_immediate = 2 },
19 minetest.register_node("testnodes:anim", {
20 description = S("Animated Test Node"),
22 { name = "testnodes_anim.png",
24 type = "vertical_frames",
31 groups = { dig_immediate = 2 },
34 -- Node texture transparency test
36 local alphas = { 64, 128, 191 }
39 local alpha = alphas[a]
41 -- Transparency taken from texture
42 minetest.register_node("testnodes:alpha_texture_"..alpha, {
43 description = S("Texture Alpha Test Node (@1)", alpha),
44 drawtype = "glasslike",
47 "testnodes_alpha"..alpha..".png",
49 use_texture_alpha = "blend",
51 groups = { dig_immediate = 3 },
54 -- Transparency set via texture modifier
55 minetest.register_node("testnodes:alpha_"..alpha, {
56 description = S("Alpha Test Node (@1)", alpha),
57 drawtype = "glasslike",
60 "testnodes_alpha.png^[opacity:" .. alpha,
62 use_texture_alpha = "blend",
64 groups = { dig_immediate = 3 },
69 -- Bumpmapping and Parallax Occlusion
71 -- This node has a normal map which corresponds to a pyramid with sides tilted
72 -- by an angle of 45°, i.e. the normal map contains four vectors which point
73 -- diagonally away from the surface (e.g. (0.7, 0.7, 0)),
74 -- and the heights in the height map linearly increase towards the centre,
75 -- so that the surface corresponds to a simple pyramid.
76 -- The node can help to determine if e.g. tangent space transformations work
78 -- If, for example, the light comes from above, then the (tilted) pyramids
79 -- should look like they're lit from this light direction on all node faces.
80 -- The white albedo texture has small black indicators which can be used to see
81 -- how it is transformed ingame (and thus see if there's rotation around the
83 minetest.register_node("testnodes:height_pyramid", {
84 description = "Bumpmapping and Parallax Occlusion Tester (height pyramid)",
85 tiles = {"testnodes_height_pyramid.png"},
86 groups = {dig_immediate = 3},
89 -- The stairs nodes should help to validate if shading works correctly for
90 -- rotated nodes (which have rotated textures).
91 stairs.register_stair_and_slab("height_pyramid", "experimantal:height_pyramid",
93 {"testnodes_height_pyramid.png"},
94 "Bumpmapping and Parallax Occlusion Tester Stair (height pyramid)",
95 "Bumpmapping and Parallax Occlusion Tester Slab (height pyramid)")
97 -- This node has a simple heightmap for parallax occlusion testing and flat
99 -- When parallax occlusion is enabled, the yellow scrawl should stick out of
100 -- the texture when viewed at an angle.
101 minetest.register_node("testnodes:parallax_extruded", {
102 description = "Parallax Occlusion Tester",
103 tiles = {"testnodes_parallax_extruded.png"},
104 groups = {dig_immediate = 3},
107 -- Analogously to the height pyramid stairs nodes,
108 -- these nodes should help to validate if parallax occlusion works correctly for
109 -- rotated nodes (which have rotated textures).
110 stairs.register_stair_and_slab("parallax_extruded",
111 "experimantal:parallax_extruded",
113 {"testnodes_parallax_extruded.png"},
114 "Parallax Occlusion Tester Stair",
115 "Parallax Occlusion Tester Slab")