561 Commits

Author SHA1 Message Date
AZhan
e19b764e1c fix(text): propagate WorldPosition dirty in _onRootCanvasModify when ReferenceResolutionPerUnit changes (#2981)
* fix(text): mark WorldPosition dirty after slot reallocation in _updateLocalData

Both Text (UI) and TextRenderer share a `bounds` getter that runs
`_updateLocalData` then checks `WorldPosition` dirty. `_updateLocalData`
internally `_freeTextChunks` + `_buildChunk → allocateSubChunk`, which
under PrimitiveChunk's first-fit + free-list-merge allocator can return
a slot previously owned by another renderer. `_buildChunk` writes UV
and color but never pos (pos is `_updatePosition`'s job), so the new
slot retains the previous owner's pos floats as residue.

Before this fix, when a path sets only `LocalPositionBounds` dirty
(e.g. `Text._onRootCanvasModify(ReferenceResolutionPerUnit)` in UI
Text), the bounds getter would:
  1. see LocalPositionBounds → run _updateLocalData (slot may swap)
  2. see WorldPosition not dirty → skip _updatePosition
  3. _setDirtyFlagFalse(Font) clear all dirty bits at once
The next _render also sees clean dirty bits and uploads the residue
pos to GPU — the renderer ends up rendering at someone else's old
world position. In practice this manifested as text glyphs jumping
to the wrong spot or appearing missing after UI tab switches that
free + reallocate chunk slots in the same frame.

Fix: force WorldPosition dirty at the end of _updateLocalData so the
contract "after this call, pos must be rewritten" is unconditionally
honored regardless of which caller invoked it.

Tests cover three layers:
  - dirty-flag invariant: _updateLocalData must leave WorldPosition
    dirty on exit
  - corrupted-slot: bounds getter with only LocalPositionBounds dirty
    rewrites pos even when the slot memory is poisoned
  - full slot-reuse repro: destroy a sibling renderer occupying a
    lower offset, then trigger bounds getter on the survivor — its
    pos must remain correct after the slot moves

Without the fix, all three regression tests fail with the survivor
rendering at the destroyed sibling's old position.

* chore: drop Chinese commentary from text dirty-flag fix

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(ui): destroy engine after regression describe block

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* refactor(text): move dirty propagation to input side

Previous fix added _setDirtyFlagTrue(WorldPosition) at the end of
_updateLocalData in both TextRenderer and UI Text. That treats the
output side as the place to declare invalidation, which conflates
two concerns: dirty flags should declare staleness from input
semantics, and update methods should be pure compute units that
don't propagate flags themselves.

Root cause is on the input side: _onRootCanvasModify(ReferenceResolutionPerUnit)
declared LocalPositionBounds dirty but not WorldPosition, even though
ReferenceResolutionPerUnit affects both local layout and the world
positions derived from it. Fix the declaration where the input
semantic event lives.

TextRenderer needs no change — it has no entry point that dirties
LocalPositionBounds without also dirtying WorldPosition (all setters
use DirtyFlag.Position which includes both).

Tests rewritten from white-box (poking private _dirtyFlag, hardcoded
enum values) to public-API integration tests that drive the bug
through uiCanvas.referenceResolutionPerUnit and assert observable
vertex position changes. The new tests fail without the fix
(maxDelta = 0, positions don't update) and pass with it.

* fix(text): include WorldVolume in dirty flag for ReferenceResolutionPerUnit change

Use DirtyFlag.Position (= LocalPositionBounds | WorldPosition | WorldVolume)
instead of the manual two-flag combination. ReferenceResolutionPerUnit
also affects world bounding volume; without the WorldVolume bit,
_updateBounds is skipped in the bounds getter and stale BoundingBox
leaks into frustum culling and raycasting.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: chenmo.gl <chenmo.gl@antgroup.com>
2026-05-07 17:23:26 +08:00
ChenMo
a6f05043d1 feat(shader-lab): make #define values first-class AST nodes (#2974)
* feat(shader-lab): make #define values first-class AST nodes
2026-04-28 17:12:18 +08:00
zhuxudong
e37c928eee fix(shader-lab): resolve generic return type for texture/builtin functions (#2966)
* fix(shader-lab): resolve GVec4 generic return type for texture() builtin functions
2026-04-21 20:10:42 +08:00
chenmo.gl
ebd57aef47 chore: release v2.0.0-alpha.30 2026-04-21 11:22:09 +08:00
hhhhkrx
4c6ddfa15c feat(particle): add cycles and repeatInterval to Burst (#2972)
* feat(particle): add cycles and repeatInterval to Burst
2026-04-21 11:20:38 +08:00
luzhuang
284cce8e16 feat(loader): v2 scene/prefab format parsing (#2959)
* refactor(loader): native v2 scene/prefab format parsing
2026-04-20 20:14:21 +08:00
chenmo.gl
f9064e7fc5 chore: release v2.0.0-alpha.29 2026-04-17 22:52:07 +08:00
zhuxudong
3f24a7d7ad fix(shader-lab): add missing semicolon in GLES100 fragment return conversion (#2968)
fix(shader-lab): add missing semicolon in GLES100 fragment return conversion
2026-04-17 15:09:49 +08:00
cptbtptpbcptdtptp
79b0698338 chore: release v2.0.0-alpha.28 2026-04-16 17:49:49 +08:00
hhhhkrx
7c5d468ad8 feat(particle): add transform to shape module (#2965)
* feat(particle): add position and rotation transform to shape module
2026-04-16 17:38:24 +08:00
ChenMo
708e95b167 fix(physics): unify scene query filtering to use collisionLayer (#2964)
* fix(physics): use collisionLayer instead of entity.layer for scene query filtering
2026-04-15 17:28:37 +08:00
cptbtptpbcptdtptp
fbd9f6f31d chore: release v2.0.0-alpha.27 2026-04-13 16:45:59 +08:00
cptbtptpbcptdtptp
a54642f5f0 chore: release v2.0.0-alpha.26 2026-04-10 10:19:14 +08:00
ChenMo
931f25426a fix(core): fix crash when removeChild during deactivation callbacks (#2947) (#2948)
Children-first deactivation order + scene guard for deferred callback safety.
2026-04-07 10:54:26 +08:00
zhuxudong
6c82a45ce1 feat(shader-lab): unify macro system with flat instruction bytecode (#2936)
* feat(shader-lab): unify macro system with flat instruction bytecode
2026-04-02 17:12:37 +08:00
ChenMo
e9bea5b32a refactor: unify shader file extension from .gs/.gsl to .shader (#2951)
refactor: Align with Unity convention by using .shader as the standard extension
for Galacean shader files instead of .gs/.gsl.
2026-04-01 23:19:50 +08:00
AZhan
b5614679ec fix(camera): invViewProjMat should ignore scale like viewMatrix (#2949)
* fix(camera): make invViewProjMat ignore scale consistently with viewMatrix
2026-03-28 14:34:35 +08:00
luzhuang
c3d2160c39 fix(loader): always create GLTF_ROOT container for consistent animation paths (#2943)
* fix(loader): always create GLTF_ROOT container for consistent animation paths (#2942)
2026-03-26 14:38:29 +08:00
cptbtptpbcptdtptp
b8b34ed3a4 chore: release v2.0.0-alpha.25 2026-03-23 21:48:31 +08:00
ChenMo
c3e2077d33 Unify Texture2D and TextureCube into single TextureLoader (#2937)
* refactor: unify Texture2D and TextureCube into single TextureLoader
2026-03-23 21:41:24 +08:00
cptbtptpbcptdtptp
2f88c2fab6 chore: release v2.0.0-alpha.24 2026-03-23 17:55:13 +08:00
hhhhkrx
73415e6ed8 implement HorizontalBillboard render mode (#2938)
* feat: implement HorizontalBillboard render mode
2026-03-23 17:29:12 +08:00
GuoLei1990
1ff3635412 chore: release v2.0.0-alpha.23 2026-03-20 21:20:51 +08:00
GuoLei1990
026b8fbd10 chore: release v2.0.0-alpha.22 2026-03-20 21:08:35 +08:00
GuoLei1990
ba694802aa chore: release v2.0.0-alpha.21 2026-03-20 21:05:45 +08:00
GuoLei1990
ec924d5783 chore: release v2.0.0-alpha.20 2026-03-20 20:57:58 +08:00
cptbtptpbcptdtptp
4213f7a0f5 chore: release v2.0.0-alpha.19 2026-03-20 16:02:26 +08:00
cptbtptpbcptdtptp
31089dc0a6 Merge remote-tracking branch 'origin/main' into feat/MCode 2026-03-20 15:50:21 +08:00
ChenMo
b71041c622 fix: defer physics contact event dispatch to after transform writeback (#2930)
* fix: defer physics contact event dispatch to after transform writeback
2026-03-20 15:22:25 +08:00
cptbtptpbcptdtptp
9d308ee8cc chore: release v2.0.0-alpha.18 2026-03-19 17:46:36 +08:00
hhhhkrx
68a0d57a9a rename limit/limitX/Y/Z to speed/speedX/Y/Z in LimitVelocit… (#2928)
* refactor: rename limit API to speed in LimitVelocityOverLifetimeModule
2026-03-19 17:20:57 +08:00
cptbtptpbcptdtptp
d61eb7627b chore: release v2.0.0-alpha.17 2026-03-19 10:35:18 +08:00
hhhhkrx
3c796e6e53 particle support limit velocity over lifetime (#2925)
* feat: particle support limit velocity over lifetime
2026-03-19 02:25:49 +08:00
cptbtptpbcptdtptp
e590f0ecbd chore: release v2.0.0-alpha.16 2026-03-18 18:02:59 +08:00
luzhuang
1afdfaa443 Support path-based cross-prefab entity/component refs (#2927)
* feat(prefab): support cross-prefab component refs
2026-03-18 17:59:20 +08:00
AZhan
886dda635d Fix compont props clone bug (#2926)
* fix: compontont props clone
2026-03-18 11:11:43 +08:00
cptbtptpbcptdtptp
26f35abacd chore: release v2.0.0-alpha.15 2026-03-17 19:21:25 +08:00
AZhan
57fdddb599 Unify Signal event mechanism with structured binding support (#2921)
* feat: unify signal event mechanism with structured binding support
2026-03-16 14:54:49 +08:00
cptbtptpbcptdtptp
fbc79fe85e chore: release v2.0.0-alpha.14 2026-03-16 12:14:57 +08:00
ChenMo
ce413ebbba feat: add RenderTarget asset loader and colorTextures getter (#2923)
* feat: add RenderTarget asset loader and expose colorTextures getter
2026-03-16 12:08:22 +08:00
GuoLei1990
5073881d6c chore: release v2.0.0-alpha.13 2026-03-14 00:38:50 +08:00
GuoLei1990
a3ab15da05 test: skip SceneParser test that depends on outdated project.json
The project.json contains deprecated "Environment" asset type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 01:29:51 +08:00
GuoLei1990
cbc17b2ad4 refactor: remove project-loader tests and fix ambientLight test data
- Remove project-loader e2e case (depends on outdated project.json with Environment type)
- Remove project-loader unit test from ResourceManager.test.ts
- Convert ambientLight test data to new GLCN header format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 01:26:56 +08:00
GuoLei1990
5a578424be refactor: update AmbientLight asset URLs to new format 2026-03-13 01:22:54 +08:00
GuoLei1990
0674811b6a chore: release v2.0.0-alpha.12 2026-03-13 00:01:21 +08:00
GuoLei1990
9bd6253456 chore: release v2.0.0-alpha.11 2026-03-12 23:28:53 +08:00
ChenMo
2a242ef61a refactor: rename Env to AmbientLight, .env to .ambLight (#2919)
* refactor: rename Env/EnvLoader to AmbientLight/AmbientLightLoader
2026-03-12 23:28:04 +08:00
GuoLei1990
a36d6526de chore: release v2.0.0-alpha.10 2026-03-12 21:09:58 +08:00
cptbtptpbcptdtptp
744deee2d3 chore: release v2.0.0-alpha.9 2026-03-11 20:21:28 +08:00
AZhan
a49884386b Fix setting the font to null will trigger an error (#2917)
* fix: setting the font to null will trigger an error
2026-03-11 20:17:41 +08:00