initial commit
commit
bbeb7a4ba1
|
@ -0,0 +1,84 @@
|
|||
-- test normal hue-saturation-lightness values
|
||||
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 150)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 120)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 90)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 60)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 0)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -60)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -90)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -120)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -150)
|
||||
|
||||
|
||||
-- with saturation
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 150, 30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 90, 30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 30, 30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 0, 30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -30, 30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -90, 30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -150, 30)
|
||||
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 150, 70)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 90, 70)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 30, 70)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 0, 70)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -30, 70)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -90, 70)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -150, 70)
|
||||
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 150, -30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 90, -30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 30, -30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 0, -30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -30, -30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -90, -30)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -150, -30)
|
||||
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 150, -70)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 90, -70)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 30, -70)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 0, -70)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -30, -70)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -90, -70)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -150, -70)
|
||||
|
||||
-- with saturation and lightness
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 150, 70, 50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 90, 70, 50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 0, 70, 50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -90, 70, 50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -150, 70, 50)
|
||||
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 150, 0, 50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 30, 0, 50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 0, 0, 50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -30, 0, 50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -150, 0, 50)
|
||||
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 150, -70, 50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 30, -70, 50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 0, -70, 50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -30, -70, 50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -150, -70, 50)
|
||||
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 150, 70, -50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 30, 70, -50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 0, 70, -50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -30, 70, -50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -150, 70, -50)
|
||||
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 150, 0, -50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 30, 0, -50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 0, 0, -50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -30, 0, -50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -150, 0, -50)
|
||||
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 150, -70, -50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 30, -70, -50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, 0, -70, -50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -30, -70, -50)
|
||||
texturemodifiertest.create_node("colorizehsl", nil, -150, -70, -50)
|
|
@ -0,0 +1,57 @@
|
|||
-- test normal hue-saturation-lightness values
|
||||
|
||||
texturemodifiertest.create_node("contrast", nil, 96)
|
||||
texturemodifiertest.create_node("contrast", nil, 64)
|
||||
texturemodifiertest.create_node("contrast", nil, 32)
|
||||
texturemodifiertest.create_node("contrast", nil, 0)
|
||||
texturemodifiertest.create_node("contrast", nil, -32)
|
||||
texturemodifiertest.create_node("contrast", nil, -64)
|
||||
texturemodifiertest.create_node("contrast", nil, -96)
|
||||
|
||||
texturemodifiertest.create_node("contrast", nil, 96, 96)
|
||||
texturemodifiertest.create_node("contrast", nil, 64, 96)
|
||||
texturemodifiertest.create_node("contrast", nil, 32, 96)
|
||||
texturemodifiertest.create_node("contrast", nil, 0, 96)
|
||||
texturemodifiertest.create_node("contrast", nil, -32, 96)
|
||||
texturemodifiertest.create_node("contrast", nil, -64, 96)
|
||||
texturemodifiertest.create_node("contrast", nil, -96, 96)
|
||||
|
||||
texturemodifiertest.create_node("contrast", nil, 96, 64)
|
||||
texturemodifiertest.create_node("contrast", nil, 64, 64)
|
||||
texturemodifiertest.create_node("contrast", nil, 32, 64)
|
||||
texturemodifiertest.create_node("contrast", nil, 0, 64)
|
||||
texturemodifiertest.create_node("contrast", nil, -32, 64)
|
||||
texturemodifiertest.create_node("contrast", nil, -64, 64)
|
||||
texturemodifiertest.create_node("contrast", nil, -96, 64)
|
||||
|
||||
texturemodifiertest.create_node("contrast", nil, 96, 32)
|
||||
texturemodifiertest.create_node("contrast", nil, 64, 32)
|
||||
texturemodifiertest.create_node("contrast", nil, 32, 32)
|
||||
texturemodifiertest.create_node("contrast", nil, 0, 32)
|
||||
texturemodifiertest.create_node("contrast", nil, -32, 32)
|
||||
texturemodifiertest.create_node("contrast", nil, -64, 32)
|
||||
texturemodifiertest.create_node("contrast", nil, -96, 32)
|
||||
|
||||
texturemodifiertest.create_node("contrast", nil, 96, -32)
|
||||
texturemodifiertest.create_node("contrast", nil, 64, -32)
|
||||
texturemodifiertest.create_node("contrast", nil, 32, -32)
|
||||
texturemodifiertest.create_node("contrast", nil, 0, -32)
|
||||
texturemodifiertest.create_node("contrast", nil, -32, -32)
|
||||
texturemodifiertest.create_node("contrast", nil, -64, -32)
|
||||
texturemodifiertest.create_node("contrast", nil, -96, -32)
|
||||
|
||||
texturemodifiertest.create_node("contrast", nil, 96, -64)
|
||||
texturemodifiertest.create_node("contrast", nil, 64, -64)
|
||||
texturemodifiertest.create_node("contrast", nil, 32, -64)
|
||||
texturemodifiertest.create_node("contrast", nil, 0, -64)
|
||||
texturemodifiertest.create_node("contrast", nil, -32, -64)
|
||||
texturemodifiertest.create_node("contrast", nil, -64, -64)
|
||||
texturemodifiertest.create_node("contrast", nil, -96, -64)
|
||||
|
||||
texturemodifiertest.create_node("contrast", nil, 96, -96)
|
||||
texturemodifiertest.create_node("contrast", nil, 64, -96)
|
||||
texturemodifiertest.create_node("contrast", nil, 32, -96)
|
||||
texturemodifiertest.create_node("contrast", nil, 0, -96)
|
||||
texturemodifiertest.create_node("contrast", nil, -32, -96)
|
||||
texturemodifiertest.create_node("contrast", nil, -64, -96)
|
||||
texturemodifiertest.create_node("contrast", nil, -96, -96)
|
|
@ -0,0 +1,87 @@
|
|||
-- test the maximum legal values of the texture modifier input range
|
||||
|
||||
-- Hue-Saturation-Lightness
|
||||
texturemodifiertest.create_node("hsl", "extreme", 180)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 0)
|
||||
texturemodifiertest.create_node("hsl", "extreme", -180)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 180, 100, 100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 180, 100, 0)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 180, 100, -100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 180, 0, 100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 180, 0, 0)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 180, 0, -100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 180, -100, 100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 180, -100, 0)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 180, -100, -100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 0, 100, 100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 0, 100, 0)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 0, 100, -100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 0, 0, 100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 0, 0, 0)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 0, 0, -100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 0, -100, 100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 0, -100, 0)
|
||||
texturemodifiertest.create_node("hsl", "extreme", 0, -100, -100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", -180, 100, 100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", -180, 100, 0)
|
||||
texturemodifiertest.create_node("hsl", "extreme", -180, 100, -100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", -180, 0, 100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", -180, 0, 0)
|
||||
texturemodifiertest.create_node("hsl", "extreme", -180, 0, -100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", -180, -100, 100)
|
||||
texturemodifiertest.create_node("hsl", "extreme", -180, -100, 0)
|
||||
texturemodifiertest.create_node("hsl", "extreme", -180, -100, -100)
|
||||
|
||||
|
||||
-- Colorize
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 180)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 0)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", -180)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 180, 100, 100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 180, 100, 0)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 180, 100, -100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 180, 0, 100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 180, 0, 0)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 180, 0, -100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 180, -100, 100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 180, -100, 0)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 180, -100, -100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 0, 100, 100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 0, 100, 0)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 0, 100, -100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 0, 0, 100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 0, 0, 0)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 0, 0, -100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 0, -100, 100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 0, -100, 0)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", 0, -100, -100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", -180, 100, 100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", -180, 100, 0)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", -180, 100, -100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", -180, 0, 100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", -180, 0, 0)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", -180, 0, -100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", -180, -100, 100)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", -180, -100, 0)
|
||||
texturemodifiertest.create_node("colorizehsl", "extreme", -180, -100, -100)
|
||||
|
||||
-- Brightness-Contrast
|
||||
texturemodifiertest.create_node("contrast", "extreme", 127)
|
||||
texturemodifiertest.create_node("contrast", "extreme", 0)
|
||||
texturemodifiertest.create_node("contrast", "extreme", -127)
|
||||
texturemodifiertest.create_node("contrast", "extreme", 127, 127)
|
||||
texturemodifiertest.create_node("contrast", "extreme", 127, 0)
|
||||
texturemodifiertest.create_node("contrast", "extreme", 127, -127)
|
||||
texturemodifiertest.create_node("contrast", "extreme", 0, 127)
|
||||
texturemodifiertest.create_node("contrast", "extreme", 0, 0)
|
||||
texturemodifiertest.create_node("contrast", "extreme", 0, -127)
|
||||
texturemodifiertest.create_node("contrast", "extreme", -127, 127)
|
||||
texturemodifiertest.create_node("contrast", "extreme", -127, 0)
|
||||
texturemodifiertest.create_node("contrast", "extreme", -127, -127)
|
||||
|
||||
-- Screen
|
||||
texturemodifiertest.create_node("screen", "extreme", "#FFFFFF")
|
||||
texturemodifiertest.create_node("screen", "extreme", "#000000")
|
||||
texturemodifiertest.create_node("screen", "extreme", "#00FF00")
|
||||
texturemodifiertest.create_node("screen", "extreme", "#FF00FF")
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
-- test normal hue-saturation-lightness values
|
||||
|
||||
texturemodifiertest.create_node("hsl", nil, 150)
|
||||
texturemodifiertest.create_node("hsl", nil, 120)
|
||||
texturemodifiertest.create_node("hsl", nil, 90)
|
||||
texturemodifiertest.create_node("hsl", nil, 60)
|
||||
texturemodifiertest.create_node("hsl", nil, 30)
|
||||
texturemodifiertest.create_node("hsl", nil, 0)
|
||||
texturemodifiertest.create_node("hsl", nil, -30)
|
||||
texturemodifiertest.create_node("hsl", nil, -60)
|
||||
texturemodifiertest.create_node("hsl", nil, -90)
|
||||
texturemodifiertest.create_node("hsl", nil, -120)
|
||||
texturemodifiertest.create_node("hsl", nil, -150)
|
||||
|
||||
|
||||
-- with saturation
|
||||
texturemodifiertest.create_node("hsl", nil, 150, 30)
|
||||
texturemodifiertest.create_node("hsl", nil, 90, 30)
|
||||
texturemodifiertest.create_node("hsl", nil, 30, 30)
|
||||
texturemodifiertest.create_node("hsl", nil, 0, 30)
|
||||
texturemodifiertest.create_node("hsl", nil, -30, 30)
|
||||
texturemodifiertest.create_node("hsl", nil, -90, 30)
|
||||
texturemodifiertest.create_node("hsl", nil, -150, 30)
|
||||
|
||||
texturemodifiertest.create_node("hsl", nil, 150, 70)
|
||||
texturemodifiertest.create_node("hsl", nil, 90, 70)
|
||||
texturemodifiertest.create_node("hsl", nil, 30, 70)
|
||||
texturemodifiertest.create_node("hsl", nil, 0, 70)
|
||||
texturemodifiertest.create_node("hsl", nil, -30, 70)
|
||||
texturemodifiertest.create_node("hsl", nil, -90, 70)
|
||||
texturemodifiertest.create_node("hsl", nil, -150, 70)
|
||||
|
||||
texturemodifiertest.create_node("hsl", nil, 150, -30)
|
||||
texturemodifiertest.create_node("hsl", nil, 90, -30)
|
||||
texturemodifiertest.create_node("hsl", nil, 30, -30)
|
||||
texturemodifiertest.create_node("hsl", nil, 0, -30)
|
||||
texturemodifiertest.create_node("hsl", nil, -30, -30)
|
||||
texturemodifiertest.create_node("hsl", nil, -90, -30)
|
||||
texturemodifiertest.create_node("hsl", nil, -150, -30)
|
||||
|
||||
texturemodifiertest.create_node("hsl", nil, 150, -70)
|
||||
texturemodifiertest.create_node("hsl", nil, 90, -70)
|
||||
texturemodifiertest.create_node("hsl", nil, 30, -70)
|
||||
texturemodifiertest.create_node("hsl", nil, 0, -70)
|
||||
texturemodifiertest.create_node("hsl", nil, -30, -70)
|
||||
texturemodifiertest.create_node("hsl", nil, -90, -70)
|
||||
texturemodifiertest.create_node("hsl", nil, -150, -70)
|
||||
|
||||
-- with saturation and lightness
|
||||
texturemodifiertest.create_node("hsl", nil, 150, 70, 50)
|
||||
texturemodifiertest.create_node("hsl", nil, 90, 70, 50)
|
||||
texturemodifiertest.create_node("hsl", nil, 0, 70, 50)
|
||||
texturemodifiertest.create_node("hsl", nil, -90, 70, 50)
|
||||
texturemodifiertest.create_node("hsl", nil, -150, 70, 50)
|
||||
|
||||
texturemodifiertest.create_node("hsl", nil, 150, 0, 50)
|
||||
texturemodifiertest.create_node("hsl", nil, 30, 0, 50)
|
||||
texturemodifiertest.create_node("hsl", nil, 0, 0, 50)
|
||||
texturemodifiertest.create_node("hsl", nil, -30, 0, 50)
|
||||
texturemodifiertest.create_node("hsl", nil, -150, 0, 50)
|
||||
|
||||
texturemodifiertest.create_node("hsl", nil, 150, -70, 50)
|
||||
texturemodifiertest.create_node("hsl", nil, 30, -70, 50)
|
||||
texturemodifiertest.create_node("hsl", nil, 0, -70, 50)
|
||||
texturemodifiertest.create_node("hsl", nil, -30, -70, 50)
|
||||
texturemodifiertest.create_node("hsl", nil, -150, -70, 50)
|
||||
|
||||
texturemodifiertest.create_node("hsl", nil, 150, 70, -50)
|
||||
texturemodifiertest.create_node("hsl", nil, 30, 70, -50)
|
||||
texturemodifiertest.create_node("hsl", nil, 0, 70, -50)
|
||||
texturemodifiertest.create_node("hsl", nil, -30, 70, -50)
|
||||
texturemodifiertest.create_node("hsl", nil, -150, 70, -50)
|
||||
|
||||
texturemodifiertest.create_node("hsl", nil, 150, 0, -50)
|
||||
texturemodifiertest.create_node("hsl", nil, 30, 0, -50)
|
||||
texturemodifiertest.create_node("hsl", nil, 0, 0, -50)
|
||||
texturemodifiertest.create_node("hsl", nil, -30, 0, -50)
|
||||
texturemodifiertest.create_node("hsl", nil, -150, 0, -50)
|
||||
|
||||
texturemodifiertest.create_node("hsl", nil, 150, -70, -50)
|
||||
texturemodifiertest.create_node("hsl", nil, 30, -70, -50)
|
||||
texturemodifiertest.create_node("hsl", nil, 0, -70, -50)
|
||||
texturemodifiertest.create_node("hsl", nil, -30, -70, -50)
|
||||
texturemodifiertest.create_node("hsl", nil, -150, -70, -50)
|
|
@ -0,0 +1,63 @@
|
|||
local modname = minetest.get_current_modname()
|
||||
local path = minetest.get_modpath(modname)
|
||||
|
||||
|
||||
texturemodifiertest = {}
|
||||
|
||||
texturemodifiertest.create_node = function(operation_name, prefix, arg1, arg2, arg3)
|
||||
|
||||
local function arg_to_string(arg)
|
||||
|
||||
local firstchar = string.sub(arg, 1, 1)
|
||||
if firstchar == '-' or string.find(firstchar, "%d") ~= nil then
|
||||
-- number
|
||||
if arg < 0 then
|
||||
return "_neg" .. -arg
|
||||
else
|
||||
return "_" .. arg
|
||||
end
|
||||
elseif firstchar == "#" then
|
||||
-- A colour
|
||||
return "_" .. string.sub(arg, 3)
|
||||
else
|
||||
-- a file name
|
||||
return "_" .. arg
|
||||
end
|
||||
end
|
||||
|
||||
local nodename = operation_name .. arg_to_string(arg1)
|
||||
local modifier = "^[" .. operation_name .. ":" .. arg1
|
||||
local desc = operation_name .. " " .. arg1
|
||||
|
||||
if prefix ~= nil then
|
||||
nodename = prefix .. "_" .. nodename
|
||||
desc = "[" .. prefix .. "] " .. desc
|
||||
end
|
||||
|
||||
if arg2 ~= nil then
|
||||
nodename = nodename .. arg_to_string(arg2)
|
||||
modifier = modifier .. ":" .. arg2
|
||||
desc = desc .. " " .. arg2
|
||||
end
|
||||
|
||||
if arg3 ~= nil then
|
||||
nodename = nodename .. arg_to_string(arg3)
|
||||
modifier = modifier .. ":" .. arg3
|
||||
desc = desc .. " " .. arg3
|
||||
end
|
||||
|
||||
minetest.register_node("texturemodifiertest:" .. nodename, {
|
||||
description = desc,
|
||||
tiles = {"testimage.png" .. modifier},
|
||||
groups = {cracky = 1, oddly_breakable_by_hand = 1},
|
||||
})
|
||||
end
|
||||
|
||||
dofile(path .. DIR_DELIM .. "original_images.lua")
|
||||
dofile(path .. DIR_DELIM .. "screen_and_multiply.lua")
|
||||
dofile(path .. DIR_DELIM .. "overlay_and_hardlight.lua")
|
||||
dofile(path .. DIR_DELIM .. "hsl.lua")
|
||||
dofile(path .. DIR_DELIM .. "colorizehsl.lua")
|
||||
dofile(path .. DIR_DELIM .. "contrast_brightness.lua")
|
||||
dofile(path .. DIR_DELIM .. "extreme_values.lua")
|
||||
dofile(path .. DIR_DELIM .. "out_of_bound_values.lua")
|
|
@ -0,0 +1,2 @@
|
|||
name = texturemodifiertest
|
||||
description = 286 test nodes at 736x736, to cover edge cases, extremes and normal uses of the hsl, colorizehsl, contrast, overlay, hardlight, and screen texture modifiers.
|
|
@ -0,0 +1,11 @@
|
|||
minetest.register_node("texturemodifiertest:testimage", {
|
||||
description = "Test image",
|
||||
tiles = {"testimage.png"},
|
||||
groups = {cracky = 1, oddly_breakable_by_hand = 1},
|
||||
})
|
||||
|
||||
minetest.register_node("texturemodifiertest:gradient", {
|
||||
description = "Test gradient red/back",
|
||||
tiles = {"gradient.png"},
|
||||
groups = {cracky = 1, oddly_breakable_by_hand = 1},
|
||||
})
|
|
@ -0,0 +1,22 @@
|
|||
-- test values outside of the texture modifier input range
|
||||
|
||||
-- Hue-Saturation-Lightness
|
||||
texturemodifiertest.create_node("hsl", "OOB", 181)
|
||||
texturemodifiertest.create_node("hsl", "OOB", -181)
|
||||
texturemodifiertest.create_node("hsl", "OOB", 0, 101, -101)
|
||||
texturemodifiertest.create_node("hsl", "OOB", 0, -101, 101)
|
||||
texturemodifiertest.create_node("hsl", "OOB", 10000, 10000, 10000)
|
||||
|
||||
-- Colorize
|
||||
texturemodifiertest.create_node("colorizehsl", "OOB", 181)
|
||||
texturemodifiertest.create_node("colorizehsl", "OOB", -181)
|
||||
texturemodifiertest.create_node("colorizehsl", "OOB", 0, 101, -101)
|
||||
texturemodifiertest.create_node("colorizehsl", "OOB", 0, -101, 101)
|
||||
texturemodifiertest.create_node("colorizehsl", "OOB", 10000, 10000, 10000)
|
||||
|
||||
-- Brightness-Contrast
|
||||
texturemodifiertest.create_node("contrast", "OOB", 128)
|
||||
texturemodifiertest.create_node("contrast", "OOB", -128)
|
||||
texturemodifiertest.create_node("contrast", "OOB", 0, 128)
|
||||
texturemodifiertest.create_node("contrast", "OOB", 0, -128)
|
||||
texturemodifiertest.create_node("contrast", "OOB", 10000, 10000)
|
|
@ -0,0 +1,26 @@
|
|||
-- Overlay
|
||||
minetest.register_node("texturemodifiertest:OverlayBlend_Testimage_with_Gradient", {
|
||||
description = "Overlay blend of Test image with Test gradient red/back",
|
||||
tiles = {"testimage.png^[overlay:gradient.png"},
|
||||
groups = {cracky = 1, oddly_breakable_by_hand = 1},
|
||||
})
|
||||
|
||||
minetest.register_node("texturemodifiertest:OverlayBlend_Gradient_with_Testimage", {
|
||||
description = "Overlay blend of Test gradient red/back with Test image (should be same as 'Hardlight blend of Test image with Test gradient red/back')",
|
||||
tiles = {"gradient.png^[overlay:testimage.png"},
|
||||
groups = {cracky = 1, oddly_breakable_by_hand = 1},
|
||||
})
|
||||
|
||||
|
||||
-- Hard light
|
||||
minetest.register_node("texturemodifiertest:HardlightBlend_Testimage_with_Gradient", {
|
||||
description = "Hard light blend of Test image with Test gradient red/back",
|
||||
tiles = {"testimage.png^[hardlight:gradient.png"},
|
||||
groups = {cracky = 1, oddly_breakable_by_hand = 1},
|
||||
})
|
||||
|
||||
minetest.register_node("texturemodifiertest:HardlightBlend_Gradient_with_Testimage", {
|
||||
description = "Hard light blend of Test gradient red/back with Test image (should be same as 'Hard light blend of Test image with Test gradient red/back')",
|
||||
tiles = {"gradient.png^[hardlight:testimage.png"},
|
||||
groups = {cracky = 1, oddly_breakable_by_hand = 1},
|
||||
})
|
|
@ -0,0 +1,13 @@
|
|||
-- Demonstrate screen and multiply texture blends performed by using overlay modifier with brightness adjustment
|
||||
|
||||
minetest.register_node("texturemodifiertest:ScreenBlend_Testimage_with_Gradient", {
|
||||
description = "Screen blend of Test image with Test gradient red/back",
|
||||
tiles = {"testimage.png^[contrast:0:64^[overlay:gradient.png"},
|
||||
groups = {cracky = 1, oddly_breakable_by_hand = 1},
|
||||
})
|
||||
|
||||
minetest.register_node("texturemodifiertest:MultiplyBlend_Testimage_with_Gradient", {
|
||||
description = "Multiply blend of Test image with Test gradient red/back",
|
||||
tiles = {"testimage.png^[contrast:0:-64^[overlay:gradient.png"},
|
||||
groups = {cracky = 1, oddly_breakable_by_hand = 1},
|
||||
})
|
Binary file not shown.
After Width: | Height: | Size: 283 KiB |
Binary file not shown.
After Width: | Height: | Size: 321 KiB |
Loading…
Reference in New Issue