NoiseTools Utility

advanced scripting

Voxel Play 3 · Scripting / API

Overview

The NoiseTools class provides utilities for managing noise textures and heightmaps, designed for terrain generation and procedural content creation.

Fields

  • static Vector3 seedOffset - Random seeded offsets for terrain sampling

Methods

LoadNoiseTexture

Loads noise values from a texture:

float[] noiseValues = NoiseTools.LoadNoiseTexture(texture, out int textureSize);

LoadHeightmapFromTerrainData

Loads heightmap values from Unity TerrainData:

float[] heightmap = NoiseTools.LoadHeightmapFromTerrainData(terrainData, out int size);

GetNoiseValue

Samples noise texture at a specific position:

  • NoiseTools.GetNoiseValue(noiseArray, textureSize, x, z) - 2D noise sampling
  • NoiseTools.GetNoiseValue(noiseArray, textureSize, x, z, ridgeNoise: true) - 2D with ridge noise (inverted effect for ridges/peaks)
  • NoiseTools.GetNoiseValue(noiseArray, textureSize, x, y, z) - 3D noise sampling

GetNoiseValueBilinear

Samples 2D noise texture using bilinear filtering for smoother results:

float value = NoiseTools.GetNoiseValueBilinear(noiseArray, textureSize, x, z);

Also accepts an optional ridgeNoise parameter.

Was this page helpful?