ValueNoise¶
-
class ValueNoise¶
Deterministic value noise on exact 32-bit integer hashing: one seed, one world, on any machine, and bit-identical to the scalar Python twin in acron.noise (the same IEEE double arithmetic in the same order; the file is compiled with floating-point contraction off, so no FMA reorders a rounding).
The hash is wrapping 32-bit multiplies and unsigned shifts – no fract(sin()) chaos that rounds differently on every platform – and the lattice is interpolated with a quintic smoothstep (C2, clean normals).
fbm()andridged()sum rotated octaves (at most 64; none gives 0);pvn()is periodic in both axes. A coordinate that is not finite, or past 2^62, samples 0.make_field()evaluates one of them on a regular grid – sample (i, j) at (x0 + i * dx, y0 + j * dy), row-major, j outermost – which is what a bake of a 2048-square height field wants and Python one texel at a time cannot give.Inheritance diagram
digraph inheritance6f051f9662 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ValueNoise" [URL="acron.raster.ValueNoise.html#acron.raster.ValueNoise",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" -> "ValueNoise" [arrowsize=0.75,style=""]; }-
enum Kind¶
-
enumerator K_value = 0¶
-
enumerator K_fbm = 1¶
-
enumerator K_ridged = 2¶
-
enumerator K_periodic = 3¶
-
enumerator K_value = 0¶
- ValueNoise.__init__()¶
- static ValueNoise.fbm()¶
Fractal sum of rotated value-noise octaves, normalised to [0, 1).
- static ValueNoise.hash2i()¶
Integer hash of a lattice point to [0, 1). Exact: wrapping 32-bit multiplies of the low 32 bits of each argument.
- static ValueNoise.make_field()¶
The field on a regular grid: sample (i, j) at (x0 + i * dx, y0 + j * dy), row-major with j outermost, as doubles.
octaves,lacandgainare read by the fractal kinds,periodby K_periodic.
- static ValueNoise.make_field_float()¶
make_field()rounded to float32: what a texture upload wants.
- static ValueNoise.pvn()¶
Value noise periodic in both axes with the given integer period: the seamless detail tile.
- static ValueNoise.ridged()¶
Ridged multifractal: sharp crests (mountain rims), in [0, 1].
- static ValueNoise.vnoise()¶
2D value noise, quintic smoothstep, in [0, 1).
-
enum Kind¶