Skip to content

Repository files navigation

OVGrid — Open Virtual Grid

Ask DeepWiki

OVGrid — Open Virtual Grid

An open, serverless virtual world — and a real-world showcase of GenosDB.

OVGrid is a planetary 3-D world you explore as an avatar: a cube-sphere planet divided into a parcel grid, with procedural terrain, weather, vegetation, real-time multiplayer presence, and land/assets you can own and trade on-chain.

It is built to demonstrate what GenosDB can do in a demanding, real product: a single distributed database drives the entire live state of a 3-D world — peer-to-peer, real-time, offline-capable, reactive and secure — with no backend server.

▶ Play it live — world.ovgrid.com · runs entirely in the browser, no install and no account. Needs a WebGPU browser with the experimental HTML-in-Canvas flag (see Requirements).


Why this exists — GenosDB in a real product

Most database demos are to-do lists. OVGrid puts GenosDB under real load and shows the patterns that make it powerful:

GenosDB capability How OVGrid uses it
P2P real-time (GenosRTC) Live multiplayer presence — other players appear as animated avatars at the right position/altitude/animation, synced ~12 Hz over WebRTC. No game server.
Reactive reads (db.map) The 3-D world's land map and the marketplace subscribe to the same DB with db.map(query, cb); the UI updates live as data changes.
One DB, many consumers A single ovgrid-world instance serves world state, land, assets, listings, offers and presence. The 3-D client and the marketplace read it the same way.
On-chain mirror (cache over a blockchain) Polygon is the source of truth for ownership; a sync layer mirrors it into GenosDB so the world reads fast, offline and in real time instead of hitting the chain.
Decentralized identity + RBAC (Security Manager) Sign in with WebAuthn biometrics or a BIP39 mnemonic; operations are signed and access-controlled by GenosDB's Security Manager.
Serverless by design WebRTC transport + Nostr signaling — there is no central backend to run.

The point GenosDB makes here: the read layer never changes — whether a parcel was claimed locally or minted on-chain, the world reads it the same reactive way. GenosDB is the abstraction.

Full map: docs/GENOSDB.md — how OVGrid uses GenosDB across presence, world state and the on-chain mirror, with pointers to the code.

Features

  • Planetary WebGPU renderer — precomputed atmospheric scattering, adaptive LOD terrain (cube-to-sphere on the GPU), deep-sea ocean, volumetric clouds.
  • Autonomous weather & day/night — seasonal, localized weather and sky that evolve on their own, with a Stardew-style calendar.
  • 100% procedural world — terrain, vegetation, palms, rocks and clouds are generated on the GPU. No third-party 3-D models are shipped.
  • Avatars & NPCs — rigged voxel avatars with Mixamo-baked animations (walk/run/idle/jump/fly/swim); NPCs populate each parcel you visit.
  • Real-time multiplayer — remote players as animated avatars over P2P.
  • Land & marketplace — claim parcels, mint ERC-1155 assets, trade — mirrored into GenosDB for instant, reactive reads.
  • In-world HTML UI — panels, nameplates and tooltips rasterized into the WebGPU canvas (see Requirements).
  • Floating-origin precision — Float64 CPU math for rock-solid geometry at planetary scale.

Requirements

  • A WebGPU-capable browser (Chrome/Edge 113+, Safari 18+).
  • The experimental HTML-in-Canvas feature, used for the in-world UI (nameplates, panels, tooltips). Enable chrome://flags/#enable-experimental-web-platform-features.

A boot gate detects both and shows instructions if either is missing.

Quick start

Play online — no install

Open world.ovgrid.com in a WebGPU browser with the experimental HTML-in-Canvas flag enabled (see Requirements). The boot gate checks both and shows setup instructions if either is missing. Exploring and P2P presence need no account and no keys. First-time visitors land on a curated island.

Shareable positions. As you move, the address bar keeps a ?p= deep-link to your exact spot and camera (position, facing, zoom and parcel). Copy the URL to send someone straight to that view — e.g. world.ovgrid.com/?p=4.66,-5.19,-1.44,-0.94,0.11,0.5,0,70,54.

Run locally

pnpm install          # install dependencies

pnpm dev              # dev server (live-server) at http://localhost:3000
# or
bun run build && bun run preview   # production bundle, served at http://localhost:3000

Exploring, P2P presence and reading the world need no keys. Minting land/assets needs a Pinata (IPFS) key and a wallet — see .env.example.

Controls

Keys Action
W A S D Move · Q/C up·down (fly) · Shift boost
🖱️ Orbit camera · scroll to zoom
H Toggle help/HUD · G Debug panel
X Sit · E enter/exit flight
Click the calendar widget Open the in-world calendar

Architecture

OVGrid follows one rule, end to end:

CPU = decides WHAT EXISTS (logic, state, precise Float64 coordinates, GenosDB)
GPU = decides HOW IT LOOKS (rendering, shading, effects)

Data layer. A single GenosDB instance (ovgrid-world, created with { rtc: true, sm }) holds the live state of the world. The 3-D client and the marketplace both read it reactively via db.map; presence flows P2P over GenosRTC; ownership is mirrored from Polygon.

Precision (Floating Origin). The shader assumes the camera at the origin; all world positions are computed in Float64 on the CPU and passed to the GPU as small camera-relative Float32 offsets — stable up to LOD 22 at planetary scale. This is the technique that makes a full-size planet renderable without jitter — the full post-mortem is in docs/floating-origin-guide.md.

Terrain. A dynamic quadtree on the CPU drives per-quad LOD on a cube-sphere; a hybrid two-stage culling system (horizon culling on the CPU quadtree, then fine-grained instance culling in a GPU compute shader) keeps only what the camera can actually see. See docs/terrain-mesh.md and docs/culling-system.md.

Atmosphere & sky. Precomputed scattering (Bruneton): transmittance, scattering and irradiance LUTs. A triple-layer cloud system bakes its fractal noise once into a texture instead of per-pixel per-frame, and weather (rain, snow, storm) rides a world-anchored particle treadmill. See docs/clouds-performance.md and docs/rain-system.md.

Planetary rendering research. The five docs linked above — floating origin, procedural terrain, culling, clouds and weather — are the technical core of how OVGrid renders a real-scale planet in the browser. They're grouped again under Documentation → Planetary rendering below.

Documentation

AI-generated wiki — ask questions about the codebase in natural language

  • deepwiki.com/estebanrfp/ovgrid — DeepWiki auto-indexes this repo into a conversational wiki (architecture diagrams, file walkthroughs, "Ask" chat). Great as an entry point; the hand-written docs below are the authoritative reference.

GenosDB & data layer — the reason this project exists

Planetary rendering — the WebGPU research behind a real-scale world

Systems & gameplay

Configuration reference — tune the world (every parameter in lib/config/)

Legal

License

MIT License — see LICENSE.md.

Author

Esteban Fuster Pozzi (@estebanrfp) — Full Stack JavaScript Developer

About

Open Virtual Grid / P2P Virtual World

Resources

Security policy

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages