New generation config
dfsek opened this issue ยท 1 comments
Redo noise-equation
to support:
- Multiple noise samplers with:
- Distinct resolutions
- Distinct sampling ranges
- Distinct interpolation type/step
- Distinct X/Y/Z ranges
- Interpolation configuration:
- Configure type (lerp or full (no interp))
- Configure step along X Y and Z
Example config:
generation:
combine: "base-eq+elevation-eq"
carving: "something here"
equations:
elevation-eq:
equation: "simplex(x, z)"
sampler: elevation
base-eq:
equation: "-y+base"
sampler: generation
samplers:
elevation:
style: XZ # maybe call this 2D
sample:
x: [0, 15]
z: [0, 15]
interpolation: # (optional, defaults to 4x4 bilerp/trilerp)
type: FULL # Full resolution (no interpolation)
generation:
style: XYZ # maybe call this 3D
sample:
x: [0, 15]
y: [0, 255]
z: [0, 15]
interpolation:
type: LERP
step:
x: 4
y: 4
z: 4
This will require completely redoing how biome noise is fetched, to allow custom samplers to be queried efficiently on a per-biome basis. This would be a good time to switch to a 1D array for storing chunk noise values.
Noise values would be kept in a raw double array within the ChunkInterpolator (probably rename that).
Each biome would get an array to cache interpolators in, if applicable. When noise is requested from a specific coordinate, the interpolator array is queried, then if the interpolator is present it is accessed, if it is missing it is created. This allows for quick access to arbitrarily sized interpolators without needing to calculate an entire chunk of noise for every biome present in the generating chunk.