bump_normals_fbm — 3D terrain op

• Data kinds: normalmap × pointmap → normalmap

• Call: import fullseye as fs; fs.ledger.bump_normals_fbm(normals, positions, wavelengths=(0.002, 0.001), amplitudes=(0.0002, 0.00012), *, seed: 'int' = 0, rotation=None, step=None, local_edge=None, nyquist: 'float' = 2.0, fade: 'float' = 1.0) -> 'np.ndarray' (to call the implementation directly, import render3d; render3d.bump_normals_fbm(normals, positions, wavelengths=(0.002, 0.001), amplitudes=(0.0002, 0.00012), *, seed: 'int' = 0, rotation=None, step=None, local_edge=None, nyquist: 'float' = 2.0, fade: 'float' = 1.0) -> 'np.ndarray'; from the registry, ops3d.get("bump_normals_fbm"))

Usage

Perturb a normal map with the *gradient* of a seeded multi-octave height field.

This is sub-facet relief the geometry cannot afford to displace → unit normals (H, W, 3).

h(x) = Σ_k A_k n_k(x) is the same value-noise field mesh_displace_spectrum would displace with (same seed ⇒ same lattice), so passing the octaves that the displacement's band gate rejected makes the shading continue the *same* amplitude spectrum below the facet size (no fake sandpaper: an octave of amplitude A at wavelength λ tilts the normal by about 2πA/λ at most). The bumped normal is normalize(n − ∇_t h) (first-order shading normal of a height field over the surface; ∇_t = tangential gradient by central differences with step = min(λ)/64). positions are world coordinates (H, W, 3) (NaN = background, left untouched); if rotation (3×3, world → normal frame, e.g. pose[:3,:3]) is given the normals are taken in that frame.

local_edge (optional (H, W) map of the mesh's local edge length under each pixel) makes the bump the exact complement of the displacement's band gate: octave k is bumped with weight 1 − gate_k where gate_k is displacement_band_weights's rule with the same nyquist / fade — so an octave the geometry carried at a pixel is not added twice, and one it could not carry is fully supplied by the bump. Without it every octave is bumped at full amplitude. Deterministic; fail-closed.

Input and output are both (H, W, 3) images. Pixels where positions contains NaN, or where the normal length is 1e-12 or less, are left at their original value as background (the empty pixels of render3d.render_mesh). If there is not a single valid pixel, a copy of the input is returned.

• wavelengths / amplitudes: positive sequences of the same length (1 to 32) in the units of the mesh (= positions). A length mismatch or negative values raise ValueError.

• rotation: 3×3 (world → normal coordinate frame). If given, the normals are taken back to world with N @ R, the gradient is taken, and they are returned to the original frame with @ R.T. Normals from render_mesh are in camera space, so pass pose[:3,:3]. Non-finite values or a wrong shape raise ValueError.

• step: central-difference step (default min(wavelengths)/64). 0 or less raises ValueError.

• local_edge: (H, W) edge-length map. If its shape differs from the normals, or there are non-positive / non-finite values under valid pixels, ValueError.

The height field is differentiated by central differences along 3 axes, so there are 6 evaluations per 1 pixel. The tilt of the normal is about max |∇h| ≈ 2π A_k / λ_k, so the closer the amplitude gets to the wavelength, the more the normal leans over (the default is around A/λ = 0.1). The result can be passed as is to phong_shade / brdf_hapke and other normal-map inputs.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

Runnable examples (verified samples that actually call this op)

• itokawa_regolith_hero — py -3.11 examples_3d/itokawa_regolith_hero.py

Ops the type connects to (they accept normalmap as input)

fuse_to_voxel · render_shaded · phong_shade · matcap_shade · brdf_lommel_seeliger · brdf_hapke · integrate_normals · render_lambertian

Same category (terrain)

mesh_displace_fbm · terrain_region_mask · mesh_scatter_boulders · mesh_edge_lengths · mesh_subdivide · displacement_band_weights · mesh_displace_spectrum


*Provenance: render3d.py — 3D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.