Commit Graph

3011 Commits

Author SHA1 Message Date
zhuxudong
5fe4e64c74 fix(shader-compiler): move bundler output out of dist/ (#3000)
fix(shader-compiler): move bundler output out of dist
2026-05-13 16:57:31 +08:00
luzhuang
25ba6eb1cd chore: release v2.0.0-alpha.32 v2.0.0-alpha.32 2026-05-12 19:59:16 +08:00
luzhuang
56bfd1b3c4 refactor(loader): rename v2 scene.entities to scene.rootEntities (#2997)
* refactor(loader): rename v2 scene.entities to scene.roots
2026-05-12 19:55:36 +08:00
cptbtptpbcptdtptp
71efdd81e3 chore: release v2.0.0-alpha.31 v2.0.0-alpha.31 2026-05-12 17:45:50 +08:00
luzhuang
6732c76a1b feat(loader): support $class refs and numeric SpecularMode in v2 scene (#2994)
* feat(loader): support class refs in v2 values
2026-05-12 16:47:58 +08:00
zhuxudong
1bc2b102ad refactor(shader): migrate GLSL shaders to ShaderLab and clean up shader infrastructure(#2961)
* refactor(core): migrate shaders from core/shaderlib to shader package and clean up old files
2026-05-11 17:55:17 +08:00
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 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 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
zhuxudong
35bc258071 fix(shader): add missing camera_VPMat declaration in Transform.glsl (#2969)
fix(shader): add missing camera_VPMat declaration in Transform.glsl
2026-04-17 15:05:05 +08:00
ChenMo
00942cc808 refactor(particle): rename ParticleScaleMode enums for clarity (#2970)
* refactor(particle): rename ParticleScaleMode enums for clarity
2026-04-17 14:58:35 +08:00
cptbtptpbcptdtptp
79b0698338 chore: release v2.0.0-alpha.28 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
ChenMo
85570311ab fix(audio): guard suspend/resume against uninitialized AudioContext (#2963)
* fix(audio): guard suspend/resume against uninitialized AudioContext
2026-04-14 15:51:49 +08:00
cptbtptpbcptdtptp
fbd9f6f31d chore: release v2.0.0-alpha.27 v2.0.0-alpha.27 2026-04-13 16:45:59 +08:00
ChenMo
1c41263cf3 feat(particle): implement curl noise for particle noise module (#2960)
* fix(particle): remove incorrect lifetime division in noise velocity
2026-04-13 15:44:40 +08:00
cptbtptpbcptdtptp
a54642f5f0 chore: release v2.0.0-alpha.26 v2.0.0-alpha.26 2026-04-10 10:19:14 +08:00
hhhhkrx
3189475648 feat(particle): add NoiseModule for simplex noise turbulence (#2953)
* feat(particle): add NoiseModule for simplex noise turbulence
2026-04-09 20:15:10 +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
AZhan
d1edf0d7b3 fix: use deepClone for Skin._skinMatrices to prevent shared reference (#2941)
fix: use deepClone for Skin._skinMatrices to prevent shared reference
2026-04-07 10:43:48 +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
zhuxudong
c127ba2a4a fix(rhi-webgl): complete sRGB format support for compressed textures (#2940)
fix(rhi-webgl): complete sRGB format support for compressed textures
2026-04-01 23:21:32 +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
ChenMo
0597e611c5 fix(particle): fix flipRotation logic and renderMode default value (#2939)
* fix(particle): fix flipRotation logic and renderMode default value
2026-03-24 16:21:33 +08:00
cptbtptpbcptdtptp
b8b34ed3a4 chore: release v2.0.0-alpha.25 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 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
46761322ff Merge branch 'main' into dev/2.0 2026-03-20 21:25:59 +08:00
ChenMo
769d4718f6 Revert "ci: add Co-authored-by workflow (#2934)" (#2935)
This reverts commit 734f181e01.
2026-03-20 21:25:29 +08:00
GuoLei1990
1ff3635412 chore: release v2.0.0-alpha.23 v2.0.0-alpha.23 2026-03-20 21:20:51 +08:00
GuoLei1990
026b8fbd10 chore: release v2.0.0-alpha.22 v2.0.0-alpha.22 2026-03-20 21:08:35 +08:00
GuoLei1990
ba694802aa chore: release v2.0.0-alpha.21 v2.0.0-alpha.21 2026-03-20 21:05:45 +08:00
GuoLei1990
396bbc0a5c Merge branch 'main' into dev/2.0 2026-03-20 21:01:08 +08:00
GuoLei1990
ec924d5783 chore: release v2.0.0-alpha.20 v2.0.0-alpha.20 2026-03-20 20:57:58 +08:00
ChenMo
734f181e01 ci: add Co-authored-by workflow (#2934)
* ci: add Co-authored-by workflow for auto-injecting company email trailer
2026-03-20 20:49:36 +08:00
cptbtptpbcptdtptp
4213f7a0f5 chore: release v2.0.0-alpha.19 v2.0.0-alpha.19 2026-03-20 16:02:26 +08:00
AZhan
efda137e62 Feat/m code (#2933)
* Extract _createRenderBuffer to deduplicate renderbuffer creation in GLRenderTarget (#2897)

* refactor: simplify GLRenderTarget with private _createRenderBuffer method

* fix: text dirty flag set error (#2931)

---------

Co-authored-by: ChenMo <gl3336563@163.com>
2026-03-20 15:56:46 +08:00
cptbtptpbcptdtptp
31089dc0a6 Merge remote-tracking branch 'origin/main' into feat/MCode 2026-03-20 15:50:21 +08:00
AZhan
d79647a9ae fix: text dirty flag set error (#2931) 2026-03-20 15:36:57 +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 v2.0.0-alpha.18 2026-03-19 17:46:36 +08:00