MapGen: Optimization: Added single-color triangles. Close #10
This commit is contained in:
@@ -517,6 +517,14 @@ end
|
||||
---@param z integer
|
||||
---@return number
|
||||
local function calcNoise2dValue(category, layer, triangle, x, y, z)
|
||||
local triangleColor = triangle.color
|
||||
|
||||
-- If the triangle is monochromatic (all peaks have the same color and,
|
||||
-- accordingly, the same noise), then there is no point in smoothing out the noise.
|
||||
if triangleColor ~= nil then
|
||||
return layer:getNoiseByColor(category, triangleColor):get_2d({x = x, y = z})
|
||||
end
|
||||
|
||||
local peak1 = triangle.p1
|
||||
local peak2 = triangle.p2
|
||||
local peak3 = triangle.p3
|
||||
|
||||
Reference in New Issue
Block a user