Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opacity already includes the alpha value from the color. The batcher2d's walk function implements the calculation of opacity. #17509

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

bofeng-song
Copy link
Contributor

@bofeng-song bofeng-song commented Aug 7, 2024

Re: #
#16960
#17497
#16601

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.

Greptile Summary

The PR modifies the opacity calculation in the cacheTraverse function of simple.ts and the Skeleton class within skeleton.ts to use the node's opacity directly. This change affects how the final vertex colors are computed, ensuring consistency with the Web's opacity calculation.

  • native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.cpp: Updated handleColor function to derive opacity directly from the entity's opacity.
  • native/cocos/editor-support/spine-creator-support/SkeletonRenderer.cpp: Modified render function to use only the skeleton's color alpha, slot's color alpha, and entity's opacity for final alpha value.
  • platforms/native/engine/jsb-spine-skeleton.js: Updated _updateColor method to include node's local opacity directly in the color update process.

Ensure these changes do not introduce rendering issues, especially where both node's opacity and color alpha values are used.

…tcher2d's walk function implements the calculation of opacity.
@bofeng-song bofeng-song requested a review from minggo August 7, 2024 06:38
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@bofeng-song
Copy link
Contributor Author

image
Opacity has been contained color's alpha

Copy link

github-actions bot commented Aug 7, 2024

Interface Check Report

This pull request does not change any public interfaces !

@bofeng-song bofeng-song changed the title Web's opacity already includes the alpha value from the color. The batcher2d's walk function implements the calculation of opacity. Opacity already includes the alpha value from the color. The batcher2d's walk function implements the calculation of opacity. Aug 7, 2024
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@minggo minggo merged commit 4edbf5b into cocos:v3.8.4 Aug 7, 2024
23 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.

2 participants