Skip to content

Ariadne: a shader: block is an implicit gl.scene.shaders - #909

Merged
transfix merged 15 commits into
masterfrom
ariadne/derive-scene-shaders
Nov 1, 2026
Merged

transfix merged 15 commits into
masterfrom
ariadne/derive-scene-shaders

Conversation

@transfix

@transfix transfix commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

#898 and #899 are merged; master is merged in, so the diff is only this change.

What

A scene node's shader: block needs a renderer that compiles the document's GLSL (gl.scene.shaders, from #899). On a host whose scene adapter does not do that (SceneAdapter::runs_shaders() returns false by default), the node drew unshaded and nothing said so.

AppRuntime::load's preflight now treats a shader: block as an implicit gl.scene.shaders (roadmap §7.6, §16.3):

  • When the host has a scene but no scene shaders, the load warns once and names the shaded nodes (the first three, then "and N more").
  • If the document lists gl.scene.shaders (or gl.shaders), that entry decides instead. Required, the load fails. Optional, the load gives the usual "optional requirement" warning.
  • A host with no scene adapter already warns that the scene is ignored, so it gets nothing more.
  • shader_canvas would carry gl.ui.shaders the same way. It isn't a widget yet.

lsystem_forest.ari is the one shipped example with shader: blocks (the terrain bump and bark presets). It lists {name: gl.scene.shaders, optional: true}, because the island still renders without them. ShippedExamplesDeclareWhatTheyNeed now checks that every example with a shader: block lists the token.

Docs: ARIADNE.md §5.7, roadmap §16.3.

Tests

  • AriadneRequires.AShaderBlockOnASceneWithoutShadersWarns covers:
    • a nested shaded node and an unshaded one on a scene without shaders;
    • the optional and required forms;
    • a shader-running scene;
    • a host with no scene.
  • AriadneComponents.ShippedExamplesDeclareWhatTheyNeed has the new shader check.
  • Run locally on Windows: MSVC 14.44, Release, cvcGL off.

Each document under examples/ariadne/ now lists what it needs from the host. Scene documents
require gl.scene, so ari (which has no scene adapter) refuses them with one error instead of
dropping the scene: block with a warning. Documents that call stream, room, nav or quit verbs
list those, and terminal_images marks raster.bitmap optional because half-block cells still
show the picture.

AriadneComponents.ShippedExamplesDeclareWhatTheyNeed loads every .ari under examples/ariadne and
checks that each declares requires:, and that any document with a scene: requires gl.scene.
docs/ARIADNE.md section 5.7 notes the convention.

Not built or run on the authoring machine (no MSVC toolchain for the existing build dir).
gl.shaders read the backend's Capabilities::glsl, so it answered for the UI only. arigl --terminal
renders the scene offscreen through GL, so a node's shader: block runs there, but the terminal
backend reports glsl = false. A document could not tell "the scene runs my GLSL" from "nothing
does".

- SceneAdapter::runs_shaders() (default false): the adapter's renderer compiles the GLSL a
  document gives its scene. cvcGL's GlSceneAdapter and TerminalScene return true.
- HostFacts::scene_shaders, set by AppRuntime from its adapter (Runtime::set_scene_shaders).
- Tokens: gl.scene.shaders (the scene runs the document's GLSL), gl.ui.shaders (the UI draws
  GLSL itself, a shader_canvas: Capabilities::glsl), and gl.shaders now means both. arigl in a
  window has all three; arigl --terminal has gl.scene.shaders only; ari has none.
- ari/arigl info: the token column is two wider, so the 16-character tokens line up.
- Tests: the tokens over three host shapes, has? on the Runtime, an AppRuntime with a shader-
  running adapter and a terminal backend loading requires: of each token, and cvcgl_terminal_scene
  checks TerminalScene answers gl.scene.shaders but not gl.ui.shaders.
- docs/ARIADNE.md 5.7 and the roadmap's 16.3 say which to require.
…nds it

arigl --terminal registers stream_view through FtxuiBackend::register_widget,
which only stored the draw fn. ImGuiBackend::register_widget also calls
register_known_widget_type, which is what has_widget_type() (and so
requires: and (has? ...)) reads. So conference_media.ari's
requires: [stream_view] failed the load under --terminal
(arigl_terminal_stream_view, every package job), though the widget draws
there. The terminal backend now marks the type known too.
… 'origin/ariadne/scene-vs-ui-shaders' into ariadne/derive-scene-shaders
A scene node's shader: block needs a scene renderer that compiles the
document's GLSL. On a host whose scene adapter does not (runs_shaders()
false, the SceneAdapter default), the node used to draw unshaded with no
word. The load preflight now warns once, naming the shaded nodes, unless the
document lists gl.scene.shaders (or gl.shaders) itself: required, that fails
the load; optional, it is the usual "optional requirement" warning. A host
with no scene adapter already warns that the scene is ignored and gets
nothing more. shader_canvas would carry gl.ui.shaders the same way; it is
not a widget yet.

lsystem_forest.ari, the one shipped example with shader: blocks (terrain
bump, bark), lists gl.scene.shaders as optional: unshaded is still the
island. ShippedExamplesDeclareWhatTheyNeed now checks that an example with a
shader: block lists the token.

Docs: ARIADNE.md 5.7, roadmap 16.3.
…quires

# Conflicts:
#	src/cvc/tests/ariadne_loader_test.cpp
…e-shaders

# Conflicts:
#	src/cvc/ariadne/app_runtime.cpp
#	src/cvc/tests/ariadne_loader_test.cpp
…e-shaders

# Conflicts:
#	docs/roadmap/CVCGL-UI-DSL-ROADMAP.md
#	src/cvc/ariadne/app_runtime.cpp
#	src/cvc/tests/ariadne_requires_test.cpp
…e-shaders

# Conflicts:
#	docs/ARIADNE.md
#	examples/ariadne/documents/lsystem_forest.ari
#	src/cvc/tests/ariadne_loader_test.cpp
@transfix
transfix merged commit 8200071 into master Nov 1, 2026
27 checks passed
@transfix
transfix deleted the ariadne/derive-scene-shaders branch November 1, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant