Skip to content

fix(shader): fix lighting discontinuity at mirrored UV seams - #209

Merged
star-e merged 3 commits into
cocos:v4.0.0from
xubing0906:v4.0.0-normal
Jul 31, 2026
Merged

fix(shader): fix lighting discontinuity at mirrored UV seams#209
star-e merged 3 commits into
cocos:v4.0.0from
xubing0906:v4.0.0-normal

Conversation

@xubing0906

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.

@xubing0906 xubing0906 added the investigation Investigate the impact on the code base label Jul 20, 2026
@xubing0906

Copy link
Copy Markdown
Contributor Author

@cocos-robot run test cases

@xubing0906 xubing0906 self-assigned this Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

Code Size Check Report

Wechat (WASM) Before After Diff
2D Empty (legacy pipeline) 1014547 bytes 1014547 bytes ✅ 0 bytes
2D All (legacy pipeline) 2682072 bytes 2682072 bytes ✅ 0 bytes
2D All (new pipeline) 2773854 bytes 2773854 bytes ✅ 0 bytes
(2D + 3D) All 10031227 bytes 10031227 bytes ✅ 0 bytes
Web (WASM + ASMJS) Before After Diff
(2D + 3D) All 16867640 bytes 16867640 bytes ✅ 0 bytes

Interface Check Report

This pull request does not change any public interfaces !

@github-actions

Copy link
Copy Markdown

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

Task Details

@github-actions

Copy link
Copy Markdown

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

Task Details

@xubing0906
xubing0906 requested a review from jk20012001 July 24, 2026 02:45
@xubing0906

xubing0906 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author
image image image

@xubing0906

Copy link
Copy Markdown
Contributor Author

@xubing0906

Copy link
Copy Markdown
Contributor Author

@cocos-robot run test cases

@xubing0906 xubing0906 removed the investigation Investigate the impact on the code base label Jul 24, 2026
@github-actions

Copy link
Copy Markdown

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

Task Details

@github-actions

Copy link
Copy Markdown

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

Task Details

@xubing0906 xubing0906 changed the title fix(shader): preserve TBN scale when reconstructing normal fix(shader): fix lighting discontinuity at mirrored UV seams Jul 27, 2026
@xubing0906

xubing0906 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

测试例在此,case.zip,打开scene只要里面的角色额头没接缝就是对的。
正确的效果image错误的效果
image

@@ -82,9 +82,9 @@ vec3 CalculateNormal(vec3 tangent, vec3 binormal)
vec3 CalculateNormalFromTangentSpace(vec3 normalFromTangentSpace, float normalStrength, vec3 normal, vec3 tangent, float mirrorNormal)
{

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.

add:
normal = normalize(normal);
tangent = normalize(tangent);

@star-e
star-e merged commit 085d059 into cocos:v4.0.0 Jul 31, 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