Commit Graph
116 Commits
Author SHA1 Message Date
西风逍遥游 fd3146578e docs(procgen): demonstrate script-first hot reload pipeline 2026-08-24 21:00:59 +08:00
西风逍遥游 611fb81736 fix(ci): document atmosphere bindings and tests 2026-08-24 16:01:49 +08:00
西风逍遥游 b14419b01a Merge pull request #217 from EVEngine/codex/composable-2-5d-tilemap
feat(map): composable 2.5D TileSet workflow
2026-08-24 14:50:50 +08:00
西风逍遥游 8b972b6a59 Merge remote-tracking branch 'origin/dev' into codex/sprite-animation-production-api
# Conflicts:
#	src/modules/graphics/Graphics.cpp
2026-08-24 13:47:29 +08:00
西风逍遥游 b44a66e095 docs: list new sprite animation bindings 2026-08-24 13:45:04 +08:00
西风逍遥游 861b69ba2e docs(map): document render spacing getters 2026-08-24 13:44:01 +08:00
西风逍遥游 aa79d70200 feat(map): add composable 2.5D tileset workflow 2026-08-24 13:38:11 +08:00
西风逍遥游 d8536263f8 Merge pull request #215 from EVEngine/codex/weather-daynight-living-sky 2026-08-24 13:26:59 +08:00
西风逍遥游 6887ae6d91 feat(animation): add production sprite sequence workflow 2026-08-24 12:39:59 +08:00
西风逍遥游 6d2147f051 docs(graphics): document rotated texture binding 2026-08-24 10:45:41 +08:00
西风逍遥游 8723501487 docs: document weather integration bindings 2026-08-24 10:33:27 +08:00
西风逍遥游 1cbcb15244 docs: document native heightmap brush 2026-08-24 01:00:10 +08:00
西风逍遥游 58db27d545 Merge pull request #206 from EVEngine/codex/editor-tool-protocol
feat(editor): add protocol-first map and terrain editor components
2026-08-23 21:43:14 +08:00
sunxfancy ca003c4358 docs(editor): cover all script tool bindings 2026-08-23 20:07:46 +08:00
西风逍遥游 0387f7f14a Merge pull request #200 from EVEngine/codex/atmosphere-volumetric-clouds
Improve atmospheric day/night skies and add volumetric clouds
2026-08-23 20:05:09 +08:00
sunxfancy ebfa403c3b docs(editor): explain protocol-first editor composition 2026-08-23 19:36:25 +08:00
西风逍遥游 5841b84b2e Merge pull request #201 from EVEngine/codex/urban-procgen
feat(procgen): hierarchical parcel & street co-generation (EG 2024 urban modeling)
2026-08-23 18:25:40 +08:00
西风逍遥游 8a53d9d8a6 feat(procgen): hierarchical parcel & street co-generation (EG 2024 urban modeling) 2026-08-23 17:47:19 +08:00
西风逍遥游 aba46921d2 Merge pull request #199 from EVEngine/codex/voxel-terrain-scene
feat(voxel): streaming terrain test scene + full sampler config; fix script draw dispatch
2026-08-23 17:41:29 +08:00
sunxfancy 4e53fc7c1f docs(graphics): document volumetric cloud bindings 2026-08-23 16:38:54 +08:00
sunxfancy 8926d7516b feat(daynight): expose attenuated sun color 2026-08-23 16:34:49 +08:00
sunxfancy 9a6a92d41f feat(daynight): add atmospheric scattering sky model 2026-08-23 16:27:50 +08:00
西风逍遥游 7974e10b8e feat(voxel): streaming terrain test scene + full sampler config; fix script draw dispatch
- VoxelWorld::setTerrainParam(key, value) exposes the full procgen TerrainSampler (island/continent/ridge/warp/octaves/...) to script, plus an optional sand band for low coastal columns.
- drawVisible now takes graphics::Graphics* (main class) instead of IGraphics3D*: the script binding layer reinterpret-casts interface pointers without secondary-base adjustment, so the IGraphics3D vtable slot for drawVoxelFaceInstances resolved to an unrelated function and voxel draws were silently dropped from the frame.
- Graphics.h: move decal virtual declarations after drawVoxelFaceInstances so the primary vtable slot order matches IGraphics3D for unadjusted script-side dispatch.
- New examples/voxel-terrain scene: first-person fly, 4 terrain presets, streaming chunks, raycast place/break, F12 swapchain screenshot.
- Unit tests for the param API + sand band; docs updated.
2026-08-23 16:20:04 +08:00
西风逍遥游 e48551911f Merge pull request #194 from EVEngine/codex/cloth-simulation
feat(physics): 2D/3D cloth with self-collision, fold limits, body collision, and GPU backend
2026-08-23 16:19:33 +08:00
西风逍遥游 92cd886bd4 fix: CI failures for cloth PR
- examples/softbody3d: pass explicit Box3D shape arguments (script bindings
  do not apply C++ default args) and use math.polarX/polarY instead of
  math.sin/cos (EVEngine's math module shadows the standard table)
- ClothGPU: drop unused local in reset() (MSVC /W4 /WX C4189)
- docs: add missing Cloth/Cloth3D API entries to the physics quick reference
2026-08-23 15:12:19 +08:00
西风逍遥游 426059d299 Merge pull request #195 from EVEngine/codex/animskin-script-skinning-writeback
feat(animation): script-playable skeletal animation via AnimSkin writeback
2026-08-23 15:02:29 +08:00
西风逍遥游 c65daede2e feat(animation): script-playable skeletal animation via AnimSkin writeback
AnimSkin can now write CPU-skinning results back to the render mesh so skeletal animation actually plays from scripts:
- capture bind normals at fromModel and skin them per pose (updateSkinnedNormals / getSkinnedNormals, cofactor inverse-transpose + normalize)
- packed getSkinnedPositions() array getter, matching AnimLattice's script pattern
- one-call applyToMesh(gfx, mesh, pose): skin positions+normals then in-place gpu.updateMeshVertices
- Renderable3D.getMesh() script binding so createRenderable meshes are reachable
- Mesh::gpuVertexCount so getVertexCount() is correct for non-morph meshes (both backends)
- tests: packed positions == skinPositionsTo, normals follow pose and stay unit length, applyToMesh render test with in-place updates
- docs: animation/graphics user guides + design spec
2026-08-23 14:24:11 +08:00
西风逍遥游 188012ee47 feat(physics): 2D/3D cloth with self-collision, fold limits, body collision, and GPU backend
- Cloth3D: meter-space Verlet cloth with triangle-level self-collision, dihedral fold-angle limit, mass-proportional rigid-body collision, double-sided mesh rendering
- Cloth (2D): self-collision, fold-angle limit, mass-proportional body collision, Fluid-style interactAt
- ClothGPU: compute-shader Verlet + distance constraints (double-buffered Jacobi), overflow-free atomicExchange spatial-hash self-collision, Sequence single-submission per frame
- World/World3D point probes for particle-vs-body queries; Body3D::getMass; Squirrel bindings for all new APIs
- examples/softbody3d demo; softbody/softbody_gpu/physics_cloth tests; user/dev docs
2026-08-23 13:54:20 +08:00
西风逍遥游 091992eed2 docs(editor): document heightmap mesh bindings (incl. smooth variants) 2026-08-23 11:06:11 +08:00
西风逍遥游 7f6f0e5463 feat(snow): sharper flat-bottom footprints, thicker snow, stronger normals 2026-08-23 11:01:45 +08:00
西风逍遥游 1c8ed18339 feat(snow): smooth-normal heightmap mesh so craters shade without facets 2026-08-23 10:57:50 +08:00
西风逍遥游 e5773ec274 feat(snow): separate height/albedo/normal textures and randomized ejecta mounds 2026-08-23 10:53:09 +08:00
西风逍遥游 6f095050d1 fix(snow): cast real CSM shadows via a Light3D directional caster 2026-08-23 10:45:35 +08:00
西风逍遥游 7a11a9a638 docs(snow): user guide, module index and design notes 2026-08-22 23:49:21 +08:00
西风逍遥游 432c0722fb docs: list literal API names in new chapters so check_bindings passes
avatar/database/dialogue/sceneloader/stylize/virtualgeometry now list
getName(); camera spells getTargetX/Y/Z out in full. These chapters are
gated by scripts/check_bindings.py --strict in CI.
2026-08-22 08:36:13 +08:00
西风逍遥游 18205aabb9 docs: add 10 module chapters, voxel example, gallery links; fill script binding gaps
- New user docs: avatar, buildingfx, camera, database, dialogue, grid,
  housegen, sceneloader, stylize, virtualgeometry (all written against the
  actual addFunc surfaces; API quick-refs included). Wire them into MODULES.md.
- examples/voxel: streaming terrain + place/break demo (procedural atlas,
  setTerrain + streamAround, DDA raycast picking, orbit camera). Script logic
  verified locally (no script errors; 16 chunks / 3117 rects selected).
- README gallery links in both Readme.md and Readme.en.md.
- Script binding fixes discovered while writing the docs/examples:
  * Graphics.setCanvas accepts null (and Canvas instances) so canvas sessions
    can be ended from scripts; begin3DFrame/setMesh3DViewProj/setMesh3DView/
    setMesh3DCameraPos now exposed for script-driven 3D (voxel etc.).
  * SceneLoader.load/host exposed (previously only reload/status were bound).
2026-08-22 08:27:43 +08:00
西风逍遥游 7437224c90 api(graphics): align C++/script names, validate sampler strings, document error contracts
- Add RGBA-float drawSolidRect/drawTexturedRect overloads so the C++ names
  match the script-facing API (script already bound those names).
- Add string-based setTextureSampler(Texture*, filter, mipmap, aniso, lodBias)
  overload with strict magic-string validation (unknown filter/mipmap now
  throws instead of silently falling back to linear); keep
  setTextureSamplerParams as a deprecated alias. Script binding now targets
  the overload with an explicit cast.
- Document error contracts: DataModule encode/decode (new[] ownership +
  throws), Filesystem setSource/mount/unmount (false on recoverable failure,
  no throw), ModelData getMesh vs numeric getters (nullptr vs throw), plus a
  two-state error-semantics section in API-CONVENTIONS.md.
- Tests: TextureSampler string validation (valid + deprecated alias + typo
  throws), headless test now exercises the RGBA-float overloads.
2026-08-22 02:30:12 +08:00
西风逍遥游 2ab09dcf68 feat(script): bind Image decode, Joystick Pad axes/buttons, Mouse relative mode
- Image: expose newImageData(newImageDataFromFile)/newEmptyImageData/isCompressed and a
  full ImageData script class (getWidth/Height/Format/Size, pixel get/set, paste, clone,
  rotate). ImageData is now registered once by the Image module; drop the duplicate
  minimal registrations in Font and Model3D that could overwrite each other.
- Joystick: expose getJoystick/getJoystickFromID/getIndex/addJoystick/removeJoystick and a
  Pad class with raw axes/buttons/hats, GameController axis/button names, device info,
  and vibration. Pads stay owned by the module (non-owning script handles).
- Mouse: expose setRelativeMode/getRelativeMode plus setVisible/setPosition/setX/setY/
  setGrabbed/isGrabbed (SDL backend already implemented them).
- Tests: add image.nut/image_script.cpp and joystick.nut/joystick_script.cpp script tests,
  extend mouse.nut with relative-mode/visibility checks, wire into test CMake and the nut
  embed template.
- Docs: update image/joystick/mouse user chapters, MODULES.md and the REVIEW log.
2026-08-20 12:31:11 +08:00
西风逍遥游 34d1fdb63b refactor(modules): clear remaining back-edges and split the largest TUs (#127)
* chore(ci): add clang-format gate, CODEOWNERS and agent collaboration rules

* refactor(modules): clear remaining back-edges and split the largest TUs

Three known dependency back-edges are gone (module_depgraph.py KNOWN_BACK_EDGES
is now empty; --check passes with 0 violations, 0 cycles):

- window -> graphics: window queries the new IWindowSurfaceHost capability
  (common/WindowSurfaceHost.h) instead of holding a Graphics pointer;
  Window::setGraphics was removed and all call sites updated.
- window -> image: Window::setIcon was replaced by setIconRGBA(const uint8_t*,
  w, h); the window no longer decodes ImageData.
- scene -> graphics: pickScreenAt / collectFrustumIdsAt implementations moved
  to graphics/ScenePicking.cpp (graphics -> scene is a legal downward edge);
  scene now depends only on spatial.

TU splits (pure moves, verified identical method sets and brace balance):

- vulkan/Graphics.cpp (5118 lines) -> Graphics.cpp (lifecycle), GraphicsPipeline,
  Graphics2D, Graphics3D, GraphicsMesh + shared GraphicsInternal.h.
- scene/Scene.cpp -> Scene.cpp (script layer / host lifecycle / serialization)
  + SceneNodes.cpp + shared SceneInternal.h.

Verified with a real build (MSVC 19.51, prebuilt third-party): full build green;
window.* and Scene.* suites pass, including scene picking/culling and GPU cases.

* refactor(graphics): narrow Graphics interfaces and clear public-header leaks

Step 4 — interface segregation:
- New lean interfaces: IGraphics2D, IGraphics3D, IResourceFactory, IPostFX
  (pure virtuals, forward-declared types only; graphics/Color.h extracted from
  Canvas.h so modules that only need the color type stop pulling Canvas.h).
- Graphics now implements all four facets; consumers can depend on the narrow
  interface they use instead of the 129-method god class.
- Migrated voxel (VoxelWorld::drawVisible -> IGraphics3D*) and model3d
  (ModelRenderer::buildRenderable(s) -> IResourceFactory&).
- Graphics.h slims from 24 sub-header includes to a handful of small type
  headers + forward declarations; the destructor moved out-of-line so
  unique_ptr effect members are destroyed where types are complete.

Step 5 — header leaks (module_depgraph.py '*' marks: 14 -> 7):
- map/TileLayer.h, particles/ParticleEmitter.h, avatar/AvatarInstance.h,
  animation/SpineAnim.h, map/TileSystem.h, model3d/ModelData.h,
  model3d/ModelRenderer.h, audio/Audio.h + Source.h, image/ImageData.h +
  Image.h, dialogue/Dialogue.h, procgen Palette/OutputSpec/TextureRecipe/
  PbrMaterial -> forward declarations, includes moved to .cpp.
- voxel/VoxelWorld.h: terrain sampler Pimpl'd (unique_ptr + out-of-line
  destructor), removing the procgen header dependency.
- gpgpu/vulkan backend headers stop pulling graphics/vulkan/Graphics.h.
- Remaining '*' marks are deliberate: tiny POD/enum headers (GridConfig,
  MapObject, BlendMode, Color), an internal backend header
  (GraphicsInternal.h -> filesystem), and lean interface references.

Verified with a full clean build (MSVC) and tests: window/Scene/voxel/
RenderSystem/Quad/shader/TextureSampler/resourceLifetime pass; broad suite
only shows the pre-existing PHYSFS-init filesystem-environment failures.

* feat(resources): revive ResourceManager as unified IAssetReloader-backed cache

* fix(resources): leak ResourceManager singleton to avoid exit-time teardown crashes

Cached CPU resources may own third-party handles (FreeType faces, Assimp
scenes, image decode handlers) whose libraries are torn down at process
exit in an unspecified TU order; destroying cached entries from the
singleton destructor can segfault at exit (seen on CI Windows in
model3d.materialApi.objMtl). Keep the singleton alive until OS reclaim;
explicit unload()/clear() still release entries during the run.

* refactor(devtools): consume business modules through capability interfaces

DevTools / cmdline no longer include business-module headers, so trimming
scene / physics / procgen / particles / audio / ui / graphics no longer
requires disabling devtools, and devtools can be switched off with
-DEVENGINE_MODULE_DEVTOOLS=OFF.

New capability interfaces in common/:
- ISceneQuery (scene) - host/node inspection + mutation + transform sync
- IRenderCapture (graphics) - render status, PNG capture, camera control,
  visible-entity snapshot, entity-ID mask, G-buffer PNGs
- IPhysicsQuery (physics) - 2D world lifecycle + ray casts
- IProcgenQuery (procgen) - recipe listing, map/mesh generation
- IParticlesQuery (particles) - emitter status + one-shot emit
- IAudioQuery (audio) - volume / stop-all
- IEditorHost (ui) - declarative editor host (used by cmdline too)

Providers register in their module constructors. DevTools rewires McpServer
(render/scene/procgen/physics/particles/audio/host tools), SceneInspect
(now delegates to ISceneQuery + IRenderCapture) and RenderVision (uses
IRenderCapture::capturePngDataUrl); cmdline/Mcp.cpp uses IEditorHost.

manifest: devtools DEPS graphics scene physics procgen particles audio ui
image event filesystem -> event; cmdline DEPS filesystem ui -> filesystem.

Verified: full build green; devtools.mcp.* tests pass; broad suite shows
only the pre-existing PHYSFS-init filesystem-environment failures.

* style: apply clang-format to changed lines after dev merge

* fix(webgpu): include RenderControl/TextureSampler explicitly after Graphics.h slimming

* fix(webgpu): provide newFont/print stubs to satisfy IGraphics2D/IResourceFactory vtables

* fix(common): make ProcgenQuery.h self-sufficient (cstdint/utility for GCC)
2026-08-20 05:53:33 +08:00
西风逍遥游 c7de064bf4 Merge remote-tracking branch 'origin/main' into codex/ui-viewport-terrain-editor
# Conflicts:
#	src/modules/sceneloader/SceneLoader.cpp
#	test/sceneloader.cpp
2026-08-19 09:11:05 +08:00
西风逍遥游 a2dd8d7fb1 feat(ui): two-pass layout, images, events, virtualization, viewport
Gap-closing work for the declarative UI module vs UE/Unity/Godot:

- Layout: real measure pass (measureTree) + pure flexArrange with
  margin/padding/min-max/percent/anchor/absolute placement; window size,
  anchors and percentage sizing; script layout props.
- Widgets: Image/ImageButton (engine textures + nine-patch + tint/uv),
  Combo, text wrapping + CJK font candidates/ranges, InputText 1024B,
  virtualized ScrollList/virtualList.
- Events: script onClick/onChange callbacks with structured payloads
  (keeps the poll queues for compatibility).
- Tooling: UI JSON save/load (saveTreeJson/loadTreeJson), host pos tween
  animation, gamepad nav, per-frame UI stats.
- Viewport: embedded offscreen render target widget with input routing;
  RenderSystem3D::renderToCanvas preview pass + Graphics::renderScene3DToCanvas;
  editor.newHeightmapMesh/updateHeightmapMesh for heightmap terrain;
  examples/terrain-editor demonstrating orbit camera + raise/lower brush.
- Tests: 32 UI tests including real-window Vulkan smoke for the viewport.
2026-08-19 09:07:55 +08:00
西风逍遥游 3c1ff324ac Merge branch 'main' into codex/model3d-material-api 2026-08-19 07:44:47 +08:00
西风逍遥游 92e0c653a2 Merge pull request #115 from EVEngine/codex/network-module-improvements
network: reliable UDP transport, RPC and multi-peer host
2026-08-19 07:44:19 +08:00
西风逍遥游 6f3552a7c2 Merge pull request #116 from EVEngine/codex/voxel-engine-gap-improvements
feat(voxel): close feature/perf gap vs mainstream voxel engines
2026-08-19 07:43:01 +08:00
西风逍遥游 e98f125f21 feat(voxel): close feature/perf gap vs mainstream voxel engines
- Cross-chunk seam culling via GreedyMesher::ChunkSampler; border edits now
  invalidate the adjacent chunk; air writes no longer allocate chunks
- selectVisible meshes only after range/frustum culling
- DDA voxel raycast (CPU + script getters)
- Parallel remeshDirty(maxThreads) with serial fallback; output equals serial
- Vertex AO: Minecraft-style 4-corner AO packed 2bit x 4, Vulkan instancing +
  voxel_rect shaders (SPIR-V .inc regenerated); WebGPU accepts params (TODO)
- Persistence: serializeWorld/deserializeWorld (EVVX LE) + saveWorld/loadWorld;
  unloadChunksOutside + streamAround for player-centered streaming
- Terrain: reuse procgen::TerrainSampler (no new module), setTerrainParams +
  terrainHeightAt; script setTerrain/streamAround
- CPU tests + gap-analysis/module/user docs; local MSVC harness 1741 checks pass
2026-08-19 04:13:21 +08:00
西风逍遥游 cc576c264a feat(model3d): material/texture API + auto-assembly renderer
ModelData gains material accessors (base color, metallic/roughness, opacity, two-sided), texture queries by type name (base_color/diffuse/normals/height/...), and embedded texture decode to RGBA8 ImageData. New model3d::buildRenderable(s) helpers assemble Renderable3D from a decoded model (node transform baked, material/PBR/textures applied), bound to Squirrel as Model3D::createRenderable.

Normals for assets missing authored normals now default to smooth generation: CMake applies an idempotent configure-time patch to medialoader switching aiProcess_GenNormals -> aiProcess_GenSmoothNormals.
2026-08-19 04:12:54 +08:00
西风逍遥游 d75e3bcf0d network: reliable UDP transport, RPC and multi-peer host
- UdpLink: reliable/unreliable/unreliable-ordered UDP with ACK/retransmit,
  fragmentation, heartbeat and loss simulation; main-thread pump routing
- NetRpc: u16 msgId + payload envelope, C++ handlers and script closures
- NetHost: shared-socket multi-peer routing with auto peer ids and lifecycle
  events (peerconn/peerdisconn)
- NetReader/NetWriter: typed little-endian serialization primitives
- TcpSocket: queued sends with partial-write/would-block handling; connect
  timeout unit fix; UDP socket buffers raised to 1MiB
- Tests mirrored in test/network.cpp; docs: design spec + user module doc
2026-08-19 04:08:24 +08:00
西风逍遥游 b8da538300 Merge pull request #111 from EVEngine/codex/tensor-inference-quant
tensor: AITemplate-style compile pipeline + gpgpu Sequence + mini-LLM demo + weight-only quantization
2026-08-18 21:41:31 +08:00
西风逍遥游 40307d9f5d Merge branch 'main' into codex/building-grid-placement 2026-08-18 20:43:07 +08:00
西风逍遥游 cff9bb4d0c tensor: AITemplate-style compile pipeline, gpgpu Sequence, mini-LLM demo and weight-only quantization
Refactor the tensor module around AITemplate-style static compilation:

- Optimizer: DCE, constant folding, elementwise chain fusion, matmul/conv
  bias+activation epilogue fusion, liveness-based static memory planning,
  topological group execution order.
- KernelGen: shape-baked GLSL per fused group; two-pass softmax/layernorm;
  shared-memory SDPA; naive + 16x16 tiled matmul templates.
- GpuBackend: arena buffer allocation per memory plan, matmul autotuning,
  single command-buffer submission via the new gpgpu::Sequence (uploads,
  dispatches and downloads recorded once per run, Kompute-style).
- shaderc in-process GLSL->SPIR-V on Windows (no glslc.exe dependency),
  with glslc spawn fallback.
- CPU reference kernels shared by eager and the compiled interpreter;
  no-Vulkan fallback keeps compiled graphs runnable headless.

Neural-network coverage: softmax/logsoftmax, layernorm/rmsnorm (with
weight/bias), gelu/silu, conv1d/conv2d, pool, embedding, concat/slice,
axis reduces, argmax, cast, fused SDPA (+masked), resize2d, batched
matmul, seeded random.

Weight-only quantization (activations stay fp32):
- fp16 (IEEE half), fp8 (e4m3), fp4 (e2m1), int8, int4 with per-group
  block scales (MXFP-style: scale = maxAbs / format max magnitude).
- Quantized weights capture into graph Const nodes; CPU interpreter
  dequantizes at materialization; GPU matmul/embedding kernels dequantize
  inline from packed uint buffers (naive matmul variant).
- TF::quantizeWeight API + script binding.

Mini-LLM validation (TinyStories-gpt2-3M, 8 layers d=64):
- test/tensor_llm.cpp builds the full GPT-2 graph from engine ops and
  matches numpy reference: probs within 3e-7, greedy generation 24/24
  identical (~100 ms/token CPU), compiled path exact.
- tensor.llm.quantizedDtypes: fp16/int8/fp8/int4 all keep 16/16 greedy
  top-1 (fp4 16/16 with proper block scaling), weights 27.6 MB -> 3.3-13 MB.
- scripts/export_tiny_gpt2.py converts a PyTorch .bin checkpoint (no torch
  dependency) plus GPT-2 tokenizer into engine assets + numpy reference.

Tests: gpgpu 8/8, tensor 31/31 (original suite) + tensor.llm.* + tensor.quant.*
Assets in test/assets/mini_llm are gitignored (regenerate via the script).
2026-08-18 17:42:38 +08:00