-
Notifications
You must be signed in to change notification settings - Fork 3.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
Webgl2 #3094
Webgl2 #3094
Conversation
…XT_frag_depth aren't supported.
|
There should be one test failure for materials because the |
@bagnell I added your comments to #797 (comment) |
Also changes indices to not use the maximum value of the index type. The maximum value of the index type is used for primitive restart. It may also be beneficial for WebGL 1.0 when using ANGLE. |
@@ -104,8 +104,8 @@ define([ | |||
*/ | |||
TerrainProvider.getRegularGridIndices = function(width, height) { | |||
//>>includeStart('debug', pragmas.debug); | |||
if (width * height > 64 * 1024) { | |||
throw new DeveloperError('The total number of vertices (width * height) must be less than or equal to 65536.'); | |||
if (width * height >= 64 * 1024) { |
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 should also change COLLADA2GLTF and any terrain tools that break up meshes to use 64K - 1 vertices, right?
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.
I guess use CesiumMath.SIXTY_FOUR_KILOBYTES
here (and anywhere else) like we do elsewhere.
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 should also change COLLADA2GLTF and any terrain tools that break up meshes to use 64K - 1 vertices, right?
Right, split them or use unsigned ints.
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.
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 are good for models.
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.
Why minus 1? You can fit exactly 64k vertices using unsigned short and the comparison is checking the vertex count, not the max index.
There are JSHint errors: https://travis-ci.org/AnalyticalGraphicsInc/cesium/builds/85431116 |
Good start to WebGL 2. Just those comments. |
@pjcozzi This is ready for another review. |
@abwood see the WebGL 2 spec:
|
ContextLimits._maximumTextureFilterAnisotropy = defined(textureFilterAnisotropic) ? gl.getParameter(textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 1.0; | ||
|
||
if (webgl2) { |
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.
I'd rather only assign to each context property once since I'm not 100% sure that all JavaScript engines will optimize (not enter dictionary mode) when we "create" properties in a branch (even though it is in both branches).
Instead, perhaps something like:
var glCreateVertexArray = undefined;
if (webgl2) {
glCreateVertexArray = // ...
} else {
glCreateVertexArray = // ...
}
this.glCreateVertexArray = glCreateVertexArray;
Or leave it if someone can confirm the performance.
Looks good. Just that comment. |
@pjcozzi This is ready. |
JSHint is also failing: https://travis-ci.org/AnalyticalGraphicsInc/cesium/builds/85552141 |
@pjcozzi The jsHint errors are fixed. Fixing them fixed getting the extensions in WebGL 1.0. |
WebGL 1 looks good. On WebGL 2 in Canary, should this test fail?
|
@pjcozzi I wasn't seeing that failure but it should be fixed. |
Looks good! |
For #797
Added preliminary WebGL2 support. Fixed any incompatibilities between WebGL1 extensions and WebGL2 core, though there are a few extensions that aren't supported right now.