Inspiration

An artist shouldn't need a cloud model to turn a light up, nor give up precise control when asking for a broader change in mood. We wanted the model to propose an editable scene patch rather than generate a new image.

What it does

Orbit four procedural studies and change light, fog, materials, and shaders. Enter “warmer light and wetter stone” for a local edit. Use the A/B wipe to compare revisions, try a cloud request that explicitly preserves roughness, then export a GLB, PNG, or standalone HTML viewer. Enter Airplane mode to keep supported edits on the device.

How we built it

A deterministic compiler handles exact scene edits before model routing. Auto hybrid can use firebase/ai with InferenceMode.PREFER_ON_DEVICE; larger or explicitly cloud requests use Gemini through reCAPTCHA Enterprise App Check. The Inspector separately reports the routing preference and returned InferenceSource. Before commit, the app validates the patch, including properties the user asked to keep. Remote Config can tune the complexity threshold. Anonymous Auth and Firestore support hosted persistence when configured; the renderer and exported viewer don't depend on those services.

Challenges we ran into

A model can produce a pleasing edit that still violates the brief. We check requested invariants before applying changes, preserve the last good GLSL shader after a compile error, and keep failed cloud-only requests from mutating the scene.

Accomplishments that we're proud of

In hosted Chrome, the first exact local edit made no model request. A separate live Firebase streaming request returned HTTP 200 and committed revision 003 with the IN_CLOUD badge. The narrated gallery demo shows the local workflow; it is not proof of a live Gemini result.

What's next

Show a field-level patch diff before commit and add shareable revision histories without making local look development depend on a network connection.

Built With

  • bun
  • cloud-firestore
  • firebase-ai-logic
  • firebase-app-check
  • firebase-authentication
  • firebase-hosting
  • firebase-remote-config
  • gemini-nano
  • glsl
  • typescript
  • webgl-2
Share this project:

Updates

Submission history