Spatial Core #1 uses a flat-color material rendering model. Every primitive is drawn with its material color passed directly to the fragment shader — there is no directional, ambient, or point light evaluation anywhere in the current render pipeline. Normals are not consulted, shadow maps are not computed, and no physically based shading math runs per fragment. This is a deliberate architectural choice: Core #1 focuses on declarative scene composition, cinematic camera motion, and smooth gestures. Real lighting is a future milestone. TheDocumentation 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.
LightData contract in spatial-core and the Light helpers in spatial-light exist so that scene authors can express lighting intent today, ensuring their code remains forward-compatible when a lighting milestone ships.
Core #1 rendering model
All primitives in Core #1 — cubes, spheres, planes — render with a solid flat color derived from theirMaterialData. The fragment shader receives the material color as a uColor uniform (vec4) and writes it to the output directly:
Real lighting evaluation — directional lights, ambient occlusion, PBR shading, and shadows — is intentionally outside Core #1 scope. These features are planned for a future milestone after the rendering, scene, camera, and Compose integration layers have been locked.
Renderer background colors
SpatialGlRenderer uses different GL clear colors depending on the renderer’s current state. These colors serve as diagnostic feedback during development — they are not part of the scene graph and are not driven by any MaterialData or LightData value:
| State | Red | Green | Blue | Description |
|---|---|---|---|---|
| Surface ready, no nodes | 0.18 | 0.02 | 0.02 | Dark red — surface is up but the scene graph has no renderable nodes |
| Program ready, nodes present | 0.02 | 0.05 | 0.18 | Dark blue — normal rendering state |
| Mesh/buffer error | 0.18 | 0.02 | 0.18 | Dark magenta — GL program or buffer setup failed |
SpatialGlRenderer (SURFACE_WITHOUT_NODES_CLEAR_COLOR, PROGRAM_READY_WITH_NODES_CLEAR_COLOR, MESH_OR_BUFFER_ERROR_CLEAR_COLOR). They are purely a renderer-level concern and do not flow through MaterialData or the scene graph.
LightData contract
Thespatial-light module exports a Light object that provides factory helpers for creating LightData values. LightData itself is defined in spatial-core as a shared data contract — a pure data class describing a light’s direction, intensity, and color so that scene, light, and renderer modules can agree on shape without the renderer being required to act on it.
Light.directional()
dirY = -1f), which is a reasonable starting point for most scenes. All parameters are optional, so a scene author can write Light.directional() to add a top-down white light with full intensity, or override individual fields:
The LightData data class
LightData is defined in spatial-core as:
(dirX, dirY, dirZ), a scalar intensity, and an RGB color (r, g, b). The contract is intentionally minimal: it is not tied to any renderer API or Android-specific type, so both the Kotlin-only scene modules and future renderers can depend on it without introducing platform coupling.
LightData is a pure data contract. The scene graph and the light module agree on its shape, but Core #1 renderers are explicitly permitted to ignore it. No LightData value is transported through the render frame in the current pipeline.
Future lighting
Once Core #1 is complete and stable, subsequent milestones will progressively introduce real lighting evaluation. The current roadmap hints at:- Directional light evaluation —
LightDatadirection and intensity passed as uniforms, dot-product shading in GLSL - Physically Based Rendering (PBR) — metalness/roughness workflows, environment maps
- Shadows — shadow maps for directional lights
LightData already exists as a stable contract, scene code authored today against Light.directional() will not need to change its call sites when a lighting milestone ships — only the renderer will start consuming the data it previously ignored.
Scene authors can model lighting intent with
Light.directional() today, so their code is forward-compatible when a lighting milestone ships. The contract shape is locked; only the renderer’s response to it will change.Material color
In Core #1 the effective surface color comes entirely fromMaterialData, defined in spatial-core:
0.8, 0.8, 0.8, 1.0). This is the color that reaches the fragment shader as uColor and becomes the final pixel color with no modification.
SpatialMaterial — the higher-level material API intended for scene authors — is a stub in Core #1. Full material customization (texture maps, roughness, emissive channels) is a future feature scoped to a later milestone. For now, the flat grey default provides a clean neutral backdrop that works well for geometry validation and camera motion testing, which are Core #1’s primary goals.