Skip to content

ariadne: scene shaders and UI shaders are separate capabilities - #899

Merged
transfix merged 2 commits into
masterfrom
ariadne/scene-vs-ui-shaders
Oct 31, 2026
Merged

transfix merged 2 commits into
masterfrom
ariadne/scene-vs-ui-shaders

Conversation

@transfix

Copy link
Copy Markdown
Owner

Why

gl.shaders read the backend's Capabilities::glsl, so it only answered for the UI. 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 couldn't tell "the scene runs my GLSL" apart from "nothing does".

What

  • 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, which AppRuntime sets from its adapter (Runtime::set_scene_shaders).

  • Tokens:

    token meaning arigl window arigl --terminal ari
    gl.scene.shaders the scene runs the document's GLSL (shader: blocks) yes yes no
    gl.ui.shaders the UI draws GLSL itself (shader_canvas; Capabilities::glsl) yes no no
    gl.shaders both yes no no

    gl.shaders gives the same answers as before on every current host, so existing documents behave the same.

  • ari info / arigl info: the token column is two characters wider, so the 16-character tokens line up.

  • Docs: docs/ARIADNE.md §5.7 says which token to require; the roadmap's §16.3 is updated to match.

Tests

  • SceneShadersAndUiShadersAreSeparateTokens: the tokens over three host shapes (window, --terminal, ari).
  • HasAnswersTokensFunctionsAndWidgetTypes: has? on the Runtime; scene shaders need a scene.
  • ATerminalHostWithAGlSceneRunsSceneShadersOnly: an AppRuntime with a shader-running adapter and a terminal backend. requires: [gl.scene.shaders] loads; gl.ui.shaders and gl.shaders each fail, naming the token.
  • cvcgl_terminal_scene: the real TerminalScene answers gl.scene.shaders but not gl.ui.shaders.

Verified

Built locally on Windows (MSVC 14.44, Release, cvcGL off): ariadne_requires_test 13 passed and 2 skipped, and ariadne_loader_test 198 of 198 passed. The two skips are existing tests that need FTXUI, which that configure didn't have. The cvcGL changes (the two overrides and the cvcgl_terminal_scene check) were not compiled locally; CI is their first build.

Follow-up

Once #898 merges, lsystem_forest.ari (which uses shader: { preset: ... }) can list gl.scene.shaders.

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.
@transfix
transfix merged commit 28bb0fb into master Oct 31, 2026
45 of 46 checks passed
@transfix
transfix deleted the ariadne/scene-vs-ui-shaders branch October 31, 2026 08:48
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