bump_normals_fbm — 3D terrain op

데이터 종류: normalmap × pointmapnormalmap

호출: 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'(구현을 직접 호출하려면 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', 원장에서 가져오려면 ops3d.get("bump_normals_fbm"))

사용법

seed 가 있는 다중 옥타브 높이장의 기울기로 법선 맵을 섭동합니다.

> 아래 상세 설명은 원문입니다 —— 요약과 제목은 번역되어 있습니다.

(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 :func: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

:func: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.

入出力はともに `(H, W, 3) 画像。positions` に NaN を含む画素、または法線の長さが

`1e-12 以下の画素は背景として **元の値のまま** 残す(render3d.render_mesh` の空画素)。

有効画素が一つも無ければ入力のコピーを返す。

• `wavelengths / amplitudes: メッシュ(= positions`)の単位で同じ長さ(1〜32)の

正の列。不一致・負は `ValueError`。

• `rotation: 3×3(world → 法線の座標系)。与えると法線を N @ R` で world に戻して

勾配を取り、`@ R.T で元の系に戻す。render_mesh` の法線はカメラ空間なので

`pose[:3,:3] を渡す。非有限・形不正は ValueError`。

• `step: 中心差分の刻み(既定 min(wavelengths)/64)。0 以下は ValueError`。

• `local_edge: (H, W)` の辺長マップ。形が法線と違う、または有効画素の下に非正・

非有限があると `ValueError`。

高さ場を 3 軸の中心差分で微分するので評価は 1 画素あたり 6 回。法線の傾きは

`max |∇h| ≈ 2π A_k / λ_k` 程度なので、振幅が波長に近づくほど法線が大きく寝る

(既定は A/λ = 0.1 前後)。結果は `phong_shade / brdf_hapke` 等の

法線マップ入力へそのまま渡せる。

참고(샘플 데이터·문헌)

• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL URL.

• 연산자의 내력·참고문헌 —— 이 연산자 족의 바탕이 된 연구/기법의 출처.

실행 가능한 예제(이 연산자를 실제로 호출하는 검증된 샘플)

itokawa_regolith_heropy -3.11 examples_3d/itokawa_regolith_hero.py

타입이 이어지는 다음 연산자(normalmap 를 입력으로 받는 것)

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

같은 카테고리(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 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*

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