20 Commits
Author SHA1 Message Date
西风逍遥游 92109ae643 feat(fluids): add Fluid3D simulation and rendering 2026-09-14 23:28:26 +08:00
sunxfancy cb749c958a feat(graphics): add orthographic dungeon presentation 2026-08-28 19:12:48 +08:00
西风逍遥游 8ec65e796c fix: enforce checked handles across full CI build 2026-08-27 18:21:02 +08:00
西风逍遥游 da7c6d3069 test(render): sample checker away from filter boundary 2026-08-26 00:29:26 +08:00
西风逍遥游 09c778dea7 test: shared test fixtures (test/Fixtures.h), dedupe 16 openGfxWindow copies
Add test/Fixtures.h with an inline openGfxWindow() (same signature as the
16 per-file copies, plus EVENGINE_TEST_VIEW_W/H overrides for CI), a RAII
GfxFixture, and a TempDir helper. Migrate all 16 test files that hand-rolled
openGfxWindow to use the shared helper; windowed GPU tests now override their
view size from env vars instead of editing each file.
2026-08-22 02:27:46 +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
西风逍遥游 149ef03a06 perf(graphics): ring-buffer dynamic mesh updates, drop device-wide waits (P1-2)
- GpuMesh gains a 3-copy ring of host-visible vertex/index buffers used once
  a mesh is actually updated (skin/morph/sprite-stack). Writing the next copy
  never races with in-flight frames, so bakeMeshMorph / updateMeshVertices no
  longer call waitForSharedGpuResources() — removing the full pipeline drain
  that stalled every frame for animated meshes.
- The draw path binds the latest written copy; static meshes keep their
  single buffer untouched. 16-bit static indices are normalized to 32-bit
  CPU copies when a mesh becomes dynamic.
- New regression test alternates per-frame vertex updates across many frames
  and asserts the rendered image tracks the latest update.
2026-08-19 23:46:16 +08:00
西风逍遥游 adf32a4e78 test: re-enable hair/runtime suites, add resource-lifetime and tooling tests
Re-add test/hair.cpp and test/runtime.cpp (fixing the missing zeroerr include and enum comparisons), add graphics.resourceLifetime tests for the new release APIs, a test-source manifest check, module declared-layer check with unit tests, and a raw-string-literal regression test.
2026-08-19 22:44:53 +08:00
西风逍遥游 6d0e53832e feat(devtools): add scene-inspection MCP tools with synchronized image/geometry snapshots
Add engine-layer scene inspection toolset for the MCP server:
- inspect_generate_scene_camera_views / set_camera_pose / get_visible_entities_screen_bbox
- capture_render_frame now exports atomically synchronized buffers: color frame
  + geometry JSON always, plus optional depth/normal (GBuffer), and a per-pixel
  render entity-ID mask (id) with a JSON id->entity mapping.

Engine support:
- Graphics::renderEntityIdMask (per-pixel mesh ID offscreen pass, Vulkan)
- Graphics::readGBufferToImageData (depth/normal readback)
- SceneInspect module: multi-camera auto sampling, atomic snapshot, temp cache

Verified with GPU tests (RenderSystem3D.entityIdMaskPixels, readTextureBackPixels).
2026-08-16 16:46:05 +08:00
西风逍遥游andCursor Agent c5ec152369 test(graphics): classic 场景开启 mipmap 与各向异性过滤 (#51)
* test(graphics): enable mipmaps and anisotropy in classic scene loads

ClassicScenes Assimp albedo, RenderImageAudit studio checkers/rock maps,
and RenderSystem3D motif/checker textures now use TextureCreateInfo::withMipmaps
so flythroughs exercise trilinear + anisotropic filtering while engine defaults stay off.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* fix(test): avoid REQUIRE on MipmapMode enum in ClassicScenes

zeroerr tries to stream enum values in assertion diagnostics and has no
operator<< for MipmapMode, which broke Linux/macOS/Windows CI builds.
Compare via static_cast<int> like TextureSampler.cpp.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* fix(test): use .get() in unique_ptr REQUIRE checks

zeroerr assertion diagnostics copy compared values; REQUIRE(unique_ptr)
fails to compile because unique_ptr is non-copyable.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-13 23:50:01 +08:00
西风逍遥游andCursor Agent 59b2ebabf1 feat(graphics): parallax occlusion mapping (POM) for mesh3d (#35)
Add height-map driven POM on the default mesh3d / mesh3d_clustered PBR
path so brick/stone materials get fake depth without tessellation.

- GLSL: parallax_map.glsl (adaptive steep march + linear refinement)
- API: Renderable3D::setHeightTexture / setParallax; scale=0 keeps old UVs
- Descriptor binding for height sampler; UBO parallax vec4 appended
- Docs + CPU math tests + GPU pixel-diff coverage

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-12 18:33:03 +08:00
西风逍遥游andCursor Agent 1fe6934c0a feat(graphics): texture cell bombing 消除平铺重复纹理 (#30)
* feat(graphics): texture cell bombing to break tiling

Add UV-space cell bombing on the default mesh3d / clustered PBR paths:
per-cell random offset and rotation blended across a 2x2 neighborhood
(with textureGrad for stable mips). Opt-in via Renderable3D::setTexCellBomb
(strength 0 keeps prior behavior). Includes GLSL helper, SPIR-V embeds,
CPU reference header, docs, and smoke tests.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* fix(graphics): rotate UVs in cell bombing; harden GPU test

Rotate UVs about each cell center (not just translate) so periodic
textures actually break tiling. Use the known-good UV cube + repeating
motif in the pixel smoke test.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-11 17:01:48 +08:00
西风逍遥游 b9e3730072 feat(tests): enhance graphics tests with new rendering previews
- Added new test cases for various graphics functionalities, including animation previews, particle effects, and inventory UI.
- Implemented rendering previews for Mixamo animations, Box2D physics, and procedural generation, allowing for real-time visualization during tests.
- Introduced helper functions for drawing graphics elements, improving the clarity and maintainability of test code.
- Enhanced existing tests to utilize the new graphics capabilities, ensuring comprehensive coverage of rendering features.
2026-08-11 02:57:47 +08:00
西风逍遥游andCursor Agent d603219164 feat: complete 2D/3D pick, overlap, and collision query APIs (#11)
Add Math geometry tests for 2D/3D picking and overlaps, Physics
rayCast/queryAABB/testPoint, and Camera2D/3D screen pick helpers,
with script bindings, docs, and unit tests.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-10 07:42:09 +08:00
西风逍遥游 f0b0527f9f feat: enhance map module with multi-layer support and object management
- Implemented multi-layer tilemap functionality, allowing for the reading and saving of Tiled JSON formats.
- Added support for various tile projections (orthogonal, isometric, staggered, hexagonal) and depth calculations.
- Introduced object layer parsing and caching for improved map object management.
- Updated the rendering system to unify 2D depth queues and enhance sprite handling.
- Added new methods for accessing object properties, including position and dimensions.

This update significantly improves the map module's capabilities and integration with the rendering system.
2026-08-08 00:26:58 +08:00
sunxfancyandCursor d1034c4c2b feat: enhance math and tensor modules with new functionalities and documentation updates
- Updated the math module to include vector and matrix operations, noise generation, Bezier curves, and random number utilities.
- Introduced the tensor module, providing TensorFlow 2-style eager execution and graph building capabilities.
- Enhanced documentation to reflect the new features in the math and tensor modules, including usage examples and API references.
- Modified CMakeLists.txt to include the new math and tensor modules, ensuring proper build configurations.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 15:50:02 +08:00
sunxfancyandCursor 097cc3835b feat: add demo module and enhance asset synchronization for Android
- Introduced a new optional demo module that includes procedural sound effects and planet texture generation.
- Updated the build system to support the demo module with the `EVENGINE_BUILD_DEMO` option.
- Enhanced the Makefile to synchronize game assets into the APK during the build process.
- Modified the AndroidManifest to set the screen orientation to portrait for better compatibility.
- Improved documentation to reflect the new demo features and asset synchronization process.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 17:38:56 +08:00
sunxfancyandCursor 73c779f87f feat: implement file watching functionality in the filesystem module
- Added methods for file watching, including `watch`, `unwatch`, `unwatchAll`, `getWatchCount`, `pollWatch`, `getLastWatchPath`, and `getLastWatchRealPath`.
- Enhanced the `Filesystem` class to support monitoring file changes, allowing for real-time updates.
- Updated the `physfs` implementation to handle file watch targets and events.
- Improved documentation and added unit tests to validate the new file watching features.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 14:51:07 +08:00
西风逍遥游 0daa1071bd feat: screen getPixel readback and 3D texture/lighting pixel verify
Add optional swapchain capture for getPixel, UV cube pixel tests, Ninja/MSVC tooling, and bump ECS.hpp/zeroerr submodules.
2026-08-05 16:10:32 +08:00
西风逍遥游 a6b4d4f884 feat: add Mesh drawMesh Camera3D Renderable3D and 3D-then-2D compose 2026-08-05 15:06:55 +08:00