hashField

beta
field
hashField
RayTK
v0.42

Advanced field that produces randomized values.

This should typically be used with an input that provides numbers that the randomization should be based on, but it can be used without an input in which case it uses spatial position as the basis.

A typical use case for this operator would be something like randomizing a property within each cell of a modulo2D. The cell coordinates, accessed using a variableReference, would be passed into the hashField, which would produce random numbers that could be mapped to control the radius of a cylinder for example.

The available hash functions have different types of inputs and outputs. Some take a single number input and produce a single number. Others take a single number and produce vectors. And still others take in a vector with multiple parts to produce single numbers, etc.

Each hash function has a different range of values that it will produce. Their labels in the parameter menu contain information about how they behave.

The label suffixes are in the format (<coord> -> <return>), where the first part is the type of coordinates or input value that it uses and the second is the type of value that it produces.

Types labeled X mean it only uses/produces a single number, the X part of vectors.

Types labeled XYZ mean it uses/produces 3 parts of vectors.

Types marked with [U] mean unsigned integers, which treat all negative numbers as zero, and produce whole numbers ranging from 0 to 4294967295.

Types without [U] mean floats, which can be any number. For outputs, that typically means a 0..1 or -1..1 range.

Based on Hash Functions for GPU Rendering by markjarzynski.

More details avaiable here.

Parameters

Name Description Regular Handling Read-Only Handling
Function Baked Baked
  • BBS (X[u] -> X[u]):
  • CityHash32 (1D) (X[u] -> X[u]):
  • CityHash32 (2D) (XY[u] -> X[u]):
  • CityHash32 (3D) (XYZ[u] -> X[u]):
  • CityHash32 (4D) (XYZW[u] -> X[u]):
  • Schechter and Bridson (X[u] -> X[u]):
  • UE4 RandFast (XY -> X):
  • Hash w/o Sine 1:1 (X -> X):
  • Hash w/o Sine 2:1 (XY -> X):
  • Hash w/o Sine 3:1 (XYZ -> X):
  • Hash w/o Sine 1:2 (X -> XY):
  • Hash w/o Sine 2:2 (XY -> XY):
  • Hash w/o Sine 3:2 (XYZ -> XY):
  • Hash w/o Sine 1:3 (X -> XYZ):
  • Hash w/o Sine 2:3 (XY -> XYZ):
  • Hash w/o Sine 3:3 (XYZ -> XYZ):
  • Hash w/o Sine 1:4 (X -> XYZW):
  • Hash w/o Sine 2:4 (XY -> XYZW):
  • Hash w/o Sine 3:4 (XYZ -> XYZW):
  • Hash w/o Sine 4:4 (XYZW -> XYZW):
  • Hybrid Taus (XYZW[u] -> X):
  • Interleaved Gradient (XY -> X):
  • Integer Hash I (X[u] -> X[u]):
  • Integer Hash II (XYZ[u] -> XYZ[u]):
  • Integer Hash III (XY[u] -> X[u]):
  • JKiss32 (XY[u] -> X[u]):
  • Linear Congruential (X[u] -> X[u]):
  • MD5GPU (XYZW[u] -> XYZW[u]):
  • Murmur Hash 3 1:1 (X[u] -> X[u]):
  • Murmur Hash 3 2:1 (XY[u] -> X[u]):
  • Murmur Hash 3 3:1 (XYZ[u] -> X[u]):
  • Murmur Hash 3 4:1 (XYZW[u] -> X[u]):
  • PCG Random (X[u] -> X[u]):
  • PCG 2D (XY[u] -> XY[u]):
  • PCG 3D (XYZ[u] -> XYZ[u]):
  • PCG 3D 16 (XYZ[u] -> XYZ[u]):
  • PCG 4D (XYZW[u] -> XYZW[u]):
  • UE4 PseudoRandom (XY -> X):
  • RanLim 32 (X[u] -> X[u]):
  • SuperFastHash 1:1 (X[u] -> X[u]):
  • SuperFastHash 2:1 (XY[u] -> X[u]):
  • SuperFastHash 3:1 (XYZ[u] -> X[u]):
  • SuperFastHash 4:1 (XYZW[u] -> X[u]):
  • Trig 2:1 (XY -> X):
  • Wang 1:1 (X[u] -> X[u]):
  • 128-bit XOR Shift (XYZW[u] -> X[u]):
  • 32-bit XOR Shift (X[u] -> X[u]):
  • 32-bit XX Hash 1:1 (X[u] -> X[u]):
  • 32-bit XX Hash 2:1 (XY[u] -> X[u]):
Coord Type
  • Auto:
  • 1D:
  • 2D:
  • 3D:
  • 4D:

Inputs

  • Coordinate Field: (optional)
    • Coordinate Types: float vec2 vec3 vec4
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext VertexContext PixelContext
    • Return Types: float vec4