Commit Graph
83 Commits
Author SHA1 Message Date
西风逍遥游 2628790bdb feat(procgen): add blue-noise leaf clusters to mesh.tree
The stylized tree's foliage was a stack of ellipsoid lobes (canopy) or loose
per-tip cards (cards): the first reads as a bunch of grapes, the second clumps
and leaves holes because every card is drawn independently.

Add a cluster foliage mode built the way stylized foliage is normally authored:

  * leaf centres on a plane are blue noise (Poisson disk), so the distribution
    has no clumps and no bare patches;
  * only the leaves emit geometry, which is how a CPU mesh expresses
    'leaves opaque, everything else transparent' without alpha sorting or
    transparent overdraw;
  * 8-10 such planes are placed around the cluster's Y axis with a small random
    tilt and offset, plus a few near-horizontal planes that close the poles;
  * vertex normals are transferred from the cluster sphere instead of the leaf's
    own plane, so a bundle of flat cards still shades as a rounded mass;
  * both windings are emitted, because the engine's mesh3d pipelines cull back
    faces unless a Material opts into two-sided rasterization.

Cluster centres are picked from the existing foliage anchors in a shuffled order
under a Poisson separation test, so they cover the crown evenly, stay inside a
hard geometry budget, and the twigs visibly enter the foliage.

FoliageCluster is a standalone implementation unit with its own
FoliageClusterDesc so other recipes can reuse it, and its disk sampling goes
through the module's existing Bridson sampler (poissonDiskPoints) instead of a
second blue-noise implementation.

Also fix the mesh.tree schema, which advertised clusters and colonization as
leafMode/branchAlgorithm choices while the generator rejected both, and was
missing canopy.

Tests live in their own translation unit (the shared procgen.cpp is already
~4500 lines): property tests for the sampler, the sphere normal transfer and
two-sided emission, a case asserting every cluster knob is exposed in the
schema and actually changes the mesh, and an opt-in step-by-step render dump
(EVENGINE_TREE_STEPS_DIR) that draws each construction stage.

Verified with ctest -R 'mesh\.|poisson' (136/136).
2026-09-11 15:17:29 +08:00
西风逍遥游 87a1ec52c4 Add a level design tool example with terrain references and play mode
Introduce examples/level-designer: a 3D level design tool assembled from the
existing composable editor, procgen, physics and animation components.

- Terrain is referenced rather than embedded. Levels either regenerate it from
  sampler parameters, or point at a terrain asset on disk. Both encodings the
  runtime persists are decodable: the chunked EVTR archive and the raw EVTRN
  float32 heightfield written next to an eve.terrain/1 asset.
- Whitebox pieces come from the ProcgenKit recipe registry (75 prototype
  pieces). A level stores only the recipe id plus parameter values, so the mesh,
  renderable and play-mode collider are all derived and no geometry is
  duplicated into the level file. Piece parameters are driven by the recipe's
  own schema.
- Player spawn points are ordinary scene nodes carrying facing plus the
  character and motion set play mode should start with.
- Play mode builds a runtime world from the same authored data (terrain height
  field plus one static box per piece) and drives the player with the Motion
  Matching controller, using capsule collision for movement and a third-person
  follow camera. Authored data is never mutated by a play session.

Editor view control is an orbit camera around a pannable focus point: right
drag orbits, middle drag pans along the view's ground basis, Q/E zoom, and F
focuses the selection or frames the whole terrain. Play-mode view is the
third-person follow camera; camera yaw is also the locomotion basis, so mouse
look steers where WASD runs.

Add procgen terrain file decoding:

- TerrainFile.h/.cpp decode EVTR and EVTRN into a Heightmap plus spacing, height
  range and format metadata. Failures return structured diagnostics
  (not_found, parse_error, unsupported) and never a partially filled grid.
- procgen.loadTerrainFile(path, format) and procgen.loadTerrainBytes(bytes,
  format) expose it to script through the existing owning-handle proxy path.
  EVTR stores no metres-per-cell, so hasSpacing reports whether the decoded
  spacing is authoritative.

Verification: examples/level-designer/smoke.nut drives the live engine over MCP
(56 checks: terrain sampling and snapping, whitebox placement and parameter
rebuild, spawn resolution, panel construction in every tool state, play-mode
assembly and landing on the height field, camera-relative locomotion, character
and motion set switching, level document round trip and rejection, asset
terrain loading and rebuild atomicity). The new decoder has a unit test with 58
assertions covering both encodings, magic mismatches, truncated payloads and
dimension/size disagreement.
2026-09-10 23:22:28 +08:00
西风逍遥游 cd76980bb8 refactor(procgen): propagate structured execution and cleanup results 2026-09-09 19:45:13 +08:00
西风逍遥游 63f265f3f2 refactor(procgen): isolate worker jobs and cache immutable execution plans 2026-09-09 17:27:42 +08:00
西风逍遥游 a2df127e73 procgen: budget runtime source refresh 2026-08-31 15:00:22 +08:00
西风逍遥游 74fc4467a0 procgen: coordinate scene and runtime cleanup 2026-08-31 14:13:50 +08:00
西风逍遥游 28848cef87 procgen: complete cleanup tickets atomically 2026-08-31 13:56:18 +08:00
西风逍遥游 5f2de32062 procgen: unload scene cells atomically 2026-08-31 13:40:01 +08:00
西风逍遥游 50875afccf procgen: publish runtime cells atomically 2026-08-31 13:26:06 +08:00
西风逍遥游 700c259c5f procgen: cancel obsolete runtime work cooperatively 2026-08-31 13:04:16 +08:00
西风逍遥游 e26881c268 procgen: synchronize runtime cells to scene 2026-08-31 12:53:38 +08:00
西风逍遥游 e7ba82f9bc procgen: recover scene cells from snapshots 2026-08-31 12:40:21 +08:00
西风逍遥游 5b09e7814e procgen: publish point deltas to scene 2026-08-31 12:24:36 +08:00
西风逍遥游 41a4935ae4 procgen: add stable point deltas 2026-08-31 11:50:30 +08:00
西风逍遥游 e34ff950bf docs(procgen): index script foundation bindings 2026-08-31 08:55:41 +08:00
西风逍遥游 fd415f0ab8 feat(procgen): add karst cave generator 2026-08-30 21:32:19 +08:00
西风逍遥游 fbd6ef14b6 build: reduce shared manifest conflict hotspots 2026-08-30 16:00:46 +08:00
sunxfancy acbe8174b3 fix(procgen): align terrain APIs with dev contracts 2026-08-29 09:56:47 +08:00
sunxfancy 9000984883 Merge remote-tracking branch 'origin/dev' into codex/terrain-hydrology-system
# Conflicts:
#	docs/usr/modules/procgen.md
#	docs/usr/modules/voxel.md
#	examples/terrain-editor/main.nut
#	src/modules/procgen/Procgen.cpp
#	src/modules/procgen/Procgen.h
#	src/modules/voxel/VoxelWorld.cpp
#	src/modules/voxel/VoxelWorld.h
#	test/procgen.cpp
#	test/voxel.cpp
2026-08-29 09:11:49 +08:00
sunxfancy 146f7244dc feat(procgen): add production terrain hydrology pipeline 2026-08-29 03:10:51 +08:00
西风逍遥游 8832b56d54 Merge pull request #283 from EVEngine/codex/procgen-dungeon-assets
feat(procgen): add configurable dressed dungeon generation
2026-08-29 02:35:34 +08:00
sunxfancy 3a80a1febe fix(ci): harden dungeon generation across profiles 2026-08-28 21:56:17 +08:00
sunxfancy 929f9279fd feat(procgen): add perimeter dungeon entrances 2026-08-28 19:41:38 +08:00
西风逍遥游 a2a5ef8f5f feat(procgen): add procedural prototype kit 2026-08-28 14:55:36 +08:00
sunxfancy 9261044232 feat(procgen): add configurable dungeon dressing 2026-08-28 12:52:13 +08:00
西风逍遥游 1ca2ebea71 docs: describe procgen texture binding contract 2026-08-28 00:06:44 +08:00
西风逍遥游 380afa00a2 docs: cover resource lifecycle bindings 2026-08-27 14:57:49 +08:00
西风逍遥游 293be41d66 Merge remote-tracking branch 'origin/dev' into codex/architecture-consolidation
# Conflicts:
#	cmake/module_manifest.cmake
#	docs/usr/modules/procgen.md
#	src/engine/CMakeLists.txt
#	src/engine/cmdline/Run.cpp
#	src/engine/common/ScriptModule.h
#	src/modules/animation/Animation.cpp
#	src/modules/physics/World.cpp
#	src/modules/physics/World3D.cpp
#	src/modules/procgen/Procgen.cpp
#	src/modules/procgen/Procgen.h
#	src/modules/scene/SceneCapabilities.cpp
#	src/modules/schema/Schema.cpp
#	src/modules/schema/Schema.h
2026-08-27 14:52:28 +08:00
西风逍遥游 a8b8e83128 refactor: consolidate engine architecture contracts 2026-08-27 12:54:48 +08:00
西风逍遥游 1720519156 Merge branch 'dev' into codex/procgen-lsystem-poisson
Re-integrate the latest dev after it was fixed: dev's Run.cpp scriptError
breakage is resolved on the new dev head. Resolved merge conflicts by keeping
both the L-system / poissonDisk additions and dev's PCG/runtime-generation /
spatial-data additions in Procgen.h/.cpp, test/CMakeLists.txt, and
procgen.md.
2026-08-26 18:46:40 +08:00
西风逍遥游 eefa21fd4d Merge branch 'dev' into codex/procgen-lsystem-poisson 2026-08-26 14:30:01 +08:00
西风逍遥游 3eef8f0ccc feat(procgen): fuse point transform dispatches 2026-08-26 13:35:24 +08:00
西风逍遥游 1cb1aae9b1 feat(procgen): add cross-backend point compute 2026-08-26 11:53:24 +08:00
西风逍遥游 e81d50834c feat(procgen): enforce preview allocation budgets 2026-08-26 11:00:00 +08:00
西风逍遥游 90033993ae feat(procgen): bound graph node point outputs 2026-08-26 10:48:44 +08:00
西风逍遥游 236ea8df9f feat(procgen): integrate biome grammar graph nodes 2026-08-26 10:37:19 +08:00
西风逍遥游 93856bab1d feat(procgen): report scene instance reuse 2026-08-26 10:30:22 +08:00
西风逍遥游 9d93605330 feat(editor): execute isolated PCG previews 2026-08-26 10:23:14 +08:00
西风逍遥游 87605deac9 feat(editor): migrate legacy PCG graph assets 2026-08-26 10:19:24 +08:00
西风逍遥游 f7b37e0b54 feat(procgen): trim runtime caches by priority 2026-08-26 10:06:12 +08:00
西风逍遥游 02d9d9a19d feat(procgen): enforce runtime point budgets 2026-08-26 09:59:06 +08:00
西风逍遥游 61a473869c fix(procgen): enforce reflected graph parameters 2026-08-26 09:48:55 +08:00
西风逍遥游 d1eca26c56 feat(procgen): instantiate isolated graph runtimes 2026-08-26 09:40:42 +08:00
西风逍遥游 7633cef257 merge dev into codex/ue-pcg-system 2026-08-26 09:36:09 +08:00
西风逍遥游 9f7e01d81e feat(procgen): cache node visualization metrics 2026-08-26 09:33:07 +08:00
西风逍遥游 00c3fcc447 fix(procgen): preserve scene instance identities 2026-08-26 09:26:09 +08:00
西风逍遥游 d43d910bcf feat(procgen): add density and metadata math nodes 2026-08-26 09:18:36 +08:00
西风逍遥游 84938d7c88 feat(procgen): add bounded copy-points node 2026-08-26 09:14:39 +08:00
西风逍遥游 7d8a3a6224 fix(editor): strictly validate PCG graph assets 2026-08-26 09:01:55 +08:00
西风逍遥游 696c5712da feat(editor): compile PCG graph blackboard parameters 2026-08-26 08:58:20 +08:00