Commit Graph

561 Commits

Author SHA1 Message Date
chenmo.gl
5ffb3f22df refactor(shader-lab): model generic type families as first-class data
Replace the ad-hoc `resolveGenericReturnType` switch with an explicit
data-driven generic family system. Each family (GenType, GVec4,
GSampler2D, ...) declares its members and the dimension it varies along
(Size / Prefix); overload resolution locks an index per dimension while
walking arguments and projects return families through that lock.

This fixes the underlying defect that produced the texture/textureCube
bugs: the previous algorithm assumed "return family == parameter family"
and collapsed `GVec4 <- GSampler2D` to `SAMPLER2D`. Cross-family
projection (sampler → gvec4) is now a native operation, so the
textureCube/textureCubeLod/texture2D/texture2DLod overloads that the
initial fix listed as concrete-only entries can be written as plain
generic signatures again.

Return type falls through as `TypeAny` when no argument locks the
dimension (all args are TypeAny), preserving wildcard-compatible
overload resolution downstream.

Also exercises the Verbose semantic pass in the two new test shaders —
the initial fix registered them under Release only, which skips
semantic analysis and therefore could not catch the bug it was meant
to prevent.
2026-04-20 16:23:14 +08:00
chenmo.gl
91ec10a417 Merge remote-tracking branch 'origin/dev/2.0' into fix/shaderlab-texture-generic-return
# Conflicts:
#	tests/src/shader-lab/ShaderLab.test.ts
2026-04-20 15:47:30 +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
shensi.zxd
f43bdea8e9 test(shader-lab): add regression test for logical NOT on numeric operands in preprocessor
Covers #if !0, #if !1, and compound expressions like #if FOO != 4 && (!0 || FOO).
2026-04-15 19:03:33 +08:00
shensi.zxd
c333465b28 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-04-15 18:29:21 +08:00
shensi.zxd
a2d384d6a2 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-04-15 18:28:04 +08:00
shensi.zxd
3ba093e353 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-04-15 18:28:03 +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