aukio-3d.git
7 weeks agowip
Svjatoslav Agejenko [Thu, 8 Oct 2026 22:23:10 +0000 (01:23 +0300)]
wip

7 weeks agofeat(gi): staged progressive GI bake with caches and atmospheric haze master
Svjatoslav Agejenko [Thu, 8 Oct 2026 21:08:42 +0000 (00:08 +0300)]
feat(gi): staged progressive GI bake with caches and atmospheric haze

Restructure the global illumination bake into a four-stage
progressive pipeline: a uniform per-polygon direct preview, a
centroid bounce pass, a coarse per-texel lightmap bake, and a
fine-resolution refine pass that upscales composites and restarts
the solver at final density. New giStage2/3/4Radius config keys
gate each stage to a camera-distance bubble, re-evaluated at every
generation barrier, with idle workers catching up late entrants
against the frozen converged field.

Add LightmapCache and GiCentroidCache LRU stores so world cells
streaming out and back in restore baked lighting instantly; both
are validated against a light signature that now includes the sky
color. Mesh-block triangles gain per-texel lightmaps inside the
stage-3 bubble, resampling the block's photo texture into lightmap
space. Escaped bounce rays now sample the sky dome
(BOUNCE_GAIN x sky x SKY_SCALE, -De3d.gi.skyScale default 0.5).

Rewrite Lightmap onto an orthogonal bounding-rect frame with
aspect-first sizing plus refine()/restoreComposite() support.
Two-sided composite shapes emit a reversed-winding lightmapped
back triangle with its own lightmap.

Add an Atmosphere class implementing exponential distance haze,
folded into the existing per-polygon light multipliers of solid
and textured triangles, with AtmosphereTest coverage. Extend
ViewPanel with a per-instance enableGlobalIllumination overload
and accessor, and record the launch command and working directory
in BugReport.

Surface GI observability in DeveloperToolsPanel via a new
thread-safe Status snapshot (stage, queue progress, coverage,
cache sizes). Update the global illumination and configuration
documentation and drop the two one-off review write-ups.

8 weeks agofeat: bounce-generation GI bake and SpaceMouse Wireless BT support
Svjatoslav Agejenko [Fri, 2 Oct 2026 19:13:00 +0000 (22:13 +0300)]
feat: bounce-generation GI bake and SpaceMouse Wireless BT support

Global illumination is rebuilt around strict bounce generations
instead of the phased scheduler: generation 1 caches per-texel light
visibility (direct light is always derived from it, never stored),
generation k gathers the hit surface's generation-(k-1) delta so each
generation adds exactly one bounce, and a global barrier freezes the
field within a generation (plain running-mean sampling, no EMAs). The
bake terminates on a mean-delta threshold or the e3d.gi.generations
cap, and all per-texel arrays (indirect totals, delta buffers,
visibility) are freed when the bake completes — a finished lightmap
keeps only its final composite texture. The phased mode's knobs
(phases, activeWindow, resortDistance, freezeThreshold, alphaMode,
compositeAlpha, calmThreshold) are gone, replaced by generations,
samples and deltaThreshold.

SpaceNavigatorHid now supports multiple 3Dconnexion models behind a
Model enum: SpaceNavigator over USB and SpaceMouse Wireless over
Bluetooth, which sends one combined 13-byte six-axis report, a button
report and a battery report (charge 0..100 plus charging flag). The
hot-plug manager prints the detected model. The udev rules gain a
KERNELS match for the Bluetooth model, which enumerates via uhid so
idVendor/idProduct attributes do not exist.

Docs (GI pipeline and SpaceMouse manuals, index, AGENTS.org) are
rewritten to match; ViewPanel drops unused head-tracking imports.

8 weeks agofeat(e3d): GI for mesh blocks, frustum far-plane and subpixel cull fixes
Svjatoslav Agejenko [Mon, 28 Sep 2026 20:53:42 +0000 (23:53 +0300)]
feat(e3d): GI for mesh blocks, frustum far-plane and subpixel cull fixes

Global illumination now traces lean TriangleMeshBlock geometry:
each block triangle is a TriangleBvh.Entry with no backing polygon
(the entry carries the block and triangle index), sampled
per-triangle like plain polygons. Phase A writes direct light with
shadow bits and phase B adds the bounce estimate straight into the
block's new per-triangle giLight array (allocated at 255 = full
texture, so enabling GI shows no dark age); MeshTriangle.paint
copies the triplet before the span loop and the span writers
multiply sampled texels by it — per-triangle baked shading at a
branch per pixel. Albedo for bounce rays comes from each texture's
cached average color. Blocks skip the texel/lightmap phase
entirely.

Because streaming worlds bump the render-list version per loaded
cell, snapshot rebuilds are single-flighted (one worker builds, the
rest keep sampling the old snapshot) and rate-limited
(-De3d.gi.minRebuildMs=, default 1000 ms) so bursts coalesce
instead of rebuilding a multi-million-triangle BVH back-to-back.

Raise the frustum far plane from 10000 to 1e9 units
(-De3d.cull.far=): the short plane wrongly culled distant cell/LOD
composites whose whole bounds lay beyond it, punching holes into
mid-distance terrain while streaming (bugreport-20260928-005318;
FO4 LOD blocks span 100k+ units). Add -De3d.cull.frustum=false to
disable composite culling and -De3d.cull.frustumTrace=true to log
culled composites' bounds.

Include paint margins in the subpixel cull span: single-vertex
shapes (Billboard/GlowingPoint) have a zero raw span and their
entire visible area IS the margin, so the raw-span test culled them
regardless of glow size — billboards rendered invisible.

Document the mesh-block GI path, the far-plane rationale, and the
new tuning properties in the Global illumination and Frustum
culling pages and AGENTS.org.

2 months agofeat: phased progressive GI scheduling and Wavefront OBJ loading
Svjatoslav Agejenko [Sun, 27 Sep 2026 19:02:50 +0000 (22:02 +0300)]
feat: phased progressive GI scheduling and Wavefront OBJ loading

Replace the flat round-robin GI scheduler with a three-phase
progressive pipeline ordered near-to-far from the camera: phase A
stamps ambient + direct light at polygon centroids so the scene
lights up as a visible wave; phase B converges multi-bounce
indirect light at centroids scene-wide; phase C refines lightmaps
per texel. Phases B and C run on a bounded 256-entry active window
that graduates calm entries, re-sorting pending work when the
camera moves more than 25 world units. Graduated lightmaps keep
recompositing through a display-freeze tail so no centroid-stamp
bias survives as visible seams. The legacy scheduler stays
available via -De3d.gi.phases=false. ViewPanel now feeds the
camera position into the GI system, and a torn-read guard prevents
converging partial snapshots.

Add a Wavefront OBJ loader (ObjLoader/ObjModel/ObjMaterial):
vertices, faces in all index forms including negative and forward
references, usemtl/mtllib resolution, and MTL Kd diffuse color
with d/Tr opacity. Faces become SolidPolygons inside an ObjModel
composite, so shading, culling and transforms work as for any
composite.

Extend Transform with a uniform scale applied before rotation
(negative values mirror geometry and flip winding; zero and
non-finite values are rejected). TransformStack bakes the scale
into the composed matrix at push time, so per-vertex render cost
is unchanged and unscaled scenes render bit-identically.

Light two-sided polygons per side: SolidPolygon computes a
reverse-side shaded color from the negated normal, and
LightmappedCompositeShape emits a reversed solid back triangle for
unculled polygons so undersides no longer show the front side's
light.

Add udev rules for RayNeo XR glasses and the 3Dconnexion
SpaceNavigator, tests for transform scaling and OBJ loading, and
documentation pages for octree ray tracing, GUI components,
SpaceMouse input, configuration and subpixel culling.

2 months agoinitial commit
Svjatoslav Agejenko [Sat, 26 Sep 2026 07:26:35 +0000 (10:26 +0300)]
initial commit