code wiki / (root) / nx_silhouette_quality.nx

nx_silhouette_quality.nx

buildroot/runtime/nx_silhouette_quality.nx

14378 B382 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_silhouette_quality.nx -- horizon/skyline quality grader. Per the honest audit 2026-05-16: heightmap statistical graders (nx_world_quality_grader) can return S-class for terrain that nonetheless produces a FLAT-LOOKING HORIZON. This primitive grades the SILHOUETTE -- what you see when you look toward the horizon -- on 5 axes designed to catch "high-stats, low-vista" worlds. Method: from a camera viewpoint, sample N azimuth rays (default 64) around the horizon. For each ray, march outward across the heightmap and find the maximum ANGULAR ELEVATION (apparent height above the camera, projected to a small-angle proxy: elev_proxy = (max_h - cam_y) / dist scaled to Q14). This produces a silhouette of N samples. AXES (Q14 [0, Q]; higher = better skyline): 0. ELEVATION_RANGE: max - min angular elevation across silhouette. Worlds with all peaks at the same apparent height = 0. 1. PEAK_COUNT: local-maxima count; target 3-8 distinct peaks per half-horizon. Catches uniform-tooth-saw silhouettes. 2. SMOOTHNESS: penalty for too-jagged AND too-smooth. Mean abs second-difference compared to target band. 3. ASPECT_DIVERSITY: stddev of peak-to-peak widths. Catches repetitive tooth patterns. 4. SKY_BALANCE: fraction of view that is sky (above horizon proxy threshold); target 0.3 - 0.7. Catches "all mountains" and "all flatland". EMITS LAYER_VERDICT (kind = NX_LAYER_KIND_READABILITY, REFINE_HINT = REFINE_MORE_FEATURES). genealogy_id: appleton_1996_landscape_aesthetics + horizon_silhouette_canon lineage_id: nx_silhouette_quality_5axis_v1

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_camera_q14.nx nx_layer_verdict.nx nx_silhouette_quality.nx

imports: nx_syscalls.nxnx_tier.nxnx_camera_q14.nxnx_layer_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap nx_silhouette_quality_grad _sq_build_silhouette nx_camera_cos_q14_centideg nx_camera_sin_q14_centideg _normalise_centideg nx_camera_sin_q14_centideg ↻ _sq_range_q14 _sq_peak_count_q14 _sq_smoothness_q14 _sq_aspect_div_q14 sys_mmap ↻ _sq_sky_balance_q14 nx_layer_verdict_init nx_layer_verdict_finalize nx_layer_grade_from_axes nx_lv_axis_verdict nx_lv_grade_is_valid

structs

none

consts

48const NX_MAGIC_36000: i64 = 36000
50const NX_SQ_Q: nx_int = 16384
53const NX_SQ_AXIS_RANGE: nx_int = 0
54const NX_SQ_AXIS_PEAK_COUNT: nx_int = 1
55const NX_SQ_AXIS_SMOOTHNESS: nx_int = 2
56const NX_SQ_AXIS_ASPECT_DIV: nx_int = 3
57const NX_SQ_AXIS_SKY_BALANCE: nx_int = 4
59const NX_SQ_AXIS_COUNT: nx_int = 5

functions

71func _sq_build_silhouette(
113func _sq_range_q14(
138func _sq_peak_count_q14(silhouette: *i64, n_rays: nx_int) -> nx_int
163func _sq_smoothness_q14(silhouette: *i64, n_rays: nx_int) -> nx_int
191func _sq_aspect_div_q14(silhouette: *i64, n_rays: nx_int) -> nx_int
246func _sq_sky_balance_q14(silhouette: *i64, n_rays: nx_int) -> nx_int
276func nx_silhouette_quality_grade(
303func main() -> i64