Skip to content

0.2.0 — 3D in the chat

Choose a tag to compare

@ComicBit ComicBit released this 20 Oct 15:20
· 18 commits to main since this release

Real 3D, in the chat

Agents can now answer with interactive 3D, drawn natively in the reply. The design follows the 3D visuals in Zeron (its ui.scene and ui.shader).

glTF model lit by an HDR Glass prism with dispersion
Animated solar system Raymarched shader
  • Scene (three.js): boxes, spheres, cylinders, surfaces (f: (x, z) => y), meshes, lines, paths, points with hover hints, labels, grids, axes, glTF models, HDR environments and glowing sprites. Materials take roughness, metal, glow with bloom, and glass with refraction and dispersion. A key light casts soft shadows. Drag to orbit, pinch or ctrl/⌘ + scroll to zoom, double-click to reset the camera. Pass t => [...] to animate: it runs every frame, and sliders change it live.
  • Shader: Shadertoy-style GLSL passes, including feedback buffers, iMouse, an iCamera you can orbit, inputs bound to sliders and toggles, textures and iNoise. Blend modes are light, alpha and opaque, with optional bloom.
  • Both use BB's theme colours in light and dark. A thread holds at most six WebGL contexts at once; the other 3D blocks show their last frame at the same size. On touch, vertical swipes still scroll the thread.
  • New math functions in the language: sin cos tan asin acos atan atan2 sqrt floor ceil clamp lerp range random, plus PI and TAU.
  • 8 new gallery examples: rainfall bars, a solar system, an island terrain, a prism splitting light, a glTF pawn in gold and ivory, raymarched metaballs, light trails and wave interference.

Mistakes caught before you see them

  • check_ui now tries a block's inputs the way a reader would: each slider and stepper at both ends, toggles flipped, every option picked, lists emptied and filled, text cleared, Set buttons pressed. An error one of them causes comes back as After setting $n to 0: fmt() needs a number, so a block that only breaks on the first drag gets fixed before you see it. Scenes are checked at t = 0 and t = 1.5, and every shader pass is parsed, with errors given by pass and line.
  • Style arguments (color:, background:, size:) explain why they're refused: components draw in BB's theme, so use tone: where a component has one.

Smoother streaming

  • Text, callouts, table cells and step details now grow as the reply streams, instead of each appearing whole when its closing quote arrives. An open ** or code span is styled from its first word. Paths, place names, icons and labels you could tap wait for their closing quote.
  • Content that appears while a block streams only fades in, at the stream's own pace (120–400 ms), and never shifts the conversation.

BB integration

  • Blocks render through BB's native code fence renderer slot (get-bb/bb#5387) where BB offers it (BB 0.46.1 does); older BB keeps the DOM overlay.
  • Built against @get-bb/plugin-sdk 0.6.54.

Updating

bb plugin update genui

Agent sessions started after the update get the new components. The plugin's page code grows from 0.9 MB to 1.6 MB because of three.js. The GLSL checker runs on the server only, so it adds nothing to the page.

Full changes: v0.1.0...v0.2.0