Compare commits
5 Commits
feacc78f7d
...
a5ea57fda3
Author | SHA1 | Date | |
---|---|---|---|
|
a5ea57fda3 | ||
|
e959f60ce1 | ||
|
320905826b | ||
|
e84f99166d | ||
|
bff6494249 |
@ -1,6 +1,6 @@
|
||||
# Perlin Explorer [`perlin_explorer`]
|
||||
|
||||
Version: 1.0.1
|
||||
Version: 1.0.3
|
||||
|
||||
Perlin Explorer is a mod for Minetest to allow to test and experiment around with Perlin noises.
|
||||
|
||||
|
28
init.lua
28
init.lua
@ -346,11 +346,31 @@ local analyze_noiseparams = function(noiseparams)
|
||||
local o_min, o_max = 0, 0
|
||||
for o=1, np.octaves do
|
||||
local exp = o-1
|
||||
o_max = o_max + (1 * np.persistence ^ exp)
|
||||
-- Calculate the two possible extreme values
|
||||
-- with the octave value being either at 1 or -1.
|
||||
local limit1 = (1 * np.persistence ^ exp)
|
||||
local limit2
|
||||
if not is_absolute then
|
||||
o_min = o_min + (- 1 * np.persistence ^ exp)
|
||||
-- Note: If absvalue flag is set, the sum of the octaves
|
||||
-- is always 0, so we don't need to calculate it
|
||||
limit2 = (-1 * np.persistence ^ exp)
|
||||
else
|
||||
-- If absvalue is set, one of the
|
||||
-- limits is always 0 because we
|
||||
-- can't get lower.
|
||||
limit2 = 0
|
||||
end
|
||||
|
||||
-- To add to the maximum, pick the higher value
|
||||
if limit1 > limit2 then
|
||||
o_max = o_max + limit1
|
||||
else
|
||||
o_max = o_max + limit2
|
||||
end
|
||||
|
||||
-- To add to the minimum, pick the LOWER value
|
||||
if limit1 > limit2 then
|
||||
o_min = o_min + limit2
|
||||
else
|
||||
o_min = o_min + limit1
|
||||
end
|
||||
end
|
||||
-- Add offset and scale to min/max value (final step)
|
||||
|
@ -94,7 +94,7 @@ Z Spread=Z-Ausbreitung
|
||||
Octaves=Oktaven
|
||||
Persistence=Persistenz
|
||||
Lacunarity=Lückenhaftigkeit
|
||||
defaults=default
|
||||
defaults=defaults
|
||||
eased=eased
|
||||
absvalue=absvalue
|
||||
Analyze=Analysieren
|
||||
|
Loading…
x
Reference in New Issue
Block a user