From c437d102ea57d0a603da1bda3b72143bd00f5cf7 Mon Sep 17 00:00:00 2001 From: Duane Robertson Date: Thu, 29 Sep 2016 22:40:48 -0500 Subject: [PATCH] Lighting work. No good news. --- mapgen.lua | 9 ++++++--- nodes.lua | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/mapgen.lua b/mapgen.lua index dfbf59e..e7a18ed 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -142,7 +142,8 @@ end local pod_size = {x=300, y=100, z=200} local half_pod = {x=math_floor(pod_size.x / 2), y=math_floor(pod_size.y / 2), z=math_floor(pod_size.z / 2)} local bridge_size = 50 -local fcsize = {x=pod_size.x + bridge_size, y=pod_size.y + bridge_size, z=pod_size.z + bridge_size} +local vert_sep = 250 +local fcsize = {x=pod_size.x + bridge_size, y=pod_size.y + vert_sep, z=pod_size.z + bridge_size} local bevel = half_pod.y local room_size = 20 local control_off = math_floor(room_size / 4) @@ -189,6 +190,7 @@ local function place_schematic(pos, schem, center) local prob = schem.data[isch].prob or schem.data[isch].param1 or 255 if prob >= math.random(255) and schem.data[isch].name ~= "air" then data[ivm] = node[schem.data[isch].name] + lightmap[ivm] = 0 end local param2 = schem.data[isch].param2 or 0 p2data[ivm] = param2 @@ -281,7 +283,7 @@ local function generate(p_minp, p_maxp, seed) a = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) csize = vector.add(vector.subtract(maxp, minp), 1) - vm:set_lighting({day = 15, night = 0}, minp, maxp) + --vm:set_lighting({day = 0, night = 0}, minp, maxp) lightmap = vm:get_light_data() local ground = half_pod.y @@ -313,6 +315,7 @@ local function generate(p_minp, p_maxp, seed) local dy = y - minp.y local fdy = y % fcsize.y local py = math_floor(y / fcsize.y) + lightmap[ivm] = 0 if py ~= last_py or px ~= last_px or pz ~= last_pz then biome, cave_lining = get_biome(x, y, z) end @@ -437,7 +440,7 @@ local function generate(p_minp, p_maxp, seed) --data[ivm] = node["air"] end in_cave = true - --lightmap[ivm] = 0 + lightmap[ivm] = 0 elseif cave_lining and cave[index3d] ^ 2 > (biome == "underground" and 0.4 or 1.2 - math.sin(fdy / (half_pod.y * 0.2))) then data[ivm] = node[cave_lining] lightmap[ivm] = 0 diff --git a/nodes.lua b/nodes.lua index 089a3aa..e3a6983 100644 --- a/nodes.lua +++ b/nodes.lua @@ -40,6 +40,10 @@ node = loud_walking.clone_node("loud_walking:sky_scrith") node.tiles = {"loud_walking_glass_detail.png"} minetest.register_node("loud_walking:transparent_scrith", node) +node = loud_walking.clone_node("air") +node.light_source = 15 +minetest.register_node("loud_walking:light_air", node) + minetest.register_node("loud_walking:control_floor", { description = "Floor", paramtype = "light",