nx_scene_render.nx
buildroot/runtime/nx_scene_render.nx
about
nx_scene_render.nx -- render ONE (SceneWorld, SceneEntity) pair under
any style (exceed-ladder R0; pairs with nx_scene_contract.nx).
Side-elevation view: the camera slice is the entity's anchor row. Each
screen column maps to a world cell; ground height -> screen row; terrain
filled below, sky above; the synthetic human stands ON the ground at the
anchor (insertion is physical, not a paste).
Style law (from the contract): the SAME entity + world render under all
four styles; only the named tables change the art:
REALISTIC -- continuous elevation gradient + slope shading
ANIME -- 5 cel bands, saturated, bright sky, eye dots
CARTOON -- 3 flat bands, dark outline around figure and band edges
VN -- sunset-gradient backdrop, terrain as far silhouette,
portrait-scale sprite with eyes
Tier 0: nx_scene_quickstart(world_seed, human_seed, style, path)
-- one call -> a P6 PPM scene on disk.
license_tier: ORIGINAL
dependencies 4 imports · 1 importers
imports: nx_syscalls.nxnx_tier.nxnx_scene_contract.nxnx_ppm_writer.nx
imported by: nx_scene_contract_test.nx
structs
| none |
consts
| 25 | const NX_MAGIC_65536: i64 = 65536 |
| 26 | const NX_MAGIC_1024: i64 = 1024 |
| 27 | const NX_MAGIC_999999: i64 = 999999 |
| 28 | const NX_MAGIC_4096: i64 = 4096 |
| 31 | const NX_SCN_W: nx_int = 256 |
| 32 | const NX_SCN_H: nx_int = 192 |
| 33 | const NX_SCN_GROUND_BASE: nx_int = 160 // screen row of elevation 0 |
| 34 | const NX_SCN_ELEV_SCALE_Q10: nx_int = 24 // px per Q10 elevation unit, /1024 |
| 37 | const NX_SCN_RENDER_BUDGET_MS: nx_int = 200 |
| 124 | const NX_SCN_OUTLINE_RGB: nx_int = 0x1A1A1A |
functions
| 40 | func _scn_px(fb: *u8, x: nx_int, y: nx_int, rgb: nx_int) -> nx_int |
| 52 | func _scn_rect(fb: *u8, x0: nx_int, y0: nx_int, rw: nx_int, rh: nx_int, rgb: nx_int) -> nx_int |
| 65 | func _scn_disc(fb: *u8, cx: nx_int, cy: nx_int, r: nx_int, rgb: nx_int) -> nx_int |
| 82 | func _scn_lerp_rgb(a: nx_int, b: nx_int, t_q10: nx_int) -> nx_int |
| 99 | func _scn_sky_top(style: nx_int) -> nx_int called by 1: _scn_terrain |
| 105 | func _scn_sky_bottom(style: nx_int) -> nx_int called by 1: _scn_terrain |
| 111 | func _scn_ground_low(style: nx_int) -> nx_int |
| 115 | func _scn_ground_high(style: nx_int) -> nx_int |
| 119 | func _scn_band_color(style: nx_int, band: nx_int, n_bands: nx_int) -> nx_int |
| 128 | func _scn_ground_row(h_q10: nx_int) -> nx_int |
| 135 | func _scn_terrain(fb: *u8, land: *Landscape, slice_y: nx_int, style: nx_int) -> nx_int |
| 200 | func _scn_entity(fb: *u8, land: *Landscape, e: *i64, style: nx_int) -> nx_int |
| 268 | func nx_scene_render(sw: *i64, e: *i64, fb: *u8) -> nx_int |
| 277 | func nx_scene_quickstart(world_seed: nx_int, human_seed: nx_int, called by 1: main calls 9: nx_scene_worldnx_entity_humannx_scene_placesys_mmapnx_scene_renderppm_write_p6+3 |