Rendering and 3-D¶
This pillar covers how Caliper turns tensors and 3-D data into pixels: the Metal and Vulkan renderers, the graphics layer and scene core, and the scene features planned on them.
The roadmap graph shows how these features depend on features in other pillars. Ideas for this pillar that are not in the registry are on its candidates page.
Shipped¶
- REN-01 Metal Renderer. The Metal renderer is the default on macOS and reads PyTorch's MPS buffers in place with a compute pass or a blit, so a tensor reaches a texture without a CPU copy.
- REN-02 Vulkan Renderer with CUDA. The Vulkan renderer with CUDA interop is the default on Windows and writes the Vulkan image directly from a CUDA kernel, with timeline semaphores for synchronization.
- REN-03 OpenGL Fallback. The OpenGL fallback draws where neither Metal nor Vulkan is available and stages tensors through the CPU, so it is the slow path and says so.
- REN-08 Zero-Copy from Torch. A PyTorch tensor on MPS or CUDA reaches the screen without a host copy: the renderer reads or imports its device memory, and a ladder of synchronization modes orders the work.
- REN-09 Graphics Layer. The graphics layer, an internal C++ layer shaped like WebGPU, holds buffers, textures, pipelines, draw lists and a uniform arena, validates every frame, and has a Metal backend.
- REN-10 WGSL Shaders Through Naga. Scene shaders are written once in WGSL, and a generator with a pinned Naga translates them into the programs that each backend of the graphics layer loads.
- REN-11 Scene Core. The scene core is the one camera and scene model of the views: an entity tree with cameras, bounds and fitting, which it compiles into a draw list of the graphics layer, with a pick pass.
- REN-12 Scene View. The scene view is a live view of kind scene that draws the points, lines and meshes of a protocol 3.2 scene through the scene core, in the app and in the browser, with an orbit camera.
- REN-13 WebGPU Backend of the Graphics Layer. The WebGPU backend of the graphics layer runs in the browser, so the WebAssembly views draw scenes through the same layer as the native renderers.
- REN-14 Colormap by Keys. A colormap is decided by integer comparisons against keys derived once from the CPU reference, so every shader and adapter gives the same colours as the reference.
- REN-15 Picking. Picking finds the entity, item and row under the pointer through a pick pass of the scene core on the graphics layer, natively and in a browser.
- REN-31 Renderer Baseline and Counters. Copy counters, frame-time statistics on Metal and benchmark rows record a baseline before the renderer core's migration, so that every later step is measured against it.
- REN-32 Points View on the Scene Core. The points live view draws as a scene of one entity through the scene core, with its pixels checked against references from the old path, which is deleted.
- REN-45 Starting Camera of a Scene. A script sets the camera a scene view opens on with view_camera, by a target, a distance and angles or by a camera entity.
- REN-64 Tensor Bridge Service. caliper.tensor_bridge.v1 to v1_2 turn a CaliperTensor into a live texture in the same frame, with a handoff ordered on the stream and imported device allocations.
- REN-66 Torch Adapter. torch.hpp turns a torch tensor into a CaliperTensor, refuses a tensor it cannot share rather than copying it, and applies the rules of MPS and CUDA.
- REN-67 Exportable Pool. ExportablePool allocates the tensors that the renderer draws in place, and an allocation registry tracks the allocations the host can import.
- REN-68 OBJ Loader and Orbit Camera. Two adapters give an applet an OBJ mesh loader and an orbit camera with picking under the cursor.
- REN-69 WebGPU Renderer for Browser Views. The WebGPU renderer draws the browser views of the WebAssembly module, with a colormap pass whose thresholds come from the CPU reference and instanced quads for points.
- REN-76 Program Sandbox. The sandbox checks each program in the editor, the script and the viewer, keeps model tensors read-only, translates the WGSL with a bounds check on every access, and stops a program at its time limit and memory budget.
- REN-77 Programmable Graphics. An agent writes the graphics of an instrument as pieces with its own buffers, textures, state between frames and WGSL passes, which read live tensors without a copy, draw into a scene panel with the camera given, keep picking and run inside the sandbox.
- REN-78 Derive Half of a Piece. The derive half runs compute passes in the training script at the shared cadence, over live tensors that it reads without a copy, and publishes named typed resources that keep their contents from one run to the next.
- REN-79 Draw Half of a Piece. The draw half runs in the viewer every frame as a render graph over the published resources, with its own targets, blending and depth, and the host removes a draw that goes over its time or memory budget.
- REN-80 Piece Library. The library supplies reusable scene pieces and the camera, colormap, easing and pick shader modules under the same manifest and version rules as workspace pieces.
- REN-81 Picking of Program Items. A pick pass of a draw half returns the item of a program under the pointer with its fields, a selection command can set the same item, and the host places the text labels that a program publishes.
- REN-82 Browser Draw Runtime. The browser module runs the draw half on WebGPU from the same WGSL and declaration, with the same hash checks and refusals, and a test compares its pictures with the pictures of the app.
- REN-83 Attention Arc Tower Demo. A small transformer trains while an agent writes the pieces that draw the attention arcs of its tokens on rings, the induction score of each head and the attention grid, and an ablation and a fork test whether the induction heads cause the loss to fall.
Built¶
- REN-04 geometry.v1. Removed in ABI epoch 3. caliper.geometry.v1 drew instanced points from imported device memory into an offscreen view texture.
- REN-05 geometry.v1_1. Removed in ABI epoch 3. caliper.geometry.v1_1 added general primitives, depth views and one atomic gated frame.
- REN-06 geometry.v1_2. Removed in ABI epoch 3. caliper.geometry.v1_2 added textures on meshes.
- REN-07 geometry.v1_3. Removed in ABI epoch 3. caliper.geometry.v1_3 added instanced transforms.
- REN-17 End of OpenGL. The GLEW OpenGL fallback is removed, and where neither Metal nor Vulkan starts, the app says so and exits instead of drawing through the CPU. Sprint 4.
- REN-37 Arrows and Boxes in Scenes. Scenes draw arrows and boxes, with rotations, colours or values through a colormap, class ids, labels, optional fill and a corner form in 2-D. Sprint 4.
- REN-38 Images in Scenes. A scene shows colour, depth and segmentation images on a camera's image plane and draws a depth image as a point cloud projected back through the camera; encoded images are not drawn yet. Sprint 4.
- REN-39 Pinhole Cameras in Scenes. A scene holds pinhole cameras drawn as frustums, with 2-D items in each camera's pixel space, and a person can look through a camera. Sprint 4.
- REN-40 Entity Transforms. Each entity of a scene carries a transform, as translation, rotation and scale or as a matrix, that composes down its path in 2-D and 3-D scenes. Sprint 4.
- REN-41 Class Table and Labels. A scene's class table gives each class id a label and a colour for points, boxes and segmentation, and items may carry labels of their own. Sprint 4.
- REN-42 Index-Pair Edges. Lines can be given as pairs of indices into a positions array, so that graph edges, bonds and skeletons reuse their points instead of repeating them. Sprint 4.
- REN-43 Up-Axis Switch. Every 3-D view has a switch between Y up and Z up that changes only the camera's basis, never the data, and is remembered with the view. Sprint 4.
- REN-44 Scale Bar. A scene view shows a scale bar in the scene's units, measured at the orbit target in 3-D and exact in 2-D. Sprint 4.
- REN-65 Export Service. Removed in ABI epoch 3. caliper.export.v1 drew a geometry draw list offscreen into a PNG with a JSON provenance sidecar.
- REN-70 FieldScope. Deleted demo applet (removed in epoch 3). Simulated charged particles in electromagnetic fields on a GPU.
- REN-71 FlowScope. Deleted demo applet (removed in epoch 3). Drove a flow field of one million particles on a GPU.
- REN-72 InstanceScope. Deleted demo applet (removed in epoch 3). Drew a field of procedural gems with one instanced draw call.
- REN-73 MeshScope. Deleted demo applet (removed in epoch 3). Trained a small network on a 2-D surface drawn as lit triangles with a wireframe.
- REN-74 SculptScope. Deleted demo applet (removed in epoch 3). Trained a small network mapping latent codes to a 3-D point cloud.
- REN-75 TwinScope. Deleted demo applet (removed in epoch 3). Ran a synthetic heat twin of a textured housing.
- REN-84 Lines Arrows and Paths as Library Pieces. The lines@1, arrows@1 and path@1 pieces draw line segments, arrows and paths with color, width, depth and item picks.
- REN-85 Boxes and Meshes as Library Pieces. The boxes@1 and mesh@1 pieces draw boxes and triangle meshes with class colors, labels, lighting, textures and item picks.
- REN-86 Images Depth Maps and Segmentation Masks as Library Pieces. The image@1, depth@1 and segmentation@1 pieces draw images, depth clouds and class masks with camera poses, native element types and item picks.
- REN-87 Surface as a Library Piece. The surface@1 piece derives a height field from a tensor and draws it with the data bounds, value range and item picks.
- REN-88 Removal of Per-Shape Draw Code. Library pieces replace the built-in scene shaders, draw code and stage hooks. One read-only converter preserves old scene recordings, and Canvas 2D panels stay.
- REN-89 Camera Frustum Piece. The frustum@1 library piece draws a camera entity with the pose and intrinsics of its pinhole camera.
- REN-90 Typed Piece Resources. Pieces read u8 and u16 tensors and buffers, and publish typed textures with a size for each version, without float conversion.
- REN-91 Indexed Piece Draws. A draw pass takes an index buffer, and optional inputs let one piece accept only the resources that a scene part needs.
In Progress¶
- REN-46 Scene Selection and Events. Hover, click, rectangle and lasso work in a scene, natively and in a browser, picks and selections reach the script through caliper.serve() and the widget's selection, and a selection links to the other views. Sprint 4.
Planned¶
- REN-16 Applets on the Scene Service. EmbedScope and GPTScope draw through the scene service, so that every 3-D applet of the repository draws through one scene model. Sprint 4.
- REN-18 Mesh Files. Mesh files in glTF, OBJ and STL format load through the loaders into mesh sources of a scene, instead of each script reading them by hand. Sprint 5.
- REN-19 URDF. One call in Caliper LIB turns a URDF robot description into scene entities, with a link per entity and its meshes and joint transforms. Sprint 5.
- REN-20 Trails. A trail view shows the last N steps of an entity's positions, such as a path or a gripper, in place of only the latest. Sprint 5.
- REN-21 More Shapes. Capsules, cylinders, planes and ellipsoids join the scene's boxes, each drawn from its parameters. Sprint 5.
- REN-22 More Colormaps. About twelve scientific colormaps from matplotlib and Crameri's tables join the built-in ones, checked by the exact colour tests. Sprint 5.
- REN-23 Saved Viewpoints. Saved viewpoints keep a view's camera in views, recordings and spec applets, so that a person returns to the same angle. Sprint 5.
- REN-24 Scale Pass. A scale pass measures and tunes scenes with millions of points, long recordings and many entities in Chromium, WebKit and Firefox, against the budgets and level of detail. Sprint 5.
- REN-25 Dawn Fallback. The WebGPU backend also serves as the native fallback through Dawn, chosen only when Metal or Vulkan is unavailable, and draws through Direct3D, OpenGL ES or SwiftShader.
- REN-26 Slice Planes. A slice plane cuts a 3-D field along an axis and is dragged within the scene; the slice is computed on the device and drawn on a textured quad. Sprint 6.
- REN-27 Isosurfaces. An isosurface is the surface where a field equals a chosen value; a marching-cubes kernel on the device sends it as a mesh that the scene draws. Sprint 6.
- REN-33 Texture Path on the Graphics Layer. Heatmaps, images, the tensor bridge's textures and the embed views update their textures through the graphics layer with the colormap decided by keys, and the Vulkan renderer is reduced to the window, the canvas and ImGui. Sprint 4.
- REN-34 Scene Model Additions. The scene model gains additive points and lines, meshes drawn many times from instance poses, and a depth offset that lets edges win over the surface they lie on, natively and in a browser. Sprint 4.
- REN-35 Scene Service for Applets. The scene service offers the scene model to applets through the ABI, with the shared camera, the up-axis switch, the scale bar and picks returned as events. Sprint 4.
- REN-36 Final Renderer Seam. HostRenderer is reduced to the window, the frame loop, the canvas, window capture and the graphics layer, once every applet draws through the scene service. Sprint 4.
- REN-47 Following an Entity. The camera of a scene view follows a chosen entity, such as a gripper, as it moves, while the person orbits around it. Sprint 5.
- REN-48 Keypoint Skeletons. The class table of a scene holds keypoints and their connections, so that skeletons draw with names and colours. Sprint 5.
- REN-49 Line Widths in World Units. Lines in a scene take a width in world units as well as in pixels. Sprint 5.
- REN-50 Orthographic Projection and Preset Views. A 3-D view switches between perspective and orthographic projection and takes top, front, side and three-quarter presets, for measuring shapes without perspective. Sprint 5.
- REN-51 Text Log View. A text log view lists logged lines with their levels, drawn natively and, in a browser, in the page itself. Sprint 5.
- REN-52 Bar Chart View. A bar chart view draws a labelled array of bars, natively and, in a browser, in Canvas 2D. Sprint 5.
- REN-53 Vulkan Backend of the Graphics Layer. The graphics layer gains a Vulkan backend with the CUDA path, so that bridge textures and scenes, which Windows refuses until then, draw on Windows through the same layer as on macOS.
- REN-54 Structure from Motion Demo. A demo reconstructs a scene from the frames of a short film and shows the cameras, their images and the point cloud, with the shot chosen to suit it. Sprint 5.
- REN-55 Robot Arm Demo. A demo loads a robot arm from its URDF and shows it following a target, with the gripper followed and trailed. Sprint 5.
- REN-56 Detection Boxes Demo. A demo shows a detection model's boxes, classes and scores over the images they were found in. Sprint 5.
- REN-57 Flow Field Demo. A demo shows where a neural surrogate's error concentrates inside a 3-D flow, with slice planes and isosurfaces. Sprint 6.
Ideas¶
- REN-28 Volumes. Volume rendering would ray-march 3-D fields, and it is left out so far because it needs a transfer function and sampling choices on every backend.
- REN-29 MSAA. Multisample anti-aliasing would smooth the edges of the scene view's drawing, and it is not yet decided.
- REN-30 Thick Lines and Ribbons. Thick lines and ribbons would draw with a width in pixels, which WebGPU does not offer natively, and they are not yet decided.
- REN-58 Culling Flag. Geometry draws could take a flag that turns face culling on or off.
- REN-59 Exportable Vulkan Image Pool. The Vulkan renderer could keep a pool of exportable images for zero-copy sharing.
- REN-60 Device-Backed Shared Allocation on Metal. The alloc_shared call could be backed by device memory on Metal.
- REN-61 Camera Paths and Fly Mode. A scene view could play its camera along a recorded path and offer a fly mode for moving through a scene.
- REN-62 Gizmos and Scene Editing. Gizmos could let a person move and edit the entities of a scene in its view.
- REN-63 Lights and Materials. Scenes could carry lights and materials beyond the fixed shading they have today.