Skip to content
Snippets Groups Projects
Commit c437d102 authored by Duane Robertson's avatar Duane Robertson
Browse files

Lighting work. No good news.

parent 9928eb7b
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment