API ReferenceGE ExtensionseditortoolUtilities
Editor Tool Utilities – Perlin Noise
Classic 2D Perlin noise implementation with a static permutation table for deterministic, repeatable noise generation.
Classic 2D Perlin noise implementation with a static permutation table for deterministic, repeatable noise generation.
Public API
| Function | Signature | Description |
|---|---|---|
M.noise | (x, y) → number | Evaluates 2D Perlin noise at coordinates (x, y). Returns a value roughly in [-1, 1] |
Code Examples
local perlin = require('editor/toolUtilities/perlin')
-- Sample noise at a single point
local value = perlin.noise(10.5, 20.3)
-- Generate a noise heightmap for terrain variation
local width, height = 128, 128
local scale = 0.05
for y = 0, height - 1 do
for x = 0, width - 1 do
local n = perlin.noise(x * scale, y * scale)
local normalised = (n + 1) * 0.5 -- map to [0, 1]
-- Use normalised value for terrain offset, texture blending, etc.
end
end
-- Multi-octave fractal noise (manual layering)
local function fbm(x, y, octaves, lacunarity, gain)
local sum, amp, freq = 0, 1, 1
for i = 1, octaves do
sum = sum + perlin.noise(x * freq, y * freq) * amp
freq = freq * lacunarity
amp = amp * gain
end
return sum
end
local value = fbm(50.0, 75.0, 4, 2.0, 0.5)See Also
- Tool Utilities - Fit Polyline - Related reference
- Editor Tool Utilities – Geometry - Related reference
- Editor Tool Utilities – Gizmo - Related reference
- World Editor Guide - Guide
Editor Tool Utilities – Mesh Audition Manager
Utility for previewing and selecting static meshes (DAE files) with a rotating 3D camera audition view and a searchable list window.
Editor Tool Utilities – Polygon Drawing
Manages interactive user-drawn polygons on the map. Supports adding nodes by clicking, inserting nodes on edges, dragging nodes, deleting nodes, and rendering the polygon with terrain-conforming edges