CloudNoise

class CloudNoise

The tiling noise volumes volumetric clouds are carved from, made on the CPU (ported from castaway’s CloudSystem::make_noise, after the ideas of Schneider’s Nubis talks). Every texture repeats seamlessly, and the same size and seed always give the same bytes.

  • make_base(): an N^3 RGBA16 volume. r is the body’s shape: a 4-octave Perlin fbm dilated by Worley cells (billows and wisps), eroded by Worley fbm; g, b and a are Worley fbm at 4, 8 and 16 cells per tile (turrets, cloudlets). Each channel is stretched so that its 1st..99th percentile fills 0..1. Meant to cover base_tile metres (4096) of sky.

  • make_detail(): an N^3 RGBA16 volume. r, g, b are Worley fbm at 2, 4 and 8 cells per tile, a their 0.625/0.25/0.125 sum (the shader’s mix). Meant to cover detail_tile metres (512).

  • make_curl(): an N^2 RGBA16 image. r, g are the curl of a tiling 2-D gradient noise (0.5 = none), b = 0.5, a = 1. Meant to cover curl_tile metres (2048).

The noise is a function of the position in the tile, not of the texel grid, so a smaller size of the same seed is a down-sampled copy of a larger one (a 64^3 base on the CPU matches a 128^3 base on the GPU up to the filtering). The tile sizes all divide WeatherField’s 16384 m tile, so a drifting sky wraps without a seam.

All three run on a few worker threads and release the GIL (BLOCKING). The RAM images are kept, and are in Acron’s BGRA order.

Inheritance diagram

digraph inheritancee8944a4be6 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "CloudNoise" [URL="acron.atmosphere.CloudNoise.html#acron.atmosphere.CloudNoise",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "CloudNoise" [arrowsize=0.75,style=""]; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; }
CloudNoise.__init__()
static CloudNoise.get_base_tile()
static CloudNoise.get_curl_tile()
static CloudNoise.get_detail_tile()
static CloudNoise.make_base()

Makes the base shape volume: size^3 texels of RGBA16 (r the Perlin-Worley shape, g b a Worley fbm at 4, 8, 16 cells), tiling, the same bytes for the same size and seed.

static CloudNoise.make_curl()

Makes the curl image: size^2 texels of RGBA16 (r g the curl, 0.5 = none; b 0.5, a 1), tiling.

static CloudNoise.make_detail()

Makes the detail volume: size^3 texels of RGBA16 (r g b Worley fbm at 2, 4, 8 cells, a their weighted sum), tiling.