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 = true,
51 groups = { dig_immediate = 3 },
54 -- Transparency set via "alpha" parameter
55 minetest.register_node("testnodes:alpha_"..alpha, {
56 description = S("Alpha Test Node (@1)", alpha),
57 -- It seems that only the liquid drawtype supports the alpha parameter
61 "testnodes_alpha.png",
66 liquidtype = "source",
69 liquid_alternative_source = "testnodes:alpha_"..alpha,
70 liquid_alternative_flowing = "testnodes:alpha_"..alpha,
71 groups = { dig_immediate = 3 },
76 -- Bumpmapping and Parallax Occlusion
78 -- This node has a normal map which corresponds to a pyramid with sides tilted
79 -- by an angle of 45°, i.e. the normal map contains four vectors which point
80 -- diagonally away from the surface (e.g. (0.7, 0.7, 0)),
81 -- and the heights in the height map linearly increase towards the centre,
82 -- so that the surface corresponds to a simple pyramid.
83 -- The node can help to determine if e.g. tangent space transformations work
85 -- If, for example, the light comes from above, then the (tilted) pyramids
86 -- should look like they're lit from this light direction on all node faces.
87 -- The white albedo texture has small black indicators which can be used to see
88 -- how it is transformed ingame (and thus see if there's rotation around the
90 minetest.register_node("testnodes:height_pyramid", {
91 description = "Bumpmapping and Parallax Occlusion Tester (height pyramid)",
92 tiles = {"testnodes_height_pyramid.png"},
93 groups = {dig_immediate = 3},
96 -- The stairs nodes should help to validate if shading works correctly for
97 -- rotated nodes (which have rotated textures).
98 stairs.register_stair_and_slab("height_pyramid", "experimantal:height_pyramid",
100 {"testnodes_height_pyramid.png"},
101 "Bumpmapping and Parallax Occlusion Tester Stair (height pyramid)",
102 "Bumpmapping and Parallax Occlusion Tester Slab (height pyramid)")
104 -- This node has a simple heightmap for parallax occlusion testing and flat
106 -- When parallax occlusion is enabled, the yellow scrawl should stick out of
107 -- the texture when viewed at an angle.
108 minetest.register_node("testnodes:parallax_extruded", {
109 description = "Parallax Occlusion Tester",
110 tiles = {"testnodes_parallax_extruded.png"},
111 groups = {dig_immediate = 3},
114 -- Analogously to the height pyramid stairs nodes,
115 -- these nodes should help to validate if parallax occlusion works correctly for
116 -- rotated nodes (which have rotated textures).
117 stairs.register_stair_and_slab("parallax_extruded",
118 "experimantal:parallax_extruded",
120 {"testnodes_parallax_extruded.png"},
121 "Parallax Occlusion Tester Stair",
122 "Parallax Occlusion Tester Slab")