Skip to content

add opacity calculation to Particle System 2D - #307

Merged
llsansun merged 2 commits into
cocos:v4.0.0from
zxx43:ParticleOpacity
Aug 25, 2026
Merged

add opacity calculation to Particle System 2D#307
llsansun merged 2 commits into
cocos:v4.0.0from
zxx43:ParticleOpacity

Conversation

@zxx43

@zxx43 zxx43 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Re: # & #

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

@zxx43
zxx43 requested a review from LinYunMo August 25, 2026 03:03
@github-actions

Copy link
Copy Markdown

Code Size Check Report

Wechat (WASM) Before After Diff
2D Empty (legacy pipeline) 1015436 bytes 1015436 bytes ✅ 0 bytes
2D All (legacy pipeline) 2683233 bytes 2683579 bytes ⚠️ +346 bytes
2D All (new pipeline) 2775492 bytes 2775838 bytes ⚠️ +346 bytes
(2D + 3D) All 10032934 bytes 10033280 bytes ⚠️ +346 bytes
Web (WASM + ASMJS) Before After Diff
(2D + 3D) All 16869352 bytes 16869698 bytes ⚠️ +346 bytes

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -70482,8 +70482,14 @@
         export class _cocos_particle_2d_particle_simulator_2d__Particle {
             pos: math.Vec2;
             startPos: math.Vec2;
             color: math.Color;
+            curColor: {
+                r: number;
+                g: number;
+                b: number;
+                a: number;
+            };
             deltaColor: {
                 r: number;
                 g: number;
                 b: number;

@zxx43

zxx43 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@cocos-robot run test cases

@zxx43
zxx43 requested a review from llsansun August 25, 2026 03:31
@github-actions

Copy link
Copy Markdown

@zxx43, Please check the result of run test cases:

Task Details

@github-actions

Copy link
Copy Markdown

@zxx43, Please check the result of run test cases:

Task Details

@LinYunMo LinYunMo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to spine fix, it adds the ability to cascade transparency to components.

@llsansun

Copy link
Copy Markdown
Contributor

This extra color structure is needed for precision. Since Color stores RGBA as 8-bit values, using a float curColor prevents precision loss during per-frame color interpolation.

@llsansun
llsansun merged commit f5eaf97 into cocos:v4.0.0 Aug 25, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants