181 Commits

Author SHA1 Message Date
hyde zhou 6ccf1cf9a8 Reapply "Feat/plugin support, allow third_party feat(spine) to create plugin f…" (#403) (#424)
This reverts commit 5bcfb9fa04.
2026-11-16 16:33:05 +08:00
hyde zhou 5bcfb9fa04 Revert "Feat/plugin support, allow third_party feat(spine) to create plugin f…" (#403)
This reverts commit a56706c9ad.
2026-11-10 17:04:32 +08:00
Tianze-Chen a56706c9ad Feat/plugin support, allow third_party feat(spine) to create plugin for creator. (#306)
* Add UIMesh component for custom 2D mesh rendering

- Add UIMesh component consuming pre-baked vertex/index/segment data, enabling custom renderers (e.g. spine plugin) to batch through the 2D batcher.
- Export UIMesh from the 2d components index.
- Validate setMeshData input at the boundary (stride, buffer lengths, index values, segment ranges, accessor caps) via engine-standard errorIDs 9010-9017, documented in EngineErrorMap.md.
- Expose StaticVBAccessor per-chunk caps as maxVertexCount/maxIndexCount getters and clamp the 10% reserve to them, so meshes that fit (e.g. 30000 vertices) allocate instead of silently failing.
- Add tests/ui/ui-mesh.test.ts covering the 32767 cap boundary, setMeshData validation, and accessor lifetime.

Also takes over node transform and cascaded opacity: vertices are now always
node-local — UIMesh applies the node's world matrix (unbatched via the
per-draw GPU transform the 2D batcher already maintains for middleware,
batched by baking into the shared chunk copy so draws still merge) and folds
the cascaded UIOpacity into the copied vertex colors itself. The legacy
switches (USE_LOCAL / useLocalData / RenderEntity.setUseLocal) are all derived
internally; consumers never touch them. A JSB staleness poll re-prepares the
native draw infos in the same frame on transform/opacity changes, and a
premultipliedAlpha format declaration drives the opacity fold and the builtin
material's blend factors.

Follow-ups folded in: the opacity fold reads the light color at byte offset 20
(the pos*3f + uv*2f header is 20 bytes), not 16; and UIMesh notifies data
producers through the new onPremultipliedAlphaChanged() hook so subclasses
(e.g. the spine plugin) forward the declared format to their baker instead of
redeclaring the field.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* Disable built-in spine by default; minor editor/build fixes

- Default the built-in Spine feature (spine-3.8) to off in feature cropping, so it is only included when enabled in the editor.
- Recognize scale as a valid spine atlas page attribute in the texture inspector.
- Skip incomplete platform dirs when bundling runtime adapters.

Co-Authored-By: Claude <noreply@anthropic.com>
(cherry picked from commit 7f7922aaf42ff1857f0a6d38970a75d303032f57)

* Export WebAssembly interface under cc.wasm namespace

- Add exports/webassembly.ts re-exporting pal/wasm (instantiateWasm, fetchBuffer, fetchUrl, ensureWasmModuleReady) as the public cc.wasm namespace, so extensions/game code can load their own .wasm files through the engine's platform-adaptive path.
- Expose it as a croppable feature rather than an unconditional export from exports/base.ts: cc.config.json declares a `webassembly` feature and editor/engine-features/render-config.json adds the panel entry (default on, required), so it appears under Project Settings -> Feature Cropping. The label/description are plain text on purpose — i18n:ENGINE.* keys live in the editor package and a custom engine cannot add them.

(cherry picked from commit 92003ab4a21b6ee753cf3ba2ca0f4767658e9cdc)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat(simulator): generic native plugin discovery opt-in

The generic plugin discovery chain (cc_gen_plugin_cmake_hook ->
plugins_parser.js -> Pre-AutoLoadPlulgins.cmake -> find_package ->
plugin_registry) already exists and is what native device builds use; the
simulator never invoked it. Wire it in behind an opt-in cache variable, with
no plugin names or plugin logic in the engine — the plugin set is always just
the scan result:

- templates/cmake/common.cmake: cc_gen_plugin_cmake_hook()'s scan roots
  (CC_PLUGIN_PATH) may now be pre-set by the caller; the native-build
  project-layout defaults are unchanged when nobody pre-defines it
- simulator runtime-src CMakeLists.txt: -DSIMULATOR_PLUGIN_SCAN_DIRS="<dir>
  [;<dir>]" scans those roots for cc_plugin.json through the same chain as
  device builds (CC_PROJECT_DIR points into the build tree so the generated
  hook lands there, satisfying the parser's output-dir invariant); unset
  keeps the stock plugin-less simulator, and a cache variable means plain
  `cmake --build` reuses the configured scan
- simulator Game.cpp: call cc_load_all_plugins() after init, mirroring
  BaseGame::init(), so registered plugins' JSB bindings exist before any
  script runs (no-op when no plugins are linked)
- libsimulator protobuf config.h: skip the <hash_map>/<hash_set> defines on
  MSVC >= 1950 (headers removed); stubs fall back to the std::map emulation
  path

Verified end-to-end: a project extensions/ tree scanned at configure time
produces a simulator exe whose plugins register their JSB bindings at startup
(observed live in the simulator's JS context).

Co-Authored-By: Claude Code <noreply@anthropic.com>

---------

Co-authored-by: Developer <developer@cocos.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Engineer <engineer@cocos.com>
2026-11-04 16:41:54 +08:00
llsansun 2157fd176d Multithreading (#322)
* worker pool

* opt

* backup

* worker and worker backend

* worker fallback

* opt

* opt

* remove meta

* opt

* worker export

* testcase fix

* worker js template

* worker pal

* worker opt

* test

* Replace error messages with error codes

* Package size reduction

* Package size reduction

* revert

* Restore editor asset .meta files to the base branch state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HAtWwr4dy5azfpccweh1g

* bugfix

* Split into two features: Worker and Worker Pool

* worker option

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 16:35:14 +08:00
ChiaNing f570c1f02d feat(screen): configure Web DPR through startup settings (#367)
* feat(pal): declare startup maximum DPR configuration

Add an optional maximum DPR to screen initialization and readonly access to
the original DPR and explicitly configured cap. An omitted or null cap retains
the platform's existing policy.

This is the engine type contract for the staged PAL implementation. Public
Screen configuration methods and Native render-target integration remain
separate work; this commit does not change runtime rendering.

Validated against the PAL engine/four-platform contract check and full npm test
(65 source tests, 4 build tests, release/debug module validation).

* feat(screen): expose startup maximum DPR configuration

Allow applications to set, reset and read a pending maximum DPR before Screen
initialization while preserving platform defaults when unconfigured. Lock the
configuration at initialization and reject unsupported PAL implementations or
options that PAL silently ignores.

Add startup validation and compatibility tests. Only implementation and tests
are included; local documentation and generated validation artifacts remain
outside this commit.

Companion PAL commit: 2959778b7acf83dd84e3aab5957d60d80e20c461.
Native render-target integration, device acceptance, runtime changes and editor
configuration remain separate work.

Validation recorded on 2026-09-29: tsc --noEmit; 20 Screen and 6 View tests;
public declaration generation; real WebGL demo with simulated host DPR,
first-draw, input, reset, late-call rejection and resize checks. Screen source
SHA-256 still matches that verified build.

* fix(screen): restrict startup DPR configuration to Web

* fix(screen): ignore DPR cap calls on non-Web platforms

* fix(screen): preserve optional DPR types in native builds

* refactor(screen): configure Web DPR through startup settings

* refactor(screen): delegate DPR policy and validation to PAL

* style(screen): wrap fullscreen method signatures

* perf(screen): simplify startup DPR null checks

* version update
2026-10-22 19:15:17 +08:00
zxx43 69d3d6033a fix message error (#304) 2026-08-24 11:13:30 +08:00
zxx43 d2713fe00e fix loop duration time (#213) 2026-07-31 16:39:08 +08:00
昌敦伟 26b07b91b5 When enabling the “USE INSTANCING” option, add a warning that using the AnimationController component may cause issues. (#18827) 2025-07-28 14:21:16 +08:00
James Chen afef795931 Add Sorting2D support. (#18643) 2025-04-22 14:28:55 +08:00
bofeng-song b2316fc02f Support spine version 4.2 (#18325) 2025-02-26 18:56:42 +08:00
James Chen cf945088ca Add more feature cropping settings for RichText, Mask, Graphics, UISkew, AffineTransform. (#18284)
* Add more feature cropping settings for RichText, Mask, Graphics, UISkew, AffineTransform.
2025-02-10 11:40:01 +08:00
James Chen c08dbf5c68 Optimize code size again. (#18260)
* Optimize code size again.
2025-02-05 15:35:40 +08:00
James Chen 18d80116b5 Fix some type issues in tilemap module (#18255) 2025-02-05 14:41:34 +08:00
James Chen ad210c1ee8 Optimize code size for minigame adapter. (#18237) 2025-01-23 10:41:19 +08:00
James Chen 37e1dcc4bd [v3.8.6] Optimize code size: audio (#18198)
* [v3.8.6] Optimize code size: mangle AudioBufferManager since it's not exported.
2025-01-16 10:15:48 +08:00
James Chen e939677d42 [v3.8.6] Optimize code size, box2d-js backend. (#18167) 2025-01-13 11:07:03 +08:00
James Chen b7835fcb03 [v3.8.6 ]Fix type issues for physics-2d framework. (#18171) 2025-01-13 11:05:55 +08:00
James Chen 21e6d0c47e fixed #17833: [v3.8.5] Add an ability to load wasm/asmjs module manually (#17844) 2024-11-13 17:17:38 +08:00
James Chen 4ec6b5c9e1 [v3.8.5] Fix geomertry-renderer test case for native platforms (#17747)
* [v3.8.5] Fix geomertry-renderer test case for native platforms

* Remove unused import

* Fix errors in spline.ts

* Update spline.ts, use internal assertsArrayIndex

* Update Spline.getPoint
2024-10-21 13:33:42 +08:00
hyde zhou 4685f6879a filter non default pass (#17729) 2024-10-17 10:00:47 +08:00
James Chen f4ccf3a8bb [v3.8.5] Support inline enum and mangle private variables to reduce engine size. (#17703) 2024-10-15 10:17:16 +08:00
James Chen 6800bc9ba8 Remove unused code in gfx/base, gfx/webgl, gfx/webgl2 modules and mangle properties to reduce js size. (#17529) 2024-10-10 13:53:25 +08:00
James Chen 32727868b0 Reduce the generated javascript code size (#17491) 2024-08-06 18:14:44 +08:00
hyde zhou 8106f8677d add legacy-pipeline culling (#17260) 2024-07-29 16:45:31 +08:00
hyde zhou be8df4e59d Add custom pipeline config. (#17390) 2024-07-19 09:47:28 +08:00
hyde zhou 77090b83ee Improve error reporting (#17236) 2024-06-27 15:27:09 +08:00
minggo 6c8d39e735 Fix typo (#16626)
* fix: correct spelling errors in EngineErrorMap.md

* fix: correct typo in code literals in DebugInfos.cpp

---------

Co-authored-by: Ryuu <2357622935@qq.com>
2023-12-19 15:53:41 +08:00
PP 7a8bde3ace fix: load script packages before loading builtin assets (#16339)
* fix: load script packages before loading builtin assets

* fix eslint

* fix ci

* Revert "fix ci"

This reverts commit 38584722e93c5823684be31dbb796bb3908b4703.

* add errorID logID
2023-10-08 10:47:56 +08:00
Yiwen bde3cd4cc3 Add adv mesh functionalities. (#16009)
* stage

* update

* update

* fix physics & ray cast problem

* fix default value, clean unused code, fix lint errors

* clean code

* update meta file

* update external, license

* fix tidy, circular dep

* fix type cast

* rm unit test

* fix unit test

* update comment
2023-08-21 10:15:24 +08:00
pandamicro 9b08b34a2b Replace Renderer setMaterial with setSharedMaterial (#15980)
* Replace Renderer setMaterial with setSharedMaterial

* Fix all usage of Renderer.setMaterial

* Soft deprecate Renderer.setMaterial

* Remove unnecessary change
2023-08-17 13:15:21 +08:00
Canvas 1a8b9cbdd3 fix cache mode spine animation playback issue. (#15691)
* fixed cache mode spine animation playback issue.

* remove unused code.

* fix code formatting.

* fix code formatting.

* fix editor changing animation node position doesn't refresh rendering when enable batch.

* add spine error id 7511 'Invalid input'. & fix deprecated to engineInternal. & change _uuid to uuid.

* remove invalid code & fix error map code format. & replace any to interface.

* fix setSkin invalidation on cached mode.

* remove unneeded descriptions.

* fix frame = 1 to length - 1.

* fix code format.

* revert update skeleton data on setSkin.
2023-07-13 13:46:53 +08:00
PP c03d4277f2 add CULL_ASM_JS_MODULE constant (#15467)
* add CULL_ASM_JS_MODULE constant
2023-06-19 14:59:54 +08:00
hyde zhou e06bb6cdb4 [V3.8.0 pipeline] add deferred pipeline (#15452) 2023-06-16 17:35:18 +08:00
Yiwen 0a346b2fdd fix bufferview size limit (#15265)
* fix bufferview size limit

* update

* update

* update error msg

* [fix] add boundary to avoid physx assert error (#15321)

* change validation method
2023-06-07 23:01:01 +08:00
troublemaker52025 07f3dedad9 Optimize skin with post-process pipeline (#15189) 2023-06-01 18:44:48 +08:00
pandamicro 12fe7525f9 Merge pull request #15113 from cocos/develop
Merge remote-tracking branch 'upstream/develop' into marionette-next
2023-05-19 10:42:41 +08:00
Yiwen 78c87a09d2 add new features to 3d hinge constraint (#14447)
* add new features to 3d hinge constraint
1. angular limit
2. angular drive

* add missing file

* fix native and bullet parameter error, tune parameters

* clean code

* update package and package lock

* stage

* update

* fix interface

* fix api, improve perf

* fix unit conversion

* fix unit conversion

* sync physx behavior
2023-05-18 16:36:23 +08:00
Leslie Leigh 464342eb99 Merge remote-tracking branch 'upstream/develop' into marionette-next 2023-05-18 14:46:30 +08:00
Ling Zhan 1032bd9508 Sweep Test (#15068)
* init

# Conflicts:
#	cocos/physics/physx/physx-adapter.ts

# Conflicts:
#	cocos/physics/physx/physx-adapter.ts

* init sweepBoxClosest

# Conflicts:
#	cocos/physics/physx/physx-world.ts

* back

* physx boxCastClosest works now.

* add physx sweepAll

* init bullet sweepBoxClosest. not test yet

* add bullet sweepBox

* bullet add internal functions: sweep/sweepClosest

* init physx c++ sweepBox/sweepBoxClosest

* add sweepSphere, sweepCapsule; add unit test.

* add sweep api doc

* revert physx asm/wasm loading func

* tweaks

* add error log for builtin and cannon.js

* builtin and cannon.js use warnid when calling sweep

* tweak api doc
2023-05-17 18:37:03 +08:00
minggo 3a6e0ca2ba Merge pull request #15067 from cocos/develop
Merge develop into marionette-next
2023-05-17 14:06:57 +08:00
Leslie Leigh (李的序) b119ee5bcf Optimize warn message if state machine matched too many transitions in a frame (#15016) 2023-05-10 14:22:31 +08:00
pandamicro 71a11a7a14 Merge remote-tracking branch 'origin/v3.7.3' into develop
# Conflicts:
#	.github/workflows/run_test_cases.yml
#	cocos/rendering/planar-shadow-queue.ts
#	native/cocos/renderer/pipeline/PlanarShadowQueue.cpp
2023-05-08 11:55:56 +08:00
Leslie Leigh (李的序) 4a183b14c0 Fix exception in material uniform animation binding (#14764) 2023-04-28 09:22:37 +08:00
Yiwen 3713957624 collider constraint (#14068)
* collider constraint

* rm uncessary function import

* bullet doesn't prevent dynamic rigid body using simplex collider

* convex mesh with dynamic rigid body is allowed

* clear useless imports
2023-04-20 14:32:48 +08:00
PP fa51b804b5 remove and ban @ts-expect-error (#14572)
* remove ts-expect-error usage in engine

* deprecate Scheduler interface

* remove JavaScriptCore

* set some engineInternal public property as getter setter

* fix build-declaration

* fix releaseManager export name conflict

* update scriptEngineType

* fix and update some comment

* remove  w_mat, w_pos, w_rot, w_scale

* update renderer

* fix setRootBufferDirty not binding on native

* optimize floatToHashString

* mark NOTE
2023-03-20 13:48:26 +08:00
徐兵 878b7db4a5 optimize reflection probe (#14115) 2023-02-03 15:43:04 +08:00
ChiaNing 221c37a275 Protect scroll bar error when its deleted (#14041)
* Protect scroll bar error when its deleted

* change to is Valid
2023-02-01 17:38:53 +08:00
pandamicro 08c7fe3956 Add pre type validator for setUniform (#13462) 2022-11-23 15:26:16 +08:00
santy-wang 91c884362d Merge branch 'v3.6.2' of github.com:cocos-creator/engine into v3.6.1-sync 2022-10-11 20:12:14 +08:00
jk20012001 25c4949ce5 [fix] camera clear flag is skybox but skybox is disabled #13589 (#12964) 2022-10-11 18:56:55 +08:00