Repository navigation
Ariadne scene: material: { opacity }, a node drawn see-through in the main view - #1238
Merged
Merged
Conversation
… main view
A scene node's material takes opacity: <0..1>, a state path, or { bind, default }. Below 1 the
node's meshes draw in the translucent pass, even with opaque: true (as a viewport override's
opacity does); a bound opacity follows its key each frame (read without seeding, clamped) on the
node's mesh, its LOD rungs and what a source: { data } node draws. GeometryNode::setForceOpaque
keeps its force but leaves it off while the mesh is see-through. Test cvcgl_ariadne_opacity and
AriadneScene.MaterialOpacity; docs/ARIADNE.md §5.4 "See-through nodes".
transfix
enabled auto-merge (squash)
November 14, 2026 20:36
transfix
added a commit
that referenced
this pull request
Nov 15, 2026
Master's #1217 keeps nothing per thread in state_exec: a native's context (call_args::context()) carries its group, registry and stream, async_host::call and begin_external take it, and the pool drops in_pump_all() and the one-argument run_on_host. - async_host.h: begin_external takes the context, as on master, and keeps this branch's note that a call is finished through the host it was made on. - script_engine.cpp: the sliced form finds the calling program's group from the call's context (exec_group::current(ctx)), else group 0, and reads its data step from the context. - ariadne.cpp: file-pick opens its picker through run_on_host for the group its verbs were bound for (the env's, as its host is), and inline in group 0 and the init lane. - exec_pool: in_pump_all() is back, for the host-thread calls' debug assertion and ScriptLane::run's refusal, read from the pool's calls (their callers' and pumpers' thread ids) under its mutex rather than from thread-locals. - ariadne_runtime_test: the init lane's cycles test no longer compares against the calling thread's own registry, which master removed; it is AriadneInit.RunsAScriptThatLeavesCycles. - ci.yml: the sanitizer's required list names the test by its new name. - STATE_EXEC_THREADED.md: B29-B31 and the file-pick and sliced-call notes name the context-based calls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A scene node can now draw see-through in the main view:
material: { opacity: <0..1> }. Until now only a viewport'soverride:entries took an opacity (§5.18), so a translucent dome or zone could be drawn see-through in a viewport but not in the main view. Documented in docs/ARIADNE.md §5.4 ("See-through nodes"), with a line in §5.18's overrides.What it does
Literal.
opacity: 0.25sets the mesh'svtkPropertyopacity. Out of 0..1 is clamped, with a warning.Opacity wins over
opaque:. Below 1 the mesh draws in the translucent pass even withopaque: truebeside it, as a viewport override's opacity does. At 1 the forced-opaque pass comes back.Bound.
opacity: <path>or{ bind: <path>, default: <0..1> }follows a state key, asvisible:does:default(1 when left out) while the key is unset or is not a number.What it reaches. Everything the node draws:
source: { data }node draws, each redraw included;A volume node ignores it: its transfer function holds its opacity.
Shadows. A see-through mesh casts no shadow into the scene's maps (the baker draws the opaque layer only).
Viewports. A viewport's twins already copy the node's property and its force-opaque flag, so views show the node's opacity unless an
override:entry sets one.Changes
SceneNode:has_opacity,opacity,opacity_bind; the loader parses all three forms.GeometryNode::setForceOpaque: the force is kept but not applied while the mesh's opacity is below 1, and is applied again when the opacity returns to 1. No caller sets both today, so nothing that draws now changes.scene_realize:apply_node_materialandapply_mesh_keysset the literal;RealizedScene::opacity(SceneOpacityBinding: the bind path, the default, the node held weakly, its data-node entry) holds the bound ones;sync_scene_opacitywrites them into the node's meshes, once at realize and then fromtick_sceneaftersync_scene_data. An unchanged value is a no-op state write. No host changes.Tests
ariadne_loader_test: newAriadneScene.MaterialOpacitycovers the literal, the clamps and their warnings, a path,{ bind, default },opaque:alongside, and a bad value's warning.cvcgl_ariadne_opacity(33 checks; its pixel part skips where nothing rasterises unlessCVC_REQUIRE_RENDER=1):opaque: true.opaque:alone still forces the opaque pass.opaque: true; a solid one reads red.Run locally on Linux (GCC 13, Release, Mesa) with
CVC_REQUIRE_RENDER=1; all pass:cvcgl_ariadne_opacity(33/33). With theGeometryNoderule taken out, 8 of its checks fail;cvcgl_ariadne_{data,physics,pick,realize,scenes,views},cvcgl_ari_switchandcvcgl_ari_golden;cvcgl_shadow_casters,cvcgl_lowmem_fastdrawandcvcgl_stage_setters, which callsetOpacity;cvcgl_lod_node,cvcgl_lod_cache,cvcgl_smoke;ariadne_loader_test(232 tests) andariadne_runtime_test(277 tests, 1 skipped as on master).-Wall -Wextrais clean on the changed lines.Not run locally: Windows, macOS and the wasm lanes (CI covers them).
Overlap
#1230 (
repeat:) and #1236 (live textures) editloader.cppandscene_realize.cpptoo. #1230'sscene_node_instanceputs the copy's index intovisible_bindandsource_data;opacity_bindneeds the same line (out.opacity_bind = with_index(...)). Whichever of the two PRs lands second adds it.