#Problem with biome blending/interpolating between biome frequencies

16 messages · Page 1 of 1 (latest)

vernal shuttle
#
local grayscale = (highTemp[1].Temperature - temperature) * 10

local colour = highTemp[1].Colors[1]:Lerp(lowTemp[1].Colors[1], grayscale)
manager.chunkData[chunkPosX][chunkPosZ].name[x][z] = grayscale
manager.chunkData[chunkPosX][chunkPosZ].blocks[x][z] = colour

local function lerp(a, b, c)
    return a + (b - a) * c
end

-- print(lerp(lowTemp[1].Resolution, highTemp[1].Resolution, math.abs((temperature - highTemp[1].Temperature) * 10)))

height = getHeight(
    x+(manager.mapSize*chunkPosX),
    z+(manager.mapSize*chunkPosZ),
    lerp(highTemp[1].Resolution, lowTemp[1].Resolution,
        grayscale
    ),
    lerp(highTemp[1].Frequency, lowTemp[1].Frequency,
        grayscale
    ),
    lerp(highTemp[1].Amplitude, lowTemp[1].Amplitude,
        grayscale
    )
)
#
local getHeight = function(x, z, r, f, a)
    local y1 = math.noise(x/r*f, z/r*f, seed)

    local y = y1
    y = math.clamp(y, -.5, .5) + .5
    y = math.round((y*a)/1)*1
    
    return y
end
#
local biomes =  {
    ['Desert'] = {
        Temperature = 1,

        Frequency = 1,
        Resolution = 100,
        Amplitude = 2,

        Colors = {
            [1] = BrickColor.new('Daisy orange').Color
        }
    },
    ['Plains'] = {
        Temperature = .9,    

        Frequency = 3,
        Resolution = 100,
        Amplitude = 2,

        Colors = {
            [1] = BrickColor.new('Shamrock').Color
        }
    },
    ['Forest'] = {
        Temperature = .8,        

        Frequency = 3,
        Resolution = 100,
        Amplitude = 10,

        Colors = {
            [1] = BrickColor.new('Dark green').Color
        }
    },
    ['Jungle'] = {
        Temperature = .7,

        Frequency = 3,
        Resolution = 100,
        Amplitude = 10,

        Colors = {
            [1] = BrickColor.new('Parsley green').Color
        }
    }
}

return {
    Biomes = biomes
}
#

It doesn't smootlhy interpolate

lone wharf
#

idk how tf to do this but try making the freq 3? 😭

vernal shuttle
#

I want a calmer desert though

lone wharf
#

u dont want the lines going into itsself?

vernal shuttle
#

I want it to smoothly transition but it just freaks out

lone wharf
#

yeah this has got to to to dev forum

vernal shuttle
#

Can't type there 🤓

lone wharf
#

wat?

vernal shuttle
#

Not a devforum member

lone wharf
#

damn

vernal shuttle
#

Frequency 2 for desert but it still ahs deformations

lone wharf
#

honestly looks fine