Claude Game Studio

Perlin noise generator

This Perlin noise generator makes seeded noise textures with octave controls, a repeating tile preview and PNG exports up to 2048 pixels.

Seed 42 loaded. Preview shows four repeats; PNG exports one tile.

Use these settings in your engine

These snippets update with the controls. They use your seed, scale, octaves, persistence and lacunarity. Each engine has its own gradients and seed mapping; import the exported PNG for the exact image above. The snippets make grayscale images; the terrain ramp colours the browser export.

Godot FastNoiseLite

# Paste inside a script method such as _ready(). var size := 512 var noise := FastNoiseLite.new() noise.noise_type = FastNoiseLite.TYPE_PERLIN noise.seed = 42 noise.frequency = 4.0 / size noise.fractal_type = FastNoiseLite.FRACTAL_FBM noise.fractal_octaves = 5 noise.fractal_gain = 0.5 noise.fractal_lacunarity = 2.0 noise.fractal_weighted_strength = 0.0 var image := noise.get_seamless_image(size, size, false, false, 0.1) image.save_png("user://godot-noise.png") # To use the exact exported browser texture instead: var exact_texture = load("res://perlin-noise-512.png")

Tileable uses Godot's get_seamless_image edge blending. Copy the browser PNG into your project for its periodic lattice.

Unity Mathf.PerlinNoise

// Put these methods inside a MonoBehaviour; call BuildNoise(). Texture2D BuildNoise() { int size = 512; var rng = new System.Random(42); float ox = 64f + (float)rng.NextDouble() * 10000f; float oy = 64f + (float)rng.NextDouble() * 10000f; var tex = new Texture2D(size, size, TextureFormat.RGBA32, false); var pixels = new Color[size * size]; for (int y = 0; y < size; y++) for (int x = 0; x < size; x++) { float u = (float)x / size, v = (float)y / size; float a = Sample(u, v, ox, oy); float sx = Mathf.SmoothStep(0f, 1f, u), sy = Mathf.SmoothStep(0f, 1f, v); float b = Sample(u - 1f, v, ox, oy); float c = Sample(u, v - 1f, ox, oy); float d = Sample(u - 1f, v - 1f, ox, oy); a = Mathf.Lerp(Mathf.Lerp(a, b, sx), Mathf.Lerp(c, d, sx), sy); pixels[y * size + x] = new Color(a, a, a, 1f); } tex.SetPixels(pixels); tex.Apply(); tex.wrapMode = TextureWrapMode.Repeat; return tex; } float Sample(float u, float v, float ox, float oy) { float sum = 0f, total = 0f, weight = 1f, frequency = 4f; for (int i = 0; i < 5; i++) { sum += Mathf.Clamp01(Mathf.PerlinNoise(ox + u * frequency, oy + v * frequency)) * weight; total += weight; weight *= 0.5f; frequency *= 2f; } return sum / total; } // For exact browser pixels, import perlin-noise-512.png into Assets.

Unity has no seed argument here, so a seeded System.Random chooses coordinate offsets. Tileable crossfades four offset samples.

Choose the texture's shape

Scale is the number of grid cells across one tile at the first octave. Start at 4 for broad cloudy shapes, then increase it for smaller patches. The seed changes the gradients while keeping the same controls. Use the same seed and settings to recreate your texture; export the settings JSON alongside the PNG.

Octaves add finer structure. Persistence decides how much of each finer layer survives: 0.25 keeps broad forms dominant, while 0.75 gives fine detail more weight. Lacunarity decides the spacing between layers. At 2, each octave has twice as many cells across the tile. Try changing one control at a time while watching the same seed.

Scale and lacunarity use whole numbers so every wrapped octave meets its own lattice on the opposite edge. The tool supports 1 to 7 octaves, scale 1 to 16, persistence 0.1 to 0.9 and lacunarity 2 to 4. At very high frequencies, choose a larger export or fewer octaves so the finest cells cover more than one pixel.

Check that the noise repeats

Show 2×2 repeats the actual preview tile across and down. Tileable wraps the grid coordinates used to choose each gradient, rather than copying the first pixel onto the last. The continuous field has the same value one tile apart. The PNG samples pixels inside that field, so its last column sits just before the wrap, like any other neighbouring pair.

One tile and the next give the same samplesNine samples at seed 42, y 0.37, plotted from zero to one. The second tile overlaps the first at every point.
Our default field: seed 42, scale 4, five octaves, persistence 0.5, lacunarity 2. Orange samples at x; white samples at x + 1. Both use y = 0.37.

The starting octave weights are 1, 0.5, 0.25, 0.125 and 0.0625, which sum to 1.9375. This tool divides by that total before mapping into grayscale. Adding an octave therefore adds detail without multiplying the overall brightness. The sampled field and chart here use the same generator as the browser controls.

Export a game texture

Choose Grayscale when the brightness will become a height, an opacity or a blend factor. Choose Terrain ramp for a blue-to-green-to-sand colour texture. The ramp colours the same field; it does not add rivers or decide where your game places objects. For land, biomes and rivers together, use the world map generator.

Export PNG writes one square RGBA tile at the chosen resolution. At 256 pixels its uncompressed pixel buffer is 0.25 MiB; at 2048 it is 16 MiB. The saved PNG is compressed, so its file size differs. Increasing resolution samples more points in the same field, keeping the seed and scale rather than stretching the 256-pixel preview.

Set your engine's texture wrapping to Repeat to repeat the exported image. Keep the original dimensions and use lossless texture import when exact samples matter. For height and other numeric masks, import it as data rather than sRGB colour. For a coloured surface, use the normal colour-texture import. If you already have a photograph or painted image that should repeat, use the seamless texture generator to process that image instead.

Perlin noise in Godot and Unity

The Godot FastNoiseLite reference names the corresponding controls frequency, fractal_octaves, fractal_gain and fractal_lacunarity. The Godot snippet divides scale by your export width to turn cells per tile into frequency per pixel. Its seed is passed to the noise resource.

Unity's Mathf.PerlinNoise reference takes two coordinates. The Unity snippet builds the octave sum explicitly, and uses seeded coordinate offsets for repeatability. Tileable crossfades four samples across the tile. Both snippets create grayscale fields; import the browser PNG when your game needs its exact pattern or terrain colours.

Questions

What is a Perlin noise generator?

A Perlin noise generator interpolates random gradients on a grid to make a smooth field. This tool adds several layers, called octaves, for cloudy detail. Use grayscale for height or blend masks, or choose the terrain colour ramp for a coloured texture.

How do I make Perlin noise tileable?

Enable Tileable. The gradient lattice wraps at each octave, so the field repeats across both axes. Show 2×2 displays four copies so you can inspect every join. Export PNG still saves one tile, ready for repeat wrapping in your engine.

What do octaves, persistence and lacunarity do?

Octaves sets how many layers are added. Persistence multiplies each next layer's weight, and lacunarity multiplies its frequency. Five octaves at persistence 0.5 and lacunarity 2 use weights 1, 0.5, 0.25, 0.125 and 0.0625, at frequencies 1, 2, 4, 8 and 16 times the starting scale.

Will Godot or Unity generate the same image?

Import the exported PNG to use the exact browser image. The live code snippets carry the selected settings into Godot FastNoiseLite and Unity Mathf.PerlinNoise, whose gradients and seed handling differ. Godot's tile option blends edges; the Unity example wraps using four offset samples.

What PNG sizes can I export?

Choose 256, 512, 1024 or 2048 pixels square. The preview uses a 256-pixel tile, and export resamples the same field at your chosen size. The PNG and settings JSON are made in your browser without a generation service or sign-up.

Put your assets into a playable game. Try the ten game templates or get the kit.