Architecture
Your application controls SpatialEngine. The engine owns the scene, rendering, and project state. SpatialDrive stores shared project history and spatial data.
Native application
Your application calls the native engine’s statement API over gRPC. You can use any language with a gRPC client, including Rust, Go, C++, C#, Java, and Python. The Python SDK provides generated methods and types for these calls.
The engine runs as a separate process and renders with native graphics APIs. It streams or copies rendered frames into your application’s UI. The streaming viewport works in any UI toolkit that can display a WebView.
Custom integrations for specific UI frameworks, including Electron, are available on a case-by-case basis for native performance. Contact Foresight to discuss your framework and rendering requirements.
Studio manages both processes during development. In a custom integration, your application manages the engine’s startup, connection address, and shutdown.
You can also open the running engine’s web portal in a browser to view its scene and manage its settings. Viewports covers portal access and embedding. API reference covers gRPC reflection and client generation.
Browser application
Your page loads the npm package’s WebAssembly engine. TypeScript calls its statement API. The engine renders into canvases in the page.
Your UI framework manages controls and page layout. The viewport element handles the engine view and pointer input.
Shared projects
The engine connects to SpatialDrive for remote projects and streamed data. SpatialDrive uses PostgreSQL for project history and blob storage for large datasets. It validates identity through the deployment’s OIDC provider.
A cloud server does not replace the engine running in the application. The engine remains responsible for the application’s scene and viewport.
Server architecture covers deployment. Client integration covers the application connection.
Sandboxed Extensions
The engine loads and executes an extension as a sandboxed WebAssembly component. The component has isolated memory and accesses host capabilities through interfaces the engine provides. It calls engine statements from inside that sandbox. An external application sends its calls to the running engine over gRPC or through the browser SDK.
Extensions can implement workflows that read scene data, edit projects, and control viewports. The host controls the component’s access to capabilities such as files, environment variables, and networking.