]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Add bumpmapping and parallax occlusion testing nodes to devtest (#9242)
authorHybridDog <3192173+HybridDog@users.noreply.github.com>
Fri, 9 Oct 2020 18:13:42 +0000 (20:13 +0200)
committerGitHub <noreply@github.com>
Fri, 9 Oct 2020 18:13:42 +0000 (19:13 +0100)
games/devtest/mods/testnodes/mod.conf
games/devtest/mods/testnodes/textures.lua
games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png [new file with mode: 0644]
games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png [new file with mode: 0644]
games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png [new file with mode: 0644]
games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png [new file with mode: 0644]

index 4824c6ed086ddc2f914263c4a57088f97b9e30ed..d894c3452e27553ba21d4457cb16fa67120f0652 100644 (file)
@@ -1,2 +1,3 @@
 name = testnodes
 description = Contains a bunch of basic example nodes for demonstrative purposes, development and testing
+depends = stairs
index 6ffef8fe935a5e250049a254d28c762821d23778..e0724c2291a6e7104489a39cb3bf576ed7673212 100644 (file)
@@ -71,3 +71,52 @@ for a=1,#alphas do
                groups = { dig_immediate = 3 },
        })
 end
+
+
+-- Bumpmapping and Parallax Occlusion
+
+-- This node has a normal map which corresponds to a pyramid with sides tilted
+-- by an angle of 45°, i.e. the normal map contains four vectors which point
+-- diagonally away from the surface (e.g. (0.7, 0.7, 0)),
+-- and the heights in the height map linearly increase towards the centre,
+-- so that the surface corresponds to a simple pyramid.
+-- The node can help to determine if e.g. tangent space transformations work
+-- correctly.
+-- If, for example, the light comes from above, then the (tilted) pyramids
+-- should look like they're lit from this light direction on all node faces.
+-- The white albedo texture has small black indicators which can be used to see
+-- how it is transformed ingame (and thus see if there's rotation around the
+-- normal vector).
+minetest.register_node("testnodes:height_pyramid", {
+       description = "Bumpmapping and Parallax Occlusion Tester (height pyramid)",
+       tiles = {"testnodes_height_pyramid.png"},
+       groups = {dig_immediate = 3},
+})
+
+-- The stairs nodes should help to validate if shading works correctly for
+-- rotated nodes (which have rotated textures).
+stairs.register_stair_and_slab("height_pyramid", "experimantal:height_pyramid",
+       {dig_immediate = 3},
+       {"testnodes_height_pyramid.png"},
+       "Bumpmapping and Parallax Occlusion Tester Stair (height pyramid)",
+       "Bumpmapping and Parallax Occlusion Tester Slab (height pyramid)")
+
+-- This node has a simple heightmap for parallax occlusion testing and flat
+-- normalmap.
+-- When parallax occlusion is enabled, the yellow scrawl should stick out of
+-- the texture when viewed at an angle.
+minetest.register_node("testnodes:parallax_extruded", {
+       description = "Parallax Occlusion Tester",
+       tiles = {"testnodes_parallax_extruded.png"},
+       groups = {dig_immediate = 3},
+})
+
+-- Analogously to the height pyramid stairs nodes,
+-- these nodes should help to validate if parallax occlusion works correctly for
+-- rotated nodes (which have rotated textures).
+stairs.register_stair_and_slab("parallax_extruded",
+       "experimantal:parallax_extruded",
+       {dig_immediate = 3},
+       {"testnodes_parallax_extruded.png"},
+       "Parallax Occlusion Tester Stair",
+       "Parallax Occlusion Tester Slab")
diff --git a/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png
new file mode 100644 (file)
index 0000000..8c787b7
Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png differ
diff --git a/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png
new file mode 100644 (file)
index 0000000..5ab7865
Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png differ
diff --git a/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png
new file mode 100644 (file)
index 0000000..7e1c323
Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png differ
diff --git a/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png
new file mode 100644 (file)
index 0000000..b134699
Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png differ