Repository operating guide for contributors and coding agents.
VoxelMiner is a modular 3D rendering engine centered on WebGL2 and reusable scene abstractions. The repository also includes focused examples (JavaScript/WebGL demos and a C++ Magnum procedural generation sample) that demonstrate engine capabilities and experimentation.
lib/— engine core (renderer, camera, scene graph, utilities, shaders, objects, assets)example/basic/— baseline engine integration demo with camera + lighting GUIexample/scan/— high-polygon statue scan rendering demoexample/car/— vehicle-focused example sceneexample/cloth-sim/— cloth simulation flavored prototype/exampleexample/cpp-gen/— C++ procedural house generation using Magnum/Corradeassets/— project-level static assetsREADME.md— public-facing feature overviewbib.md— attribution and source references
- Public entrypoint:
lib/index.js - Scene state:
lib/scene.js(SceneGraphholds shapes, lights, lighting factors, overlays) - Camera controls:
lib/camera.js(FPS + arcball modes, movement/panning, projection/view updates) - Rendering:
lib/renderer.js(WebGLRendererperforms multi-pass render: skybox, scene geometry, crosshair) - Shading model:
lib/shader-models/phong-shader.js(Phong lighting, 4-point-light cap, texture routing, debug visual modes) - Geometry primitives:
lib/objects/*
- Keep modules single-purpose; follow the existing
managersplit in examples (scene-manager,camera-manager,render-manager,input-manager). - Prefer extending
lib/in reusable form before adding one-off logic inexample/*. - Keep public exports wired through
lib/index.jswhen introducing reusable engine APIs. - Preserve shader uniform naming patterns and the existing point-light array contract.
- Avoid hard-coded per-example hacks inside core renderer/camera unless the change is globally useful.
- Start from
example/basic/when validating engine-level behavior. - Wire new scene behavior in the example's managers first.
- Promote stable logic into
lib/only after it proves reusable.
Build from example/cpp-gen/:
./build.sh
./build/src/MyApplicationRequires Magnum/Corrade and an appropriate CMAKE_PREFIX_PATH (defaults to /opt/homebrew in build.sh).
- Engine compiles/runs without breaking existing examples.
example/basiccamera controls and pointer lock behavior still work.- Lighting uniforms remain consistent with scene configuration fields.
- No regressions in skybox/crosshair render ordering.
- New documentation is aligned with both
README.mdandbib.mdattributions.
- Collision detection hooks exist but are currently stubbed in camera logic.
- Some README-listed features are aspirational/partial in current implementation.
- Point lights are capped by shader design (
MAX_POINT_LIGHTS = 4).
- Add lightweight docs for each example's objective and controls.
- Add regression checks for camera movement + shader uniforms.
- Normalize naming around camera sensitivity variables in inputs/examples.