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

Fix morph issue on some platforms #7268

Merged
merged 5 commits into from Sep 2, 2020
Merged

Conversation

shrinktofit
Copy link
Contributor

@shrinktofit shrinktofit commented Sep 1, 2020

Re: cocos-creator/3d-tasks#

Changelog:

  • Fix morph issue on platforms with shader >= 300 && having not float texture;
  • Fix GPU morph is failed when using rgba8 texture on some platforms.

Comment on lines 92 to 94
int dataPixelStart = int(fetchVec3ArrayFromTexture(tex, iTarget).r);
// `+0.5` because in some platforms, the "fetched integer" may have small error.
// For example `26` may yeild `25.99999`, which is convert to `25` instead of `26` using `int()`.
int dataPixelStart = int(fetchVec3ArrayFromTexture(tex, iTarget).r + 0.5);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@YunHsiao Notable change

Copy link
Contributor

Choose a reason for hiding this comment

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

这种 offset 在 CPU 做是不是就行了,不要每个顶点都执行一遍了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed at ac84a54

@@ -6,7 +6,7 @@
#if __VERSION__ < 300
in float a_vertexId;
int getVertexId() {
return int(a_vertexId);
return int(a_vertexId + 0.5);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@YunHsiao Notable change

Copy link
Contributor

Choose a reason for hiding this comment

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

这个也一样

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed at ac84a54

@shrinktofit shrinktofit changed the title Fix morph issue on platforms with shader >= 300 && having not float t… Fix morph issue on some platforms Sep 2, 2020
@pandamicro pandamicro merged commit 6803722 into cocos:3d-v1.2 Sep 2, 2020
@shrinktofit shrinktofit deleted the FixMorph branch September 2, 2020 02:40
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.

None yet

3 participants