-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Surport for OpenGL ES rendering. #13046
Conversation
Thanks for the contribution. You don't need to include |
Yes please, do not include the builds files in the PR. |
Also, in which environment are you getting |
@mrdoob maybe WeChat small program |
var versionString = gl.getParameter(gl.VERSION); | ||
var lineWidthAvailable = false; | ||
var version = 0.0; | ||
if(versionString.indexOf("WebGL") != -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use !==
is better
version = parseFloat( /^WebGL\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) )[ 1 ] ); | ||
lineWidthAvailable = parseFloat( version ) >= 1.0; | ||
} | ||
else if(versionString.indexOf("OpenGL ES") != -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use !==
is better
else if(versionString.indexOf("OpenGL ES") != -1) | ||
{ | ||
version = parseFloat( /^OpenGL ES\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) )[ 1 ] ); | ||
lineWidthAvailable = parseFloat( version ) >= 2.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need parseFloat again
if(versionString.indexOf("WebGL") != -1) | ||
{ | ||
version = parseFloat( /^WebGL\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) )[ 1 ] ); | ||
lineWidthAvailable = parseFloat( version ) >= 1.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need parseFloat again
var version = 0.0; | ||
if(versionString.indexOf("WebGL") != -1) | ||
{ | ||
version = parseFloat( /^WebGL\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) )[ 1 ] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use versionString
instead of call gl.getParameter( gl.VERSION )
again
} | ||
else if(versionString.indexOf("OpenGL ES") != -1) | ||
{ | ||
version = parseFloat( /^OpenGL ES\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) )[ 1 ] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use versionString
instead of call gl.getParameter( gl.VERSION )
again
#13211 was merged instead. |
I fixed an bug when i migrated to my android phone, because my gl version string is "OpenGL ES 3.2 v1.r12p1-04bet0.76b1d268c59a490265a02c702c8aa55c"