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

add highp precision check #5675

Merged

Conversation

@2youyou2
Copy link
Contributor

2youyou2 commented Nov 5, 2019

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

Changes:

  • add highp precision check

老设备上可能不支持 highp,这里判断如果设备不支持 highp 则替换 shader 中的 highp 为 mediump。

image

highpSupported = highp && highp.precision !== 0;
}
if (!highpSupported) {
cc.warn('Program not support highp precision, will change to mediump.');

This comment has been minimized.

Copy link
@pandamicro

pandamicro Nov 5, 2019

Member

用 warnID

@@ -63,6 +63,10 @@ function _unrollLoops(string) {
return string.replace(pattern, replace);
}

function _replaceHighp(string) {
return string.replace(/\bhighp\b/, 'mediump');

This comment has been minimized.

Copy link
@jareguo

jareguo Nov 5, 2019

Contributor

是不是得加个 /g 比较好

@holycanvas

This comment has been minimized.

Copy link
Contributor

holycanvas commented Nov 6, 2019

这个是three的检测方式,看看有没有参考价值 image

@2youyou2

This comment has been minimized.

Copy link
Contributor Author

2youyou2 commented Nov 6, 2019

这个是three的检测方式,看看有没有参考价值

加了 vertex precision 的检测,mediump 没加了,不支持游戏都玩不了了。。

@holycanvas holycanvas merged commit 12a3fc4 into cocos-creator:v2.2.1-release Nov 6, 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
4 participants
You can’t perform that action at this time.