]> git.lizzy.rs Git - dragonfireclient.git/blob - games/devtest/mods/testnodes/textures.lua
Add Custom version string
[dragonfireclient.git] / games / devtest / mods / testnodes / textures.lua
1 -- Node texture tests
2
3 local S = minetest.get_translator("testnodes")
4
5 minetest.register_node("testnodes:6sides", {
6         description = S("Six Textures Test Node"),
7         tiles = {
8                 "testnodes_normal1.png",
9                 "testnodes_normal2.png",
10                 "testnodes_normal3.png",
11                 "testnodes_normal4.png",
12                 "testnodes_normal5.png",
13                 "testnodes_normal6.png",
14         },
15
16         groups = { dig_immediate = 2 },
17 })
18
19 minetest.register_node("testnodes:anim", {
20         description = S("Animated Test Node"),
21         tiles = {
22                 { name = "testnodes_anim.png",
23                 animation = {
24                         type = "vertical_frames",
25                         aspect_w = 16,
26                         aspect_h = 16,
27                         length = 4.0,
28                 }, },
29         },
30
31         groups = { dig_immediate = 2 },
32 })
33
34 -- Node texture transparency test
35
36 local alphas = { 64, 128, 191 }
37
38 for a=1,#alphas do
39         local alpha = alphas[a]
40
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",
45                 paramtype = "light",
46                 tiles = {
47                         "testnodes_alpha"..alpha..".png",
48                 },
49                 use_texture_alpha = true,
50
51                 groups = { dig_immediate = 3 },
52         })
53
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
58                 drawtype = "liquid",
59                 paramtype = "light",
60                 tiles = {
61                         "testnodes_alpha.png",
62                 },
63                 alpha = alpha,
64
65
66                 liquidtype = "source",
67                 liquid_range = 0,
68                 liquid_viscosity = 0,
69                 liquid_alternative_source = "testnodes:alpha_"..alpha,
70                 liquid_alternative_flowing = "testnodes:alpha_"..alpha,
71                 groups = { dig_immediate = 3 },
72         })
73 end
74
75
76 -- Bumpmapping and Parallax Occlusion
77
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
84 -- correctly.
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
89 -- normal vector).
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},
94 })
95
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",
99         {dig_immediate = 3},
100         {"testnodes_height_pyramid.png"},
101         "Bumpmapping and Parallax Occlusion Tester Stair (height pyramid)",
102         "Bumpmapping and Parallax Occlusion Tester Slab (height pyramid)")
103
104 -- This node has a simple heightmap for parallax occlusion testing and flat
105 -- normalmap.
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},
112 })
113
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",
119         {dig_immediate = 3},
120         {"testnodes_parallax_extruded.png"},
121         "Parallax Occlusion Tester Stair",
122         "Parallax Occlusion Tester Slab")