Compare commits

..

No commits in common. "main" and "v1.1.0" have entirely different histories.
main ... v1.1.0

3 changed files with 4 additions and 39 deletions

View File

@ -15,17 +15,15 @@ Each property of the lighting definition will be aggregated with the respective
Properties will be aggregated in different ways. Here is the full list:
- `saturation` will be __multiplied__
- `shadows`
- `intensity` will be __multiplied__
- `exposure`
- `luminance_min` will be __added__
- `luminance_max` will be __added__
- `speed_dark_bright` will be __multiplied__
- `speed_bright_dark` will be __multiplied__
- `center_weight_power` will be __multiplied__
- `saturation` will be __multiplied__
- `shadows`
- `intensity` will be __multiplied__
- `tint` values will be __maxed__
- `volumetric_light` will be __maxed__
### Example

View File

@ -7,11 +7,6 @@ if weather == nil or weather.get == nil then
return
end
-- leave it to climate_api to disable
if minetest.get_modpath("climate_api") then
return
end
-- prevent mod from triggering lighting updates itself
local old_get = weather.get
weather.get = function(player)

View File

@ -5,11 +5,6 @@ local monoid_definition = {
shadows = {
intensity = "multiply",
},
tint = {
r = "max_255",
g = "max_255",
b = "max_255"
},
saturation = "multiply",
exposure = {
luminance_min = "add",
@ -18,31 +13,16 @@ local monoid_definition = {
speed_dark_bright = "multiply",
speed_bright_dark = "multiply",
center_weight_power = "multiply"
},
volumetric_light = {
strength = "max_1"
}
}
-- neutral values
-- default values that don't reflect neutral operations
local lighting_defaults = {
shadows = {
intensity = 1,
},
tint = {
r = 0,
g = 0,
b = 0
},
saturation = 1,
exposure = {
luminance_min = -3,
luminance_max = -3,
speed_dark_bright = 1000,
speed_bright_dark = 1000,
},
volumetric_light = {
strength = 0
}
}
@ -56,14 +36,6 @@ function methods.multiply(a, b)
return a * b
end
function methods.max_1(a, b)
return math.min(math.max(math.max(a, b), 0), 1)
end
function methods.max_255(a, b)
return math.min(math.max(math.max(a, b), 0), 255)
end
-- combine tables using specified methods
local function combine(definition, tabA, tabB)
-- at least one table has undefined value