22583 Commits

Author SHA1 Message Date
zxx43 b01aabdf57 add .meta for particle_normal.chunk (#436) 2026-11-19 11:14:12 +08:00
ChiaNing 7995924100 fix(2d): preserve simple font aliases in canvas descriptors (#428)
* fix(2d): preserve simple font aliases in canvas descriptors

Use bare identifiers for simple generated _LABEL aliases in Label rendering and Web font loading. Keep quoting and escaping complex family names, and preserve system font expressions.

* test(2d): cover font aliases from Web registration to Label descriptors
2026-11-18 18:37:21 +08:00
ChiaNing af2b9e9ed9 fix(2d): apply cascaded opacity to retained Graphics draws (#421)
* fix(2d): apply cascaded opacity to retained Graphics draws

Use the per-instance Graphics effect on Web and Native so a parent fade scales the original fill and stroke alpha at draw time. Rebind retained geometry when its material changes and synchronize Graphics color on enable or assignment. Covers the Graphics behavior reported in #14868 and #17917.

* fix(2d): apply Graphics cascade opacity to CPU vertex colors

* fix(2d): preserve wide strokes and reuse Graphics opacity buffers

Reserve stroke vertices using the emitted caps and joins and split at independent subpath boundaries. Reuse Web upload storage across immediate redraws and use the shared draw-info dirty bit to synchronize only changed Native geometry blocks. Release empty caches on the subsequent renderer update or disable.

* fix(2d): handle passless Graphics materials and release empty paint buffers

* fix(2d): scope Graphics opacity updates and trim unused buffers

* fix(2d): limit the Graphics change to cascaded opacity

* fix(2d): preserve Graphics.color behavior during parent opacity fades

* fix(2d): use emitted Graphics counts for native opacity uploads
2026-11-18 18:30:48 +08:00
Ming 229ad74757 Fix/rendering/per pass ubo upload (#432)
* fix(rendering): track UBO upload state per buffer and isolate layout UBO state

* fix(rendering): deduplicate bound UBO buffers and release on pipeline destroy

* refactor(rendering): simplify per-pass UBO helpers and reduce bundle size

---------

Co-authored-by: vanitynie <vanitynie@qq.com>
2026-11-18 18:12:23 +08:00
yangchao 5313b86ed1 feat: expose screen keep-on control (#413) 2026-11-18 17:28:15 +08:00
zxx43 7fb5ae075b Particle normal map (#418)
* add particle normal map support

* add meta file

* fix shader error

* add render pass

* remove warn when set particle texture

* fix shader define bug

* revert default material

* revert material

* do not need new material

* do not add new effect

* revert chunk

* rename ApplyParticleNormalLighting function

* fix switch render mode bug
2026-11-18 12:31:21 +08:00
Cocos Robot 1b0455e10e Merge pull request #426 from cocos-robot/t/bot/genbindings-714bd9d
[ci skip][AUTO]: Automated PR to generate code
2026-11-16 16:59:23 +08:00
hyde zhou 714bd9d3e2 Merge pull request #422 from cocos/v4.0.0-beta.2
fix(input): restore mouse-to-touch simulation in Game View (#419)
2026-11-16 16:49:39 +08:00
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
Cocos Robot 1df519e248 [ci skip][AUTO]: Automated clang-format update: 81c80668ca (#417) (#423)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
2026-11-16 16:30:33 +08:00
hyde zhou aaa3a9168b add CUSTOM residency type (#417)
* add CUSTOM residency type

* revert settings
2026-11-16 12:08:06 +08:00
qiuguohua 178b9edca9 fix(input): restore mouse-to-touch simulation in Game View (#419) 4.0.0-beta.2 2026-11-13 16:19:26 +08:00
qiuguohua 8e62e7e044 fix(input): restore mouse-to-touch simulation in Game View (#416) 2026-11-13 15:12:42 +08:00
Tianze-Chen 62bd937e7e fix(ui): convert viewport sizes with the exact scale ratio (#405)
`View.setDesignResolutionSize` regenerated the visible size with
`viewport / scale`. Because `scale` is itself the rounded `container / design`
quotient, that round trip loses one ULP: a 1080x1920 design on a 1532x1532
viewport produces `1919.9999999999998` instead of `1920`.

Those values are written by `Widget` into `UITransform._contentSize` and
`Node._lpos`, and by `Canvas` into `Camera._orthoHeight`, so the error ends up
in the saved `.scene`/`.prefab` files and makes the editor produce diff churn
whenever it recomputes the layout.

A resolution policy now reports the pair of lengths its scale was derived from
(`pixels`: the container length in device pixels, `units`: the same length in
UI units) instead of the rounded scale, and the viewport is converted with
those two lengths. EXACT_FIT, SHOW_ALL, NO_BORDER, FIXED_HEIGHT and FIXED_WIDTH
all report their pair in place.

The scale is no longer stored anywhere: `AdaptResult` carries `ratioX` /
`ratioY` only, and `getScaleX()` / `getScaleY()` derive `pixels / units` on
demand, so the ratio and the scale cannot diverge.

`toUISpace()` / `toPixelSpace()` are exported next to `ScaleRatio`, and
`View.getRatioX()` / `View.getRatioY()` expose the pair, so any caller can
convert lengths without the lossy `pixels / scale` round trip.

The camera still frames the whole window (`windowSize.height / scaleY / 2`),
but now converts through `toUISpace(size.height, view.getRatioY())`, so a
1532px tall viewport produces exactly 960 instead of 959.9999999999999. No
adaptation, layout or rendering semantics change.

Note for custom resolution policies: `AdaptResult` no longer carries `scale`.
A custom content strategy has to report `ratioX` / `ratioY`; when it does not,
the ratios of the previous policy application are kept and the scale is not
updated. `AdaptResult` and `ContentStrategy` are engine-private classes, so
this only affects strategies passed to `new ResolutionPolicy(...)`.

Co-authored-by: Tianze-Chen <tianze@local>
2026-11-13 11:00:11 +08:00
qiuguohua 990e3b09aa fix: handle oversized native callback arguments (#409) 2026-11-12 10:49:03 +08:00
llsansun 111fe1755d Origin/bugfix (#408)
* The final `set skeleton` call destroys and rebuilds the GPU bone resources that were bound in the previous two steps. However, the descriptor set is not rebound. As a result, the draw call for this subModel cannot access the bone matrices, so the entire character fails to render (this is not vertex deformation; the character does not appear at all). The fix should replace the reference in `descriptor.buffer` with the new buffer, mark it dirty, and lazily rebuild the descriptor before the next draw.

* opt

* fix: retain negative scale signs in Node.setWorldScale

* test: retain negative scale signs in Node.setWorldScale

* fix
2026-11-12 09:48:55 +08:00
zxx43 4a0dbc977a fix get angle problem (#399)
* fix get angle problem

* fix eslint

* use new function to get angle

* fix eslint error
2026-11-11 16:04:02 +08:00
zxx43 7037052b40 optimize trail (#402)
* optimize trail

* do not create at runtime

* do not draw if resize failed
2026-11-11 14:17:28 +08:00
Ming e78ad4d759 fix(rendering): 修复 addShadingRateTexture 重复注册时的无限递归 (#406)
同名资源已存在时调用 updateShadingRateTexture 更新尺寸,保留资源 ID 和资源数量。

Co-authored-by: vanitynie <vanitynie@qq.com>
2026-11-10 18:43:19 +08:00
hyde zhou 25026f9edd bump version to 4.0.0-beta.2 (#404) 2026-11-10 17:16:48 +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
Cocos Robot 022be418f9 [ci skip][AUTO]: Automated clang-format update: 9d12fd846b (#390) (#392)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
2026-11-04 15:05:56 +08:00
Zachary Alexander 86fe5f41cd ci: run the native Linux, OpenHarmony and ClangTidy jobs on ubuntu-24.04 (#398)
ubuntu-latest is moving to Ubuntu 26.04, and three native jobs fail
there for reasons outside the engine change under test: GCC 15 no
longer pulls <cstdint> and <algorithm> into EventBus.h/.cpp, 7-Zip 26
refuses the OH SDK archive's relative symlinks, and python3.8 from the
deadsnakes PPA has no candidate for the runner's amd64v3 apt index.
Run those three jobs on ubuntu-24.04, where all three passed on
2026-10-28. The Android, Windows, macOS and iOS jobs are unchanged.
2026-11-04 11:02:54 +08:00
zxx43 a69be8d0a7 add AlignToDirection implement (#394)
* add AlignToDirection implement

* fix eslint

* fix max line error

* fix ParticleSpace world condition
2026-11-03 11:45:39 +08:00
llsansun b9f9e95b9b up (#395) 4.0.0-beta.1 2026-11-02 14:45:04 +08:00
Cocos Robot 7ef2d0a772 [ci skip][AUTO]: Automated code generating update: 9031c05b96 (#389) (#390)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
2026-10-30 19:31:26 +08:00
Cocos Robot fcdc4333b7 [ci skip][AUTO]: Automated code generating update: 926ed1a9ad (#322) (#388)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
2026-10-30 19:30:36 +08:00
Ming 60a24625b2 fix(webgl): sync buffer size with actual GL BUFFER_SIZE on resize (#389)
* fix(webgl): sync buffer size with actual GL BUFFER_SIZE on resize

* fix(webgl): move buffer update size check to CmdFuncUpdateBuffer

* fix(webgl): add buffer resize failure warning and fallback strategy

* fix(2d): guard MeshBuffer upload and IA draw when buffer resize fails

* fix(gfx): update EmptyBuffer size on resize for unit tests

---------

Co-authored-by: vanitynie <vanitynie@qq.com>
2026-10-30 17:39:22 +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
MagicX 5e627951a0 fix(render-texture): use GPU max texture size instead of 2048. (#385)
* Changed the GeometryRenderer and DebugRenderer from using intrusive calls to registering callbacks (custom pipeline).

* Changed the GeometryRenderer and DebugRenderer from using intrusive calls to registering callbacks. (old pipeline)

* CI error: Function parameter names cannot be omitted.

* Move the devil string to macro

* fix(mesh): hoose index format by max index value in createMesh

* perf(pipeline): reduce render queue sort to two packed key compares (native platform).

* fix CI error caused by native/cocos/base/Utils.h

* fix(scene): LOD screen usage distance truncated to int (native platform)

* fix: prevent accessor recursion in SkinnedMeshBatchRenderer.

* fix: destroy index buffer in MeshRenderData.clear() to prevent GPU leak.

* fix: use GPU max texture size for render texture resizing.
2026-10-28 18:00:11 +08:00
ChiaNing 2c632d6dd6 fix(2d): serialize custom font families and restore native font aliases (#382)
* refactor(2d): share font family and descriptor helpers

Extract the existing TTF and CHAR font family selection and font description
construction into shared helpers. Preserve raw family values, the Arial
fallback, and the existing size and style formatting.

* fix(2d): serialize custom font families at CSS boundaries

Quote and escape raw custom font names before Canvas and DOM consumption,
while preserving system family expressions. Keep Web-loaded aliases raw
and share the serialized expression across registration and loading.

Carry CssFontFamily through Label consumers and cover serialization,
TTF/CHAR selection, EditBox styles, and Web FontFaceSet loading in tests.

* fix(2d): preserve font names during scaling and refresh load metrics

Build CHAR draw descriptors from the scaled size and serialized family,
so unit-like substrings in font names are not rewritten by scaling.

Set the font before baseline measurement and read live Canvas metrics
during Web font polling instead of reusing cached fallback widths.
Add regression tests for the actual CHAR draw path and load completion.

* refactor(native): extract canvas font parsing

Move the existing platform-specific parsing into an internal helper and
return the family, size, and style flags to CanvasRenderingContext2D.
Preserve the existing matching rules, conversions, fallbacks, and update order.

Validated 12,650 comparisons with the original setFont implementation
across five platform macro variants.

* fix(native): restore serialized font aliases within legacy policy

Decode a single quoted CSS family into the descriptor used before TS
serialization. Adopt the result only when the existing platform parser
recognizes the complete registered alias; retain legacy fallbacks otherwise.

Cover existing aliases, escaped encodings, platform name restrictions,
style and size policies, and malformed inputs without expanding font support.

* fix(native): preserve size when a quoted font name falls back

Keep a valid requested px size when a well-formed quoted font family is
rejected on Apple or QNX, while retaining the existing fallback font and
style flags. Leave malformed prefixes, lists, and unsafe sizes unchanged.

Preserve the existing size conversion on other native platforms.

* fix(2d): resolve font family types in bundled declarations

* test(2d): cover explicit native font alias compatibility

* fix(2d): resolve font CI lint diagnostics

Allow implicit move of the native font parsing result and wrap EditBox placeholder CSS without changing its output.

Validation: targeted clang-tidy check, ESLint with zero warnings, 13 native parser tests, and 2062 font policy comparisons.
2026-10-27 10:06:11 +08:00
qiuguohua 4f6479f083 fix(input): avoid duplicate WeChat touch events (#381)
* fix(input): avoid duplicate WeChat touch events

* update pal version

* update pal version
2026-10-23 19:11:29 +08:00
Cocos Robot 142c7ec6aa [ci skip][AUTO]: Automated code generating update: c6af33ac9d (#373) (#378)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
2026-10-23 15:10:26 +08:00
MagicX 7302715a18 fix: destroy index buffer in MeshRenderData.clear() to prevent GPU leak. (#379)
* Changed the GeometryRenderer and DebugRenderer from using intrusive calls to registering callbacks (custom pipeline).

* Changed the GeometryRenderer and DebugRenderer from using intrusive calls to registering callbacks. (old pipeline)

* CI error: Function parameter names cannot be omitted.

* Move the devil string to macro

* fix(mesh): hoose index format by max index value in createMesh

* perf(pipeline): reduce render queue sort to two packed key compares (native platform).

* fix CI error caused by native/cocos/base/Utils.h

* fix(scene): LOD screen usage distance truncated to int (native platform)

* fix: prevent accessor recursion in SkinnedMeshBatchRenderer.

* fix: destroy index buffer in MeshRenderData.clear() to prevent GPU leak.
2026-10-23 15:08:39 +08:00
Cocos Robot 5b0b4522c0 [ci skip][AUTO]: Automated code generating update: 363f009a13 (#367) (#375)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
2026-10-23 11:26:07 +08:00
Tianze-Chen a803406ef1 fix(2d): allocate Graphics GPU buffers on demand (#373)
Every Graphics sub-model pre-allocated a 65536-vertex / 131072-index buffer, which is about 2.25 MiB with the 32-byte graphics vertex, while a rect or ellipse mask only needs a few hundred bytes. The cost accumulates with every mask that draws its own geometry.

Allocate the buffers from the chunk data when the sub-model is created, grow them by powers of two when the geometry outgrows them, and never shrink, so a dynamic graphic no longer re-creates its GPU buffer every frame.

Keep the ceiling at the uint16 addressable limit of 65536 vertices. The assembler does not split a single fill()/stroke() batch, so a batch of exactly 65536 vertices has to fit; capping the buffer at 65535 would upload 32 bytes past its end.

UIModelProxy used to resize the buffers to the exact data size on every upload, which re-created them whenever the geometry changed, and on Metal/Vulkan the old buffer stays alive until the GPU is done with it. It now follows the same grow-only policy and passes the valid size to update() explicitly.

Refs: cocos/cocos4#371

Co-authored-by: Engineer <engineer@cocos.com>
2026-10-23 11:23:29 +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
Cocos Robot d0a696cfe6 [ci skip][AUTO]: Automated code generating update: 996f2fe20a (#369) (#370)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
4.0.0-beta.0
2026-10-19 14:31:30 +08:00
hyde zhou 1b3ad36e4b bump version to 4.0.0-beta.0 (#369) 2026-10-19 14:15:15 +08:00
llsansun ff0f46ff81 engine upgrade (#368) 4.0.0-alpha.36 2026-10-12 17:42:54 +08:00
yangchao 0616a948ef fix(audio): iterator invalidation、exit crash issue。 (#360)
* fix(audio): iterator invalidation when call stopall in finish callback

* fix(audio): prevent callback crashes and cache teardown hangs on Apple platforms

---------

Co-authored-by: yangchao <1162486779@qq.com>
2026-09-24 11:25:09 +08:00
yangchao ee89a99a9b fix(v8): fix iterator invalidation when removing handled promises (#357)
* fix(v8): fix iterator invalidation when removing handled promises

* fix(native): prevent iterator invalidation in callbacks and scheduler
2026-09-23 16:28:56 +08:00
llsansun f620989ce7 The final set skeleton call destroys and rebuilds the GPU bone reso… (#359)
* The final `set skeleton` call destroys and rebuilds the GPU bone resources that were bound in the previous two steps. However, the descriptor set is not rebound. As a result, the draw call for this subModel cannot access the bone matrices, so the entire character fails to render (this is not vertex deformation; the character does not appear at all). The fix should replace the reference in `descriptor.buffer` with the new buffer, mark it dirty, and lazily rebuild the descriptor before the next draw.

* opt
2026-09-23 16:18:03 +08:00
jk20012001 661de759ef fix(shader): HDR output for all floating point render targets (#351) 2026-09-22 11:50:47 +08:00
Tianze-Chen 0ab8246486 feat(ui): add component-level event API for Button (#356)
Add `on`/`off`/`targetOff` shorthands on Button that forward to the
owner node's event registry, so `button.on(Button.EventType.CLICK, ...)`
is now the documented way to listen for clicks in code (closes #104).

The CLICK event also carries the original EventTouch as the second
callback argument (non-breaking; XR-triggered clicks pass undefined).
Fix the outdated class doc example which referenced the non-existent
`Node.EventType.CLICK`, and correct the swapped `@param` docs on
ButtonEventType.

Co-authored-by: Engineer <engineer@cocos.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
2026-09-22 10:21:20 +08:00
zxx43 67642997f7 modify emit rate (#352)
* modify emit rate

* fix eslint

* fix eslint

* fix eslint

* fix
2026-09-21 17:07:35 +08:00
MagicX 3be9ebc5b7 fix: prevent accessor recursion in SkinnedMeshBatchRenderer. (#354)
* Changed the GeometryRenderer and DebugRenderer from using intrusive calls to registering callbacks (custom pipeline).

* Changed the GeometryRenderer and DebugRenderer from using intrusive calls to registering callbacks. (old pipeline)

* CI error: Function parameter names cannot be omitted.

* Move the devil string to macro

* fix(mesh): hoose index format by max index value in createMesh

* perf(pipeline): reduce render queue sort to two packed key compares (native platform).

* fix CI error caused by native/cocos/base/Utils.h

* fix(scene): LOD screen usage distance truncated to int (native platform)

* fix: prevent accessor recursion in SkinnedMeshBatchRenderer.
2026-09-21 10:27:35 +08:00
hyde zhou 47ebc462e5 bump version to 4.0.0-alpha.35 (#353) 4.0.0-alpha.35 2026-09-20 17:33:35 +08:00
Tianze-Chen b4bea55859 fix(label): abnormal font display when label text is too long (#348)
A very long label string (e.g. 8000+ characters) makes the text layout
canvas exceed MAX_SIZE, so the font is meant to be scaled down by the
shrink ratio. Clamping _fontScale to a minimum of 1 defeated that
downscale and the text displayed abnormally; lower the floor to 0.1 so
the font can shrink with the canvas.

Fixes #344

Co-authored-by: ctz <ctz@ctzdeMacBook-Air.local>
Co-authored-by: Claude Code <noreply@anthropic.com>
2026-09-20 17:27:24 +08:00