avvy-engine is the rendering library that powers Avvyland's web client. It wraps Three.js r162 with a richer material system, an entity-schema-based scene API, LOD management, and an AssemblyScript-compiled WebAssembly module for the parts that need raw performance. It ships as ESM + UMD bundles consumed by avvy-app (and can be used standalone).
Repo: gitlab.avvyland.com/avvy/avvy-engine. README is in Russian — the canonical examples translated below.
Base. Three.js r162.
WASM. AssemblyScript v0.27 → WebAssembly modules.
Build. Rollup 4 with multiple targets — rollup.build.config.js (main bundle), .engine, .menu, .multiworld, .portal, .simple for specialized builds.
Post-processing. postprocessing v6.35.
Language. TypeScript.
Top-level.
Engine — root object (init(dom), worlds, start()).World — scene unit; created via engine.worlds.create().Entity-schema flow. Add / update / remove via schema objects rather than imperative scene-graph mutation:
const materialSchema = {
material: { effect: { effectName: "default", effectProps: {} } },
lod: 0,
};
const material = world.createMaterial(materialSchema).base;
const geometry = new BoxGeometry();
const schema = world.createSchema(); // skeleton block schema
schema.assets.geometry.push(geometry);
schema.assets.material.push(material);
world.addEntity(schema); // add
world.updateEntity(schema); // mutate
world.removeEntity(schema); // remove
Block schemas carry id, type (block), blockType, children[], parentID, isStatic, matrix (Matrix4), objects[], assets.{geometry, material}, and flag bits (matrixUpdated, viewUpdated, hierarchyUpdated, staticUpdated).
PBRMaterial — physically-based base.HologramMaterial — sci-fi shader.PortalMaterial — portal / teleport visual.WindMaterial — wind-affected surfaces.Implemented under src/materials/. A WebGLRenderer wrapper handles renderer setup.
src/ui/ exposes the in-engine UI surfaces consumed by avvy-app: UIManager, MainPanel, EnvironmentEditor, StatsOverlay.
src/
├── core/ Engine, World, scene graph
├── materials/ PBR, Hologram, Portal, Wind, CustomBlockMaterial
├── nodes/ Three.js node system extensions
├── objects/ Engine-specific objects
├── loaders/ Asset loaders
├── ui/ In-engine UI
├── passes/ Post-processing passes
├── schemas.js Entity-schema definitions
├── services/ Internal services
├── compute/ WASM-backed compute
├── environment/ Environment maps / sky / lighting
├── lib/ Utilities
├── dpms/ Display power-management hooks
├── settings.js Engine settings
├── constants.js Shared constants
└── index.js Public entry
The old/ directory contains legacy modules retained for migration.
npm run asbuild:release # compile AssemblyScript → WASM
rollup -c rollup.build.config.js # main bundle
npm run dev # watch / dev bundle
Specialized bundles use the named rollup configs. Output ships to avvy-app's static assets as avvy-engine.dev.js (plus the WASM module).
Consumer. avvy-app bundles avvy-engine's avvy-engine.dev.js for rendering. This is the only verified internal consumer.
gitlab.avvyland.com/avvy/avvy-engine — README.md, src/, rollup.*.config.js. avvy-engine is not deployed standalone; it is consumed as a bundled dependency by avvy-app.