Babylonpress Lite Viewer

The viewer creates a WebGPU Babylon Lite scene, loads one glTF/GLB model at a time, frames it with Babylon Lite’s default camera helper, and exposes a small TypeScript API for embedding the viewer in an application.

It uses a class-based API similar to traditional Babylon Viewer integrations, while keeping the implementation focused on Babylon Lite and a single canvas.

Loading a new model disposes the previous scene before creating the next one. Loaded models are framed automatically. No environment settings to keep everything minimal as possible. One default light with controlled intensity.

It supports remote model URLs, local Blob and ArrayBuffer sources, clear-color control, optional transparent canvas compositing, animation group playback controls, screenshot capture, and lifecycle callbacks. The feature set is intentionally minimal, but it can suit a broad range of 3D applications.

The syntax is familiar and reminds the Babylon.js Viewer:

const details = await createLiteViewerForCanvas(canvas, {
  source: "https://playground.babylonjs.com/scenes/BoomBox.glb",
});

The returned details object contains the viewer instance plus the underlying Babylon Lite engine, scene, and camera.

API docs - LiteViewer | BabylonPress Lite Viewer - v0.1.0

This is the opinionated class-based approach. Pure functional Lite Viewer would have even less exposed functions in its most minimal, “bare” realization.

3 Likes

You are on fire with Lite!

1 Like

The best way to explore an API is to create something useful :slight_smile:

3 Likes

True, feel free to create a lot more :wink: ahah

1 Like

Listed as the first dep :slight_smile:

https://www.npmjs.com/package/@babylonjs/lite?activeTab=dependents

1 Like

First dependency! :smiley: