Repository navigation
Strata 0.8.0
Wide lines, world-anchored labels, RGBA mesh colours, ambient and sun
levels, and window fullscreen: STRATA_ABI_MINOR moves from 12 to 17, and
every addition is compatible (STRATA_ABI_VERSION stays 1). The web kit
moves to 1.2 (Host::wideLine, Host::label, the light levels, a loader
that can cover one section of a page). The Python binding knows the v0.7.0
and v0.8.0 libraries' SHA-256s and gains Engine.set_fullscreen() and
Engine.fullscreen().
-
ABI 1.17: window fullscreen.
strata_set_fullscreen(engine, enabled)makes
the window cover its display, borderless at the desktop's resolution (no
video mode change), or puts it back as a window at its earlier size;
strata_is_fullscreen(engine)reports the state. The switch is synced
before the call returns, sostrata_get_drawable_sizeis already right,
and aSTRATA_EVENT_RESIZEDfollows as for any resize. Window surface
only: headless and host-context engines returnSTRATA_ERROR_UNSUPPORTED
and change nothing. In a browser it's the Fullscreen API, granted only from
a user gesture. Python:Engine.set_fullscreen(),Engine.fullscreen();
C#:StrataNative.strata_set_fullscreen,strata_is_fullscreen. No
golden changes. -
ARCHITECTURE.md,
STRATA_LIGHTING_SUN(#99): why a sun a few degrees above
the horizon draws a dark frame with the default levels. A table gives the
key light,n·l, ambient and the fraction of a flat surface's colour
received at 2°, 5° and 30°, evaluated fromsrc/render/sun.cppand the sun
shader. The section also covers how to raise and then reset the ABI 1.16
light levels for low-sun stills. Docs only: no ABI change, and no golden
changes. -
docs/LARGE_SCENES.md(#102): a guide to map-sized scenes. It covers
choosing the near and far planes (depth precision, and fog, which runs from
0.35 × the far plane to the far plane), camera height compared with terrain
relief, exaggerating heights in the terrain tile rather than the camera,
shadow_distanceand marker size. Docs only: no ABI change, and no golden
changes. -
Value noise and fractal Brownian motion in
modules/sim
(strata/sim/noise.hpp).valueNoise(x, y, seed)is smoothstep-blended
lattice value noise from an integer hash;fbm(x, y, FbmParams)sums
octaveslayers (each with its own seed and lattice offset) withgain
andlacunarity, normalised to [-1, 1]. No global state; the same seed
gives the same values on every compiler. Games built on Strata that drew
terrain or patches from one or two octaves got smooth, round edges: the
header carries a table, measured on this implementation with the new
strata-sim-fbm-dimensiontool, of the box-counting dimension of a level
set's edge (about 1.0 for 1-4 octaves; 1.01 to 1.31 for gain 0.5 to 0.75
at 9 octaves; natural coastlines are about 1.1-1.3). Unit tests pin the
values for fixed seeds and check that more gain gives a rougher edge. C++
only: no ABI change, and no golden changes. -
Wide lines (ABI 1.13, #46).
strata_submit_linesdrawsGL_LINES, which
are one pixel wide, and WebGL 2 draws no wider, so at DPR 2 or 3 a road,
river or route nearly vanished.strata_submit_wide_lines(engine, vertices, count, flags)takes pairs of the newStrataWideLineVertex(36
bytes: position, colour,width_pixels,world_width;
STRATA_STRUCT_WIDE_LINE_VERTEX= 17) and draws each segment as a
camera-facing quad with a one-pixel antialiased edge, in the browser as on
the desktop. The width at each end is the larger ofwidth_pixelsand
world_widthas projected there, and varies along the segment, so a
ribbon can taper; the colour varies too. Flags:STRATA_LINES_ON_TOP(as
forstrata_submit_lines_ex) and the newSTRATA_LINES_ROUND_CAPS, round
ends so a polyline's segments join without notches
(strata_submit_lines_exstill rejects it). A segment that crosses behind
the eye is cut there.StrataLineVertex,strata_submit_linesand
strata_submit_lines_exare unchanged and draw exactly what they drew:
every existing golden passes as it was.STRATA_ABI_MINORis 13. The C#
(StrataWideLineVertex,strata_submit_wide_lines,LinesRoundCaps)
and Python (WideLineVertex,Engine.submit_wide_lines,
LINES_ROUND_CAPS) bindings have it, and the web kit's host has
Host::wideLine(...)(round caps by default), submitted with the frame
and counted insk_statsline segments; the kit's version stays 1.1, as
its page/wasm contract did not change. The scene format haswide_line;
new goldenw1_wide_lines, unit tests for validation and the layout,
layout tests in C# and Python, and a Python test that a 10-pixel line
covers 10 pixels. -
ABI 1.14, world-anchored labels (#47). Both additions are compatible;
every ABI 1.x host keeps working and no existing image changes.strata_project_pointprojects a world point with the camera last set
onto the drawable as it is now: pixels from the top-left (the
coordinatesStrataTextandStrataRectuse), the distance along the
view axis (asstrata_read_depth_f32measures it) and whether the
point is in front of the camera. Hosts in C, C++, C# and Python no
longer re-derive the engine's view-projection to place a label.strata_submit_world_texttakesStrataTexts plus one world anchor
each; a text'sxandybecome a pixel offset from where its anchor
lands. Anchors are projected atend_framewith the frame's camera and
size, labels behind the camera are skipped, and labels are drawn after
the frame's rectangles and before its screen text. They are not
depth-tested. GL-freeprojectPointinsrc/render/overlay.cpp, with
unit tests;Engine::projectPoint,Engine::submitWorldText.- Python:
Engine.project_point((x, y, depth)orNonebehind the
camera) andEngine.submit_world_text. C#: the two P/Invokes. - Web kit 1.2:
Host::label(x, y, z, text)centres an engine-drawn label
just above a world point, so it shows in stills rendered with
sk_save_pngas well as in the page. It compiles out against an older
strata.h, so a vendored kit still links with the 0.7.0 library. The
example scene labels its lamp. - New golden
o3_world_labelsand alabelscene directive. - Text is still Strata's 8 x 8 printable-ASCII font: a non-ASCII
character (an accented place name) shows as one?. A wider glyph set
is left for a separate change.
-
ABI 1.16: ambient and sun levels (#49). In
STRATA_LIGHTING_SUNthe ambient
and the sun's strength were fixed functions of time of day, so a host could
not lift a scene's shadow side or dim the sun for weather without moving
it.strata_set_ambient(engine, tint, lift)makes the hemisphere ambient
(and SPACE's flatlegacy_ambient)ambient * tint + lift;
strata_set_sun_intensity(engine, intensity, tint)scales the key light
(the sun, or the moon at night) and keeps its direction, shadows and the
sky. Both stay acrossstrata_set_lighting, are ignored by LEGACY, and
are validated (tint and intensity 0..16, lift 0..1; NULL is the default).
New functions only:StrataLightingis unchanged,STRATA_ABI_VERSION
stays 1 andSTRATA_ABI_MINORis 16. The defaults draw exactly what 1.15
drew (x * 1 + 0isx): every existing golden passes unchanged, a unit
test checks the sky bit for bit over a whole day, and the Python test
draws the same bytes with and without explicit default calls. In the C#
and Python bindings (set_ambient,set_sun_intensity). Scene files gain
ambientandsun_intensity; new goldensun_levels_overcast
(before and after:docs/media/light-levels.png). -
Web kit 1.2 (the same unreleased kit minor as
Host::label, #47):
Host::ambientTint,ambientLift,sunIntensityand
sunTint(applied every frame; the defaults draw what 1.1 drew), and
Host::fill(light, lift, priority): a fill light whoseliftis added to
the ambient when the tier's light budget drops it, so a scene that stands
in fill lights for ambient no longer goes dark at tier 0 (4 lights). The
tiers' budgets are unchanged, and a light added withlight()adds
nothing when dropped, so no tier changes for an existing host. Unit tests
intest_kit_lights.cpp. -
Web kit: a vendored kit builds against the 0.7.0 library again (#68).
Host::wideLine(ABI 1.13) and the light levels (ABI 1.16) called the
newer functions with noSTRATA_ABI_MINORguard, so docs/WEB.md's
promise that the newer parts compile out held only forHost::label.
They are now guarded like it; against an olderstrata.hthey are absent
and a droppedfilllight adds no ambient. A new compile-only target,
strata-kit-abi-floor, builds the kit's example scene with
STRATA_ABI_MINORlowered to 12 and every newer name poisoned (GCC and
Clang), so an unguarded call fails the build. No ABI or pixel change. -
Web kit: the slow bar (
StrataLoader.slow()) wraps its buttons under its
text when the row is too narrow, and its width is no longer capped at half
the viewport (an auto width besideleft:50%). On a 390 px phone it used
to squeeze the text and the button onto several lines each, side by side.
The smoke test's loader checks now include the bar at 390 px. The kit
version stays 1.1. -
Web kit: a canvas with no CSS size no longer grows on every frame at a
device pixel ratio over 1 (#89). Such a canvas is shown at itswidthand
heightattributes, which the kit sets to its displayed size times the
DPR, so it doubled until the browser's canvas limit; docs/WEB.md's page
example had one.StrataKit.createnow finds a canvas sized only by its
attributes, pins its CSS size once at what it showed (kit.cssPinned)
and warns in the console; a canvas with a CSS width or height is left as
it is. The WEB.md example gives its canvas a CSS size, and the smoke test
checks, with a stub module, that an unstyled canvas at DPR 2 keeps its
size over 12 frames of the real loop. Part of the unreleased kit 1.2. -
Web kit: multi-touch no longer makes taps nobody made (#90). Every
pointer-down reset the shared drag distance and every pointer-up under
6 px tapped, so a second finger touched during an orbit selected
something, a two-finger tap or small pinch tapped twice (the second
usually clearing the first's selection), and a right click tapped. A
gesture now runs from the first pointer down to the last pointer up and
taps once, on that last pointer-up, only if exactly one pointer was down
in it, it moved under 6 CSS pixels in all, and it was not a right or
middle mouse button. The smoke test's stub-module checks drive two
synthetic touch pointers and real right, middle and left clicks. Part of
the unreleased kit 1.2. -
Docs:
shadow_distanceshould be scaled to the scene. The shadow bias is
measured in cascade texels, and a cascade's size followsshadow_distance
(capped at the far plane), so a scene a few units across under the
default 150, with one 1024² cascade, loses its small objects' shadows.
strata.h, ARCHITECTURE.md and docs/WEB.md now say so, along with the
web kit'sshadowDistanceMin. No ABI, code or pixel change. (#53) -
Docs: what colour space Strata outputs. Colours are documented as linear,
but nothing encodes them on the way out: the shaders write the lit value
unencoded and Strata does not touchGL_FRAMEBUFFER_SRGB, so the screen,
strata_read_pixels_rgba8and the golden PNGs show those bytes as sRGB.
Hosts have guessed differently at what to pass.strata.hand a new
"Colour space" section in ARCHITECTURE.md now say what reaches the screen.
Opaque, untextured unlit draws show a colour exactly as passed (soft
points are added to what is beneath instead). Lit surfaces come out darker
in the mid-tones, and decoding sRGB to linear first only darkens
everything further. None of this holds when a host context enables
GL_FRAMEBUFFER_SRGBitself. An opt-in output encode is still open. No ABI, code
or pixel change. (#48) -
Docs: caught up with what has landed since 0.7.0. README.md's status table
gains wide lines (ABI 1.13) and RGBA mesh colours (ABI 1.15), and no longer
lists the OpenUSD modules as still to come. ARCHITECTURE.md gains the light
levels (ABI 1.16), RGBA vertex colours, andsrc/core/andweb/kit/in its
layer table. No ABI, code or pixel change. -
Docs: docs/DRIVE.md now gives the two replies it left out: a line that is
not a JSON object answers with noop, and a step cut short by the engine
going away replies withended: true. It also says that a blank line gets
no reply, and that more than 1 MiB waiting to be read with no newline closes
the connection. docs/WEB.md no
longer says CI holds browser goldens to 0 pixels over ΔE 4 (both browser
checks use the default tolerance), no longer gives 22 as the current number
of golden scenes, lists the nativesk_shutdown, and puts the web kit's row
back in the Testing table. No ABI, code or pixel change. -
Web kit: the loader can cover one section of a page instead of the
viewport.StrataLoader.load()andshow()takecontain: truewith
mount: the overlay and the slow bar are thenposition:absoluteinside
mountand scroll with it (astaticmount is madeposition:relative).
Withoutcontainnothing changes. The smoke test (testing/smoke.cjs)
scrolls a canvas that is not wholly on screen into view before it captures
and taps, so a scene below the fold no longer reports "0 target(s) on
screen"; a full-screen canvas is not moved. The example page has an
?embed=1layout (the scene below the fold, the loader contained), and CI
runs the smoke test against it. The kit version stays 1.1. (#53) -
ABI 1.15:
STRATA_MESH_COLORS_RGBA(StrataTexturedMesh.flags) reads
mesh.colorsas RGBA quadruples per vertex instead of RGB triples; the
alpha is validated and ignored (a mesh's alpha is stillcolor[3]).
StrataMesh.colorsis RGB whileStrataMesh.coloris RGBA, and a host
that passed RGBA per vertex got every vertex after the first coloured
wrongly with no error; the header now says so, and such a host can pass
the flag throughstrata_add_textured_meshwith texture 0. Older
libraries reject the flag as unknown. The Python binding'sadd_mesh
raisesValueErrorwhencolorsis too short for the vertices (the
library would read past it) and warns when it is RGBA without the flag.
STRATA_ABI_VERSIONstays 1; no layout or pixel change. The drive
channel's hello reports"abi":"1.15". (#53) -
Scene files read by
tools/common/scene_file.cpp(strata-golden)
refuse a few malformed lines they used to load (#75); the C# primitives
harness parses scenes itself and is unchanged. Anexpect_raydistance or an
itemalpha that is present but does not parse is an error instead of
being dropped, so a typo can no longer turn off a distance check. Numbers
inexpect_ray's mesh index andexpect_depth's distance must parse
whole (5xis no longer read as5). Asun dateday is checked against
its month, leap years included. Anything after a directive's last field
is refused asunexpected '<word>' at the end of the line. Every scene in
tests/scenesstill loads; no library or pixel change. -
Sim module:
Registry::clear()no longer brings old handles back to life
(#80). It threw the slot generations away, so the first entity created
after it was{0, 0}again and a handle kept from before the clear read as
alive and pointed at the new entity. Slots are now kept and freed, and each
living slot's generation is bumped asdestroy()bumps it; new entities
still take the lowest slot first.capacity()no longer drops to 0 on
clear(). No library, ABI or pixel change. -
Sim module:
Rng::range(lo, hi)works for spans wider thanINT32_MAX
(#81). It computedhi - loinint32_t, which overflows (undefined
behaviour) for such spans; with the usual wrapping
range(INT32_MIN, INT32_MAX)always returnedlo. The span and the result
are now computed in 64 bits, and the full int32 range takes one
nextU32(). Every span that did not overflow gives the same numbers as
before, bit for bit (a pinned-sequence test checks it), so seeded runs and
their state hashes are unchanged. No library, ABI or pixel change. -
CI: the Linux save-benchmark gate fails when
strata-save-benchdoes
(#82). The step ran underbash -ewithoutpipefail, sotee's exit
status hid a failed or crashed benchmark, andmodules/save/bench/gate.py
passed whatever lines it was given, an empty file included. The step now
runs withshell: bash(which addspipefail), the benchmark's stderr is
no longer discarded (on Windows either), and the gate fails with an
::error::for every budgeted size (1000 and 10000 agents) that has no
result. New Python tests (tests/python/test_save_bench_gate.py) check
that an empty or partial results file fails. No library change. -
Docs: two comments in
strata.hare corrected (#84). The ABI 1.7
textures paragraph said texel alpha is ignored because meshes are opaque;
since ABI 1.11 aSTRATA_MESH_TRANSLUCENTmesh's alpha ismesh.color[3]
times the texel's alpha, as the translucent flag's own comment says.
STRATA_MESH_COLORS_RGBAsaid a 1.7 to 1.12 library rejects it; 1.13 and
1.14 libraries do too, so the range reads 1.7 to 1.14. No code change. -
Python binding:
Engine.add_meshraisesValueErrorwhennormalshas
fewer than 3 floats a vertex oruvsfewer than 2, as it already did for
colors, andcreate_texture_rgba8/update_texture_rgba8raise it when
rgbais shorter thanwidth * height * 4bytes (#79). The C ABI takes no
lengths for these, so a short sequence was read past its end in native
code. Tests intests/python/test_argument_checks.pyneed no library. -
C# binding:
StrataNativedeclaresstrata_status_string,
strata_set_log_callbackandstrata_camera_look_at, which it was
missing, andStrataAbihasMaxTexturesandMaxTextureSize(#83). The
log callback is aStrataNative.StrataLogFndelegate that the binding
keeps referenced while it is installed, so the GC cannot collect it under
the library. A new test checks that everySTRATA_APIfunction in
strata.hhas a matchingDllImportentry point, so the binding cannot
fall behind the header again. -
Save module: loading past a damaged
HEADno longer costs the older saves
(#85). The next save hard-linked the damagedHEADover the valid
HEAD.prev, and its history held only the loaded save, so prune deleted
every older intact save; a migration after a fallback pruned the original
save it had just promised to keep.HEAD.previs now replaced only when
the currentHEADparses, and after a fallback the slot's history lists
every save whose bytes still match the hash in its name, loaded save
first, so the next save prunes by the usualkeeplimit instead. A
migration keeps the original save in the history right after the migrated
one. No ABI change; saves written before are read as they were. -
USD module: a variant selection cleared since the baseline is saved (#86).
writeDeltaskipped empty selections, andSetVariantSelection(set, "")
erases the opinion rather than authoring one, so the baseline's selection
came back on load. A cleared selection is now written as an explicit empty
selection (BlockVariantSelection), which blocks the weaker layers.
Unchanged selections still write nothing, so existing save bytes do not
change. -
Save module: a never-saved slot whose
HEADis damaged loads its base
(#87). It failed withno save in slot, although the base was intact. Now
the newest base whose bytes match the hash in its name loads as a
never-saved slot, withusedFallbackand a warning; the next save rewrites
HEAD. A missingHEADbehaves as before, a damaged base is still
refused, and theno save in sloterror now lists why each file was
rejected. -
USD module:
hydrateno longer sizes an allocation from the grid header
alone (#88). It allocated the whole grid before reading any chunk, so a
header claiming a huge grid over few chunks could throwbad_alloc, which
the never-saved load path did not catch. Every chunk is now counted, found
and size-checked before the grid is allocated, and that path catches
exceptions as the save candidates' path does.