Commit Graph
3 Commits
Author SHA1 Message Date
西风逍遥游 8897e3c574 feat(hd2d): add riverside scene and correct billboard rendering 2026-09-09 20:19:28 +08:00
西风逍遥游 8ec65e796c fix: enforce checked handles across full CI build 2026-08-27 18:21:02 +08:00
西风逍遥游 5587f53a4f feat(hd2d): render 2D tilemaps and sprite characters in 3D scenes
Add an hd2d module that layers the existing graphics 3D pipeline onto 2D
content for HD-2D scenes:

- TileMap3D extrudes a map::TileLayer into a 3D relief mesh. Every non-empty
  tile becomes a box whose top face shows the tile's atlas region and whose
  side walls extrude down to the configured depth; per-tile elevation is read
  from tile "height" metadata. buildMesh/buildRenderable hand it to an ECS
  Renderable3D so it picks up depth, shadows and GBuffer automatically.
- Sprite3D renders a 2D texture (character / animation frame) as a
  camera-facing cylindrical billboard in the 3D world. It is an ECS
  Renderable3D oriented toward the camera each frame, so it composites into
  the forward pass and casts shadows; a sprite-sheet frame grid lets existing
  2D animations play in 3D.

The module is declared in module_manifest.cmake (LAYER 5, GROUP 3d, SCRIPT
Hd2D SLOT hd2d) with a clean header (no cross-module leaks). test/hd2d.cpp
covers mesh box counts, height relief, empty-layer null, tilemap + billboard
render smoke (which write PNGs to the test out dir), frame-grid animation,
flip UVs and quad upload. 9 per-case tests pass.
2026-08-26 15:27:14 +08:00