Commit Graph

562 Commits

Author SHA1 Message Date
cptbtptpbcptdtptp
5d7e6af705 Merge remote-tracking branch 'origin/fix/shaderlab' into fix/shaderlab 2026-04-15 19:38:54 +08:00
cptbtptpbcptdtptp
f5be42400b fix: raycast and clone 2026-04-15 19:38:17 +08:00
luzhuang
069f182a86 fix(loader): normalize gltf wrapper and skin roots 2026-04-15 17:39:05 +08:00
luzhuang
b3bf58a816 Revert "fix(loader): restore single-root GLTF scene without GLTF_ROOT wrapper"
This reverts commit 8a86f279eca9b2bc4a2fa56f94f174236f9a5674.
2026-04-15 17:39:04 +08:00
luzhuang
5abb3f5f02 fix(loader): restore single-root GLTF scene without GLTF_ROOT wrapper
Single-root GLTF scenes no longer wrap the root node in a GLTF_ROOT
container, which avoids redundant nesting and fixes animation path
resolution for models like Mixamo characters.

- GLTFSceneParser: single-root scenes use the node directly as scene root
- GLTFAnimationParser: remove single-root path prefixing (no longer needed)
- Entity.findByPath: prefer real same-name child over legacy self-name prefix
- Add AGENTS.md to .gitignore
2026-04-15 17:39:03 +08:00
luzhuang
3071f908c8 fix(loader): always create GLTF_ROOT container for consistent animation paths (#2942)
Remove single-root vs multi-root branching in GLTFSceneParser, always
creating a GLTF_ROOT wrapper entity. This ensures animation bone paths
are consistent across different glTF files, fixing cross-file animation
clip retargeting.
2026-04-15 17:39:01 +08:00
cptbtptpbcptdtptp
40006d952f fix: raycast collider layer 2026-04-15 16:37:08 +08:00
cptbtptpbcptdtptp
ca5252a9a8 feat: supported filled 2026-04-07 16:21:59 +08:00
luzhuang
d9a267477d fix(animation): normalize single-root clip binding paths 2026-03-29 20:56:45 +08:00
cptbtptpbcptdtptp
63dff37450 test(camera): add unit test for invViewProjMat scale consistency
Verify that screenPointToRay and viewport-world round-trip produce
correct results when the camera inherits non-identity scale from a
parent entity. Without the fix, the round-trip deviates by the
inherited scale factor (e.g. 105 -> 107.5 at scale 1.5).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 14:39:06 +08:00
shensi.zxd
3cf18831d4 fix(shader-lab): allow logical NOT operator on numeric operands in preprocessor
#if !0 and similar expressions now work correctly, matching C/GLSL preprocessor behavior.
2026-03-27 17:55:51 +08:00
shensi.zxd
bfe4e9ea23 fix(shader-lab): add missing semicolon in GLES100 fragment return conversion
GLES100 visitJumpStatement converted `return expr;` to `gl_FragColor = expr`
without a trailing semicolon, causing WebGL compilation errors. Only triggered
when fragment entry returns vec4 (Cocos pattern), not void (standard Galacean).
2026-03-27 01:06:15 +08:00
shensi.zxd
80e6e3ebb3 fix(shader-lab): handle global struct-typed variables and simplify macro scanning
- Suppress `uniform` output for global struct-typed variables (e.g. `Varyings o;`)
- Register global struct vars in both per-function and cross-stage maps
- Unify macro member access scanning into callback-based _forEachMacroMemberAccess
- Add registerStructVar() encapsulation in VisitorContext
- Add Cocos VSOutput pattern test (global-varying-var)
2026-03-27 00:33:21 +08:00
shensi.zxd
7b18aef47c test(shader-lab): add Cocos FSInput pattern test for member access macro as builtin arg 2026-03-26 23:23:00 +08:00
shensi.zxd
d05187b7fc fix(shader-lab): support global #define with cross-stage struct var transform
Build a combined _globalStructVarMap in visitShaderProgram by scanning
both vertex and fragment entry functions, so global #define values like
`attr.POSITION` or `o.v_uv` are correctly transformed in all stages.

Rewrite define-struct-access tests to use snapshot file comparison
against expected/ GLSL outputs for clearer verification.
2026-03-26 23:13:18 +08:00
shensi.zxd
60480bbfb4 test(shader-lab): enrich define-struct-access tests with usage assertions
Add assertions for macro usage in expressions (not just #define transformation):
- Macro as RHS in multiplication, as LHS in assignment
- Macro as function argument in dot(), texture2D()
- Multiple varying properties (v_uv, v_normal) referenced via #define
2026-03-26 23:13:17 +08:00
shensi.zxd
a0e6fc8f4e test(shader-lab): add transformation result assertions for define-struct-access
Verify the actual CodeGen output instead of just checking GLSL compilation:
- #define values with struct member access are correctly transformed
- varying/attribute declarations are emitted for referenced properties
2026-03-26 23:13:17 +08:00
shensi.zxd
2f6712a1d9 fix(shader-lab): transform struct member access in #define values during CodeGen
When #define values contain struct member access like `o.v_uv` (where `o` is
a Varyings/Attributes/MRT struct variable), the CodeGen now correctly transforms
them to just the property name (e.g. `v_uv`), matching the behavior of direct
struct member access in regular code. Closes #2944.
2026-03-26 23:13:17 +08:00
shensi.zxd
4b3d632159 fix(shader-lab): return TypeAny for unresolved generic builtin return type
When a builtin generic function (e.g. normalize) receives TypeAny args,
resolvedReturnType stays TypeAny. Previously the else branch returned
the raw EGenType enum value (200), which is neither a concrete type nor
a wildcard, causing downstream user-function overload matching to fail.
2026-03-26 23:13:16 +08:00
shensi.zxd
2d2512940c fix(shader-lab): simplify resolveGenericReturnType, fix textureCube/texture2DLod signatures
- Simplify resolveGenericReturnType: remove genericParamType param, only
  check if return type is GVec4
- Fix textureCube/textureCubeLod return type: SAMPLER_CUBE → VEC4
- Add missing texture2DLod builtin function registration
- Add texture2DLod test cases to texture-generic.shader
2026-03-26 23:13:16 +08:00
shensi.zxd
889b096121 fix(shader-lab): resolve GVec4 generic return type for texture() builtin functions
texture(sampler2D, vec2) returns GVec4 which was incorrectly resolved to
the sampler type instead of vec4, causing "No overload function type found"
when passing the result to user-defined functions like decode32(vec4).

Add resolveGenericReturnType() to correctly map GSampler* → GVec4:
  sampler2D/sampler3D/samplerCube → vec4
  isampler2D/isampler3D/...       → ivec4
  usampler2D/usampler3D/...       → uvec4
2026-03-26 23:13:16 +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