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

fixed calc material hash #5615

Conversation

@2youyou2
Copy link
Contributor

2youyou2 commented Oct 25, 2019

Re: cocos-creator/2d-tasks#2000

Changes:

  • fixed calc material hash
hashData += prop._id + ';';
}
else {
hashData += prop.toString() + ';';

This comment has been minimized.

Copy link
@holycanvas

holycanvas Oct 25, 2019

Contributor

是之前hash的计算过程导致的实例化之后还识别为同个材质么?

This comment has been minimized.

Copy link
@2youyou2

2youyou2 Oct 25, 2019

Author Contributor

是的

@holycanvas holycanvas requested a review from caryliu1999 Oct 25, 2019
hashData += prop._id + ';';
}
else {
hashData += prop.toString() + ';';

This comment has been minimized.

Copy link
@caryliu1999

caryliu1999 Oct 25, 2019

Contributor

如果是对象的话,所有对象进行 toString 的结果都是字符串 “object”,这个要注意一下,我看之前的 PARAM_MAT4 好像就是对象,还有其他情况是使用对象的吗?

This comment has been minimized.

Copy link
@2youyou2

2youyou2 Oct 25, 2019

Author Contributor

没有对象了,在解析的时候会全部转换为 ArrayBuffer

This comment has been minimized.

Copy link
@caryliu1999

caryliu1999 Oct 25, 2019

Contributor

好的

}
else {
if (value && typeof value === 'object') {
cc.warn(`Set effect property ${this._name} warning : should transform object to ArrayBuffer`);

This comment has been minimized.

Copy link
@2youyou2

2youyou2 Oct 25, 2019

Author Contributor

防止漏处理的对象,加个 warning

@holycanvas holycanvas merged commit 4b56ca9 into cocos-creator:v2.2.1-release Oct 25, 2019
1 check passed
1 check passed
ci/circleci: test Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.