Repository navigation
Strata 0.4.0
The browser (WebGL 2 through Emscripten), a seasonal sun, textures, picking
and texture updates. Every ABI addition is compatible: STRATA_ABI_VERSION
stays 1 and STRATA_ABI_MINOR is 8.
-
ABI 1.8, for Kindling
(a first-person cozy restoration game): grime cleaned patch by patch,
knowing what is under the crosshair, and mouse-look. All three are
compatible additions; every ABI 1.x host keeps working.strata_update_texture_rgba8replaces a rectangle of an existing
texture (same texel conventions as creation; the mip chain is rebuilt for
STRATA_TEXTURE_MIPMAPStextures). NewGpuDevice::updateTexturein the
GL 4.5 and GLES 3.0 / WebGL 2 devices;Engine::updateTextureRgba8.StrataRayHit(STRATA_STRUCT_RAY_HIT, 36 bytes) and
strata_raycast_meshes: the nearest static-mesh triangle along a ray,
through each mesh's model matrix, both faces counting. Meshes now keep a
CPU copy of their positions and indices for this (12 bytes per vertex
plus 4 per index). GL-free maths insrc/render/ray_pick.cpp, with unit
tests;Engine::raycastMeshes.strata_set_relative_mouse_mode: on the SDL3 window, hides and captures
the cursor and reports motion asdx/dyonly (pointer lock in a
browser);STRATA_ERROR_UNSUPPORTEDon headless and host-context
surfaces.Engine::setRelativeMouseMode.- C# mirror and P/Invokes in
Strata.Interop, with layout tests. - New golden
tex_update_grime, and two scene directives:
texture_update(applied between the two framesstrata-goldendraws)
andexpect_ray(fails the scene unless the raycast hits the named mesh).
-
The WebGL 2 / GLES device starts on contexts with fewer than 16 fragment
texture units. Its scratch unit (where textures are bound while created)
was fixed at 15, so a phone browser reporting 13 failed with "the GLES
device needs 16 fragment texture units". The scratch unit is now the
device's last unit, and 9 units (Strata's 8 plus scratch) are required. -
The USD and save modules build and pass their tests on Windows (MSVC).
modules/savegainsfs_win32.cpp(MoveFileExW with write-through,
FlushFileBuffers, LockFileEx; UTF-8 paths converted to UTF-16), selected
instead offs_posix.cppon Windows. The--crashsuite (fork, setrlimit,
SIGKILL) stays POSIX-only and reports itself skipped on Windows. CI builds a
Windows OpenUSD prebuilt once (key.sh windows,
build-openusd-windows.sh) and publishes it as a release asset beside the
Linux one. -
Strata runs in the browser (WebGL 2). A second
GpuDevicebackend,
OpenGL ES 3.0 (src/rhi/gles3_device.cpp), draws every pass: the GL 4.5
shaders are rewritten to GLSL ES 3.00 when pipelines are created, cube map
arrays become one cube map per shadowed light, base vertex/instance fold
into attribute offsets, and depth clamp usesEXT_depth_clampor a shader
fallback. The C ABI is unchanged (no new functions; ABI stays 1.7). Desktop
builds still default to OpenGL 4.5 and its goldens are unchanged. -
Emscripten builds (
emcmake cmake ..., emsdk 6.0.11 in CI): SDL3's
Emscripten driver for the canvas and input,libstrata.a(engine + SDL3 in
one archive), C++ exceptions compiled as-fwasm-exceptionsby default
(STRATA_WASM_EXCEPTIONS), andstrata-goldenas a web page. See
docs/WEB.md, including notes for .NETbrowser-wasmhosts. -
examples/village-day: the L2 village through a day, from the C ABI only;
an SDL3 window natively, a canvas in the browser. README animation of it
running in headless Chromium (tools/make_web_media.py). -
The desktop library can run the GLES device too:
STRATA_GL_API=gles3
selects it on an OpenGL ES 3.0 context (EGL or SDL3), and
STRATA_GLES_NO_DEPTH_CLAMP=1forces the depth clamp fallback. CI draws
the desktop goldens through it on llvmpipe (0 pixels over ΔE 4 on all 22). -
CI job
build-web: builds with Emscripten, runs the unit tests under Node,
checkslibstrata.adefines the C ABI, and draws every golden scene in
headless Chromium (Playwright 1.61.1, SwiftShader) against new
web-swiftshader.pnggoldens, with and withoutEXT_depth_clamp, and
against the desktop goldens at the default tolerance. Releases gain a
strata-<version>-wasm32-emscripten.tar.gzasset. -
glad is regenerated with OpenGL ES 3.0 merged into
glad/gl.h.
GpuDevicegainscreateIndexBuffer(WebGL fixes a buffer's kind at its
first binding). -
Seasonal sun (ABI 1.6):
StrataSolarPosition,strata_solar_position
(the sun's direction, elevation, azimuth, declination, hour angle and
equation of time for a UTC moment, latitude and longitude, from NOAA's solar
position equations) andstrata_set_sun_direction, which places the
STRATA_LIGHTING_SUNsun directly instead of bytime_of_dayand latitude.
The existing time-of-day sun is unchanged and stays the default. -
Scene files take
sun date <YYYY-MM-DD> <HH:MM> <utc_offset> <lat> <lon>.
New goldenssun_june_noon,sun_december_noonand
sun_december_afternoon. -
Textures and textured, transformable meshes (ABI 1.7):
strata_create_texture_rgba8(RGBA8, optional mip chain with trilinear
filtering, wrap or clamp per axis) andstrata_destroy_texture;
StrataTexturedMeshandstrata_add_textured_mesh(a static mesh with
uvs, a texture that multiplies its colour, andSTRATA_MESH_UNLITfor
emissive surfaces that ignore lights and fog and cast no shadow); and
strata_set_mesh_transform, a per-mesh model matrix (normals through its
inverse transpose) applied in the opaque and shadow passes, so a planet
spins about a tilted axis with one call a frame and no re-upload. -
GpuDevicetextures gain mip chains and repeat wrapping. Static meshes
now have their own pipelines (a uv per vertex, a model matrix in uniform
binding 3, the texture on unit 4); untextured meshes sample a white texel
and draw exactly as before. -
Scene files take
texture,sphere_mesh,uvs,mesh_texture,
mesh_unlitandmesh_transform. New goldenstex_globe_sunand
tex_space_planets.