ambient_occlusion — 3D render op

• Data kinds: mesh → image2d

• Call: import fullseye as fs; fs.ledger.ambient_occlusion(V, F, pose=None, intrinsics=None, width: 'int' = 256, height: 'int' = 256, n_dirs: 'int' = 64, max_dist: 'float | None' = None, k: 'int' = 3, background: 'float' = 1.0, method: 'str' = 'auto') -> 'np.ndarray' (to call the implementation directly, import render_ao; render_ao.ambient_occlusion(V, F, pose=None, intrinsics=None, width: 'int' = 256, height: 'int' = 256, n_dirs: 'int' = 64, max_dist: 'float | None' = None, k: 'int' = 3, background: 'float' = 1.0, method: 'str' = 'auto') -> 'np.ndarray'; from the registry, ops3d.get("ambient_occlusion"))

Usage

Render the mesh into an AO map image (H, W) in [0,1].

Obtains depth / silhouette / triangle id and perspective-corrected barycentric coordinates with render3d.render_mesh (rasterisation and hidden-surface removal are left to it, not reinvented), and bakes in the per-vertex AO of the object-space vertex_occlusion by barycentric interpolation from the 3 vertices of the triangle covering that pixel. Outside the object (silhouette=0) is background (default 1.0 = fully exposed). When *pose* / *intrinsics* are omitted, render3d.auto_view frames the view. fail-closed validation follows the lower-level functions.

k is unused since 2026-09-02 (kept for backward compatibility). Until then it looked up the nearest k vertices in camera space and mixed them with inverse-distance weights, but on surfaces with coarse vertices this gave polygonal cells, which showed up as a mottled pattern on the ground of the article's hero image. Barycentric interpolation is an exact linear interpolation inside the triangle, so it is continuous regardless of vertex density, and it never picks up vertices of a different, adjacent object.

Background guides (the physics and conventions behind this op)

• blender_interop — Using Blender alongside — build the shape, measure it with fullseye (pitfalls: axes, units, ground truth)

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)

• render_ao — py -3.11 examples_3d/render_ao.py

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

fuse_to_voxel · fit_poly_surface · eval_poly_surface · surface_form_error · background_flatten · polar_unwrap · fit_zernike · matcap_shade

Same category (render)

project_points · render_point_depth · render_volume_projection · render_shaded · cast_shadow · phong_shade · matcap_shade · supersample_mesh


*Provenance: render_ao.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.