Smog
README.md
art.heightgen
Bakes a parallax height map from a tangent-space normal map. The generated PBR sets under generated/materials/ ship albedo, normal and roughness but no height, so bake(normalPngPath, name, opts) integrates the normal map's gradients in the frequency domain (Frankot–Chellappa, exact for a seamless tile), high-passes away the drift, normalises by percentile and writes a linear .texture to art/heights/<name>.texture (R = height, 1 = the face, 0 = the deepest joint).
Run once from execute when a source texture changes; the art.wet_tri materials bind the result as height_texture.
require("art.heightgen").bake(
"/source/generated/materials/straight_on__no_shadows__no_perspective.material/textures/normal.texture/normal.png",
"cobbles_height", { size = 512, sigma = 48 })
Options: size (power of two, default 512), sigma (high-pass radius in output pixels, default 40), gamma, lo/hi (percentiles mapped to 0/1), flipY (DirectX normal maps), invert.