aukio-3d.git
5 days 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.

6 days 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.

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