Spatial is a declarative 3D rendering library for Android that brings the mental model of Jetpack Compose to 3D scene creation. Describe your scene withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/danielitoCode/Spatial/llms.txt
Use this file to discover all available pages before exploring further.
Scene, Element, and Modifier3D — Spatial takes care of OpenGL ES 3.0, the render loop, camera math, and gesture handling automatically.
Quickstart
Render your first 3D scene in under five minutes with a complete working example.
Installation
Add the Spatial modules to your Android project using Gradle.
Building Scenes
Learn how Scene, Element, Modifier3D, and CameraState work together.
API Reference
Full reference for every public composable, class, and function in the library.
Why Spatial?
Most Android 3D graphics require deep OpenGL knowledge — setting up EGL contexts, compiling shaders, managing buffers, and writing matrix math from scratch. Spatial eliminates all of that by providing a high-level declarative API that feels like writing a Compose UI.Declarative
Describe what your scene looks like. Spatial re-renders when state changes, just like Compose.
GPU-Abstracted
OpenGL ES 3.0 complexity is fully hidden. No shaders, no buffer management, no EGL setup.
Cinematic Motion
Orbit, zoom, and animated camera transitions with smooth inertia and adaptive easing built in.
A minimal scene
CoreOneScene.kt
Get started
Add Spatial to your project
Include the
spatial-compose and spatial-compose-runtime-adapter modules in your build.gradle.kts. See Installation for the full dependency list.Create a CameraState
Call
rememberCameraState(yaw, pitch, zoom) inside a composable to get an observable camera you can read and animate programmatically.Compose your Scene
Use the
Scene composable with DefaultSceneRenderHostFactory and place Element.Cube, Element.Sphere, or Element.Plane inside its content block.