Repository: CesiumGS/webglreport Branch: main Commit: c84c8d04cf1c Files: 9 Total size: 61.5 KB Directory structure: gitextract_6ks92vk1/ ├── .gitignore ├── .project ├── CNAME ├── LICENSE.md ├── README.md ├── black.css ├── images/ │ └── ForkMe_Ribbons/ │ └── README.txt ├── index.html └── webglreport.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ .DS_Store* ================================================ FILE: .project ================================================ WebGL Report ================================================ FILE: CNAME ================================================ webglreport.com ================================================ FILE: LICENSE.md ================================================ Copyright 2011-2017 Analytical Graphics, Inc. and Contributors Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2011-2017 Analytical Graphics, Inc. and Contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: README.md ================================================ What WebGL capabilities does your system support? See [webglreport.com](https://webglreport.com) ================================================ FILE: black.css ================================================ a, a:link, a:visited { color: #218bb0; text-decoration: none; } a:hover { text-decoration: underline; } a img { border: none; } h1 { color: white; text-align: center; font-family: arial, Sans-Serif; font-size: 26pt; } body { font-family: arial, Sans-Serif; font-size: 16px; color: white; background-image: url(images/mtimoon_fromSTK_3d.jpg); background-position: right top; background-repeat: no-repeat; background-color: black; margin: 0px; } .align-center { margin-left: auto; margin-right: auto; text-align: center; } .main-output { position: relative; margin-left: auto; margin-right: auto; width: 700px; text-align: center; } .main-left-column { width: 190px; } .webglVersionTabs { text-align: left; padding-left: 4px; font-size: 20px; } .webglVersionTabs a, .webglVersionTabs a:visited { display: inline-block; background-color: #ddd; padding: 5px 10px; border-top-left-radius: 5px; border-top-right-radius: 5px; vertical-align: bottom; color: #218bb0; } .webglVersionTabs a.active, .webglVersionTabs a.active:visited { background-color: #00A900; color: #FFF; padding: 8px 15px; } .warn .webglVersionTabs a.active, .warn .webglVersionTabs a.active:visited { background-color: #A90000; color: #FFF; } .header { background: #00A900; overflow: hidden; margin-bottom: 8px; padding: 0 5px; } .warn .header { background: #A90000; } .header a, .header a:visited, .warn .header a, .warn .header a:visited { color: #42CEFF; } img { display: block; margin-left: auto; margin-right: auto; text-align: center; } .report { position: relative; width: 100%; color: black; box-sizing: border-box; font-size: 12px; text-align: left; border-style: ridge; border-width: 3px; padding: 6px; border-color: #AFC7C7; background-color: #FFFFFF; } .report > table { width: 700px; } td, th { text-align: left; vertical-align: top; } th { font-weight: bold; } .pipeline { width: 660px; height: 660px; color: white; position: relative; } .webgl2 .pipeline { height: 730px; } .pipeline table { width: 100%; } .pipeline .vertexShader, .pipeline .transformFeedback, .pipeline .rasterizer, .pipeline .fragmentShader, .pipeline .framebuffer, .pipeline .textures, .pipeline .uniformBuffers { position: absolute; width: 265px; } .pipeline h1 { font-size: 2em; margin: 0px; } .pipeline .vertexShader { top: 10px; left: 5px; } .pipeline .transformFeedback { top: 10px; left: 360px; } .pipeline .rasterizer { top: 220px; left: 5px; } .webgl2 .pipeline .rasterizer { top: 320px; } .pipeline .fragmentShader { top: 335px; left: 5px; } .webgl2 .pipeline .fragmentShader { top: 435px; } .pipeline .framebuffer { top: 520px; left: 5px; } .webgl2 .pipeline .framebuffer { top: 550px; left: 360px; } .pipeline .textures { top: 140px; left: 360px; } .webgl2 .pipeline .textures { top: 150px; } .pipeline .uniformBuffers { top: 300px; left: 360px; } .webgl2 .pipeline .uniformBuffers { top: 345px; } .pipeline a, .pipeline a:visited { color: #fff; } a.extension { font-family: "Courier New", monospace; } a.unsupported { color: rgb(200, 200, 200); } .comingSoon { text-align: center; padding: 10px; } @media only screen and (min-width:1470px) { .main-output { width: 1365px; } .report { min-height: 680px; } .webgl2 .report { min-height: 750px; } .warn .report { min-height: 0; } .pipeline { position: absolute; top: 5px; right: 0; } } ================================================ FILE: images/ForkMe_Ribbons/README.txt ================================================ GitHub loves third party developers. We want to help make your project awesome, and often that includes showing off GitHub integration with an image. In order to keep everyone happy (and avoid involving lawyers), we've created this repository and filled it with artwork that you may use in your own applications. For help or to add media not included here, please email support@github.com and we'll talk. THESE THINGS ARE AWESOME, PLEASE DO THEM: + Use the Octocat or GitHub logo to link to your GitHub profile (or GitHub) + Use the Octocat or GitHub logo to advertise that your product has built-in GitHub integration + Use the Octocat or GitHub logo in a blog post or news article about GitHub PLEASE, DON"T DO THESE THINGS: - Use the Octocat or GitHub logo for your application's icon - Create a modified version of the Octocat or GitHub logo - Integrate the Octocat or GitHub logo into your logo - Use any GitHub artwork without permission NAMING YOUR APPLICATION Please avoid naming your projects anything that implies GitHub's endorsement. For example, don't call your awesome new iPhone app "GitHub Issues". Instead consider "Octoissues" or "HubIssues" or "Gissues". Maybe not that last one, but you get the idea. ================================================ FILE: index.html ================================================  WebGL Report Fork me on GitHub

WebGL Report

You need to enable JavaScript to see WebGL.

================================================ FILE: webglreport.js ================================================ /*jslint browser: true, vars: true, white: true, nomen: true*/ /*jshint white: false, nomen: false*/ /*global $, _*/ $(function() { "use strict"; var webglVersion = window.location.search.indexOf('v=2') > 0 ? 2 : 1; var template = _.template($('#reportTemplate').html()); var report = { platform: navigator.platform, userAgent: navigator.userAgent, webglVersion: webglVersion }; if (webglVersion === 2) { $('body').addClass('webgl2'); } if ((webglVersion === 2 && !window.WebGL2RenderingContext) || (webglVersion === 1 && !window.WebGLRenderingContext)) { // The browser does not support WebGL $('#output').addClass('warn'); renderReport($('#webglNotSupportedTemplate').html()); return; } var canvas = $('', { width: '1', height: '1' }).appendTo('body'); var gl; var possibleNames = (webglVersion === 2) ? ['webgl2', 'experimental-webgl2'] : ['webgl', 'experimental-webgl']; var contextName = _.find(possibleNames, function (name) { gl = canvas[0].getContext(name, { stencil: true }); return !!gl; }); canvas.remove(); if (!gl) { // The browser supports WebGL, but initialization failed $('#output').addClass('warn'); renderReport($('#webglNotEnabledTemplate').html()); return; } function getExtensionUrl(extension) { //special cases if (extension === 'WEBKIT_lose_context') { extension = 'WEBGL_lose_context'; } else if (extension === 'WEBKIT_WEBGL_compressed_textures') { extension = ''; } extension = extension.replace(/^WEBKIT_/, ''); extension = extension.replace(/^MOZ_/, ''); extension = extension.replace(/_EXT_/, '_'); return 'https://www.khronos.org/registry/webgl/extensions/' + extension; } function renderReport(header) { var tabsTemplate = _.template($('#webglVersionTabs').html()); var headerTemplate = _.template(header); $('#output').html(tabsTemplate({ report: report, }) + headerTemplate({ report: report, }) + template({ report: report, getExtensionUrl: getExtensionUrl, getWebGL2ExtensionUrl: getWebGL2ExtensionUrl })); } function describeRange(value) { return '[' + value[0] + ', ' + value[1] + ']'; } function getMaxAnisotropy() { var e = gl.getExtension('EXT_texture_filter_anisotropic') || gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic') || gl.getExtension('MOZ_EXT_texture_filter_anisotropic'); if (e) { var max = gl.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT); // See Canary bug: https://code.google.com/p/chromium/issues/detail?id=117450 if (max === 0) { max = 2; } return max; } return 'n/a'; } function formatPower(exponent, verbose) { if (verbose) { return '' + Math.pow(2, exponent); } else { return '2' + exponent + ''; } } function getPrecisionDescription(precision, verbose) { var verbosePart = verbose ? ' bit mantissa' : ''; return '[-' + formatPower(precision.rangeMin, verbose) + ', ' + formatPower(precision.rangeMax, verbose) + '] (' + precision.precision + verbosePart + ')' } function getBestFloatPrecision(shaderType) { var high = gl.getShaderPrecisionFormat(shaderType, gl.HIGH_FLOAT); var medium = gl.getShaderPrecisionFormat(shaderType, gl.MEDIUM_FLOAT); var low = gl.getShaderPrecisionFormat(shaderType, gl.LOW_FLOAT); var best = high; if (high.precision === 0) { best = medium; } return '' + getPrecisionDescription(best, false) + ''; } function getFloatIntPrecision(gl) { var high = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT); var s = (high.precision !== 0) ? 'highp/' : 'mediump/'; high = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT); s += (high.rangeMax !== 0) ? 'highp' : 'lowp'; return s; } function isPowerOfTwo(n) { return (n !== 0) && ((n & (n - 1)) === 0); } function getAngle(gl) { var lineWidthRange = describeRange(gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE)); // Heuristic: ANGLE is only on Windows, not in IE, and not in Edge, and does not implement line width greater than one. var angle = ((navigator.platform === 'Win32') || (navigator.platform === 'Win64')) && (gl.getParameter(gl.RENDERER) !== 'Internet Explorer') && (gl.getParameter(gl.RENDERER) !== 'Microsoft Edge') && (lineWidthRange === describeRange([1,1])); if (angle) { // Heuristic: D3D11 backend does not appear to reserve uniforms like the D3D9 backend, e.g., // D3D11 may have 1024 uniforms per stage, but D3D9 has 254 and 221. // // We could also test for WEBGL_draw_buffers, but many systems do not have it yet // due to driver bugs, etc. if (isPowerOfTwo(gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS)) && isPowerOfTwo(gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS))) { return 'Yes, D3D11'; } else { return 'Yes, D3D9'; } } return 'No'; } function getMajorPerformanceCaveat(contextName) { // Does context creation fail to do a major performance caveat? var canvas = $('', { width : '1', height : '1' }).appendTo('body'); var gl = canvas[0].getContext(contextName, { failIfMajorPerformanceCaveat : true }); canvas.remove(); if (!gl) { // Our original context creation passed. This did not. return 'Yes'; } if (typeof gl.getContextAttributes().failIfMajorPerformanceCaveat === 'undefined') { // If getContextAttributes() doesn't include the failIfMajorPerformanceCaveat // property, assume the browser doesn't implement it yet. return 'Not implemented'; } return 'No'; } function getDraftExtensionsInstructions() { if (navigator.userAgent.indexOf('Chrome') !== -1) { return 'To see draft extensions in Chrome, browse to about:flags, enable the "Enable WebGL Draft Extensions" option, and relaunch.'; } else if (navigator.userAgent.indexOf('Firefox') !== -1) { return 'To see draft extensions in Firefox, browse to about:config and set webgl.enable-draft-extensions to true.'; } return ''; } function getMaxColorBuffers(gl) { var maxColorBuffers = 1; var ext = gl.getExtension("WEBGL_draw_buffers"); if (ext != null) maxColorBuffers = gl.getParameter(ext.MAX_DRAW_BUFFERS_WEBGL); return maxColorBuffers; } function getUnmaskedInfo(gl) { var unMaskedInfo = { renderer: '', vendor: '' }; var dbgRenderInfo = gl.getExtension("WEBGL_debug_renderer_info"); if (dbgRenderInfo != null) { unMaskedInfo.renderer = gl.getParameter(dbgRenderInfo.UNMASKED_RENDERER_WEBGL); unMaskedInfo.vendor = gl.getParameter(dbgRenderInfo.UNMASKED_VENDOR_WEBGL); } return unMaskedInfo; } function showNull(v) { return (v === null) ? 'n/a' : v; } var webglToEsNames = { 'getInternalformatParameter' : 'getInternalformativ', 'uniform1ui' : 'uniform', 'uniform2ui' : 'uniform', 'uniform3ui' : 'uniform', 'uniform4ui' : 'uniform', 'uniform1uiv' : 'uniform', 'uniform2uiv' : 'uniform', 'uniform3uiv' : 'uniform', 'uniform4uiv' : 'uniform', 'uniformMatrix2x3fv' : 'uniform', 'uniformMatrix3x2fv' : 'uniform', 'uniformMatrix2x4fv' : 'uniform', 'uniformMatrix4x2fv' : 'uniform', 'uniformMatrix3x4fv' : 'uniform', 'uniformMatrix4x3fv' : 'uniform', 'vertexAttribI4i' : 'vertexAttrib', 'vertexAttribI4iv' : 'vertexAttrib', 'vertexAttribI4ui' : 'vertexAttrib', 'vertexAttribI4uiv' : 'vertexAttrib', 'vertexAttribIPointer' : 'vertexAttribPointer', 'vertexAttribDivisor' : 'vertexAttribDivisor', 'createQuery' : 'genQueries', 'deleteQuery' : 'deleteQueries', 'endQuery' : 'beginQuery', 'getQuery' : 'getQueryiv', 'getQueryParameter' : 'getQueryObjectuiv', 'samplerParameteri' : 'samplerParameter', 'samplerParameterf' : 'samplerParameter', 'clearBufferiv' : 'clearBuffer', 'clearBufferuiv' : 'clearBuffer', 'clearBufferfv' : 'clearBuffer', 'clearBufferfi' : 'clearBuffer', 'createSampler' : 'genSamplers', 'deleteSampler' : 'deleteSamplers', 'getSyncParameter' : 'getSynciv', 'createTransformFeedback' : 'genTransformFeedbacks', 'deleteTransformFeedback' : 'deleteTransformFeedbacks', 'endTransformFeedback' : 'beginTransformFeedback', 'getIndexedParameter' : 'get', 'getActiveUniforms' : 'getActiveUniformsiv', 'getActiveUniformBlockParameter' : 'getActiveUniformBlockiv', 'createVertexArray' : 'genVertexArrays', 'deleteVertexArray' : 'deleteVertexArrays' }; function getWebGL2ExtensionUrl(name) { if (name === 'getBufferSubData') { return 'http://www.opengl.org/sdk/docs/man/docbook4/xhtml/glGetBufferSubData.xml'; } if (webglToEsNames[name]) { name = webglToEsNames[name]; } var filename = 'gl' + name[0].toUpperCase() + name.substring(1) + '.xhtml'; return 'http://www.khronos.org/opengles/sdk/docs/man3/html/' + filename; } function getWebGL2Status(gl, contextName) { var webgl2Names = [ 'copyBufferSubData', 'getBufferSubData', 'blitFramebuffer', 'framebufferTextureLayer', 'getInternalformatParameter', 'invalidateFramebuffer', 'invalidateSubFramebuffer', 'readBuffer', 'renderbufferStorageMultisample', 'texStorage2D', 'texStorage3D', 'texImage3D', 'texSubImage3D', 'copyTexSubImage3D', 'compressedTexImage3D', 'compressedTexSubImage3D', 'getFragDataLocation', 'uniform1ui', 'uniform2ui', 'uniform3ui', 'uniform4ui', 'uniform1uiv', 'uniform2uiv', 'uniform3uiv', 'uniform4uiv', 'uniformMatrix2x3fv', 'uniformMatrix3x2fv', 'uniformMatrix2x4fv', 'uniformMatrix4x2fv', 'uniformMatrix3x4fv', 'uniformMatrix4x3fv', 'vertexAttribI4i', 'vertexAttribI4iv', 'vertexAttribI4ui', 'vertexAttribI4uiv', 'vertexAttribIPointer', 'vertexAttribDivisor', 'drawArraysInstanced', 'drawElementsInstanced', 'drawRangeElements', 'drawBuffers', 'clearBufferiv', 'clearBufferuiv', 'clearBufferfv', 'clearBufferfi', 'createQuery', 'deleteQuery', 'isQuery', 'beginQuery', 'endQuery', 'getQuery', 'getQueryParameter', 'createSampler', 'deleteSampler', 'isSampler', 'bindSampler', 'samplerParameteri', 'samplerParameterf', 'getSamplerParameter', 'fenceSync', 'isSync', 'deleteSync', 'clientWaitSync', 'waitSync', 'getSyncParameter', 'createTransformFeedback', 'deleteTransformFeedback', 'isTransformFeedback', 'bindTransformFeedback', 'beginTransformFeedback', 'endTransformFeedback', 'transformFeedbackVaryings', 'getTransformFeedbackVarying', 'pauseTransformFeedback', 'resumeTransformFeedback', 'bindBufferBase', 'bindBufferRange', 'getIndexedParameter', 'getUniformIndices', 'getActiveUniforms', 'getUniformBlockIndex', 'getActiveUniformBlockParameter', 'getActiveUniformBlockName', 'uniformBlockBinding', 'createVertexArray', 'deleteVertexArray', 'isVertexArray', 'bindVertexArray' ]; var webgl2 = (contextName.indexOf('webgl2') !== -1); var functions = []; var totalImplemented = 0; var length = webgl2Names.length; if (webgl2) { for (var i = 0; i < length; ++i) { var name = webgl2Names[i]; var className = 'extension'; if (webgl2 && gl[name]) { ++totalImplemented; } else { className += ' unsupported'; } functions.push({ name: name, className: className }); } } return { status : webgl2 ? (totalImplemented + ' of ' + length + ' new functions implemented.') : 'webgl2 and experimental-webgl2 contexts not available.', functions : functions }; } var webgl2Status = getWebGL2Status(gl, contextName); report = _.extend(report, { contextName: contextName, glVersion: gl.getParameter(gl.VERSION), shadingLanguageVersion: gl.getParameter(gl.SHADING_LANGUAGE_VERSION), vendor: gl.getParameter(gl.VENDOR), renderer: gl.getParameter(gl.RENDERER), unMaskedVendor: getUnmaskedInfo(gl).vendor, unMaskedRenderer: getUnmaskedInfo(gl).renderer, antialias: gl.getContextAttributes().antialias ? 'Available' : 'Not available', angle: getAngle(gl), majorPerformanceCaveat: getMajorPerformanceCaveat(contextName), maxColorBuffers: getMaxColorBuffers(gl), redBits: gl.getParameter(gl.RED_BITS), greenBits: gl.getParameter(gl.GREEN_BITS), blueBits: gl.getParameter(gl.BLUE_BITS), alphaBits: gl.getParameter(gl.ALPHA_BITS), depthBits: gl.getParameter(gl.DEPTH_BITS), stencilBits: gl.getParameter(gl.STENCIL_BITS), maxRenderBufferSize: gl.getParameter(gl.MAX_RENDERBUFFER_SIZE), maxCombinedTextureImageUnits: gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS), maxCubeMapTextureSize: gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE), maxFragmentUniformVectors: gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS), maxTextureImageUnits: gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS), maxTextureSize: gl.getParameter(gl.MAX_TEXTURE_SIZE), maxVaryingVectors: gl.getParameter(gl.MAX_VARYING_VECTORS), maxVertexAttributes: gl.getParameter(gl.MAX_VERTEX_ATTRIBS), maxVertexTextureImageUnits: gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS), maxVertexUniformVectors: gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS), aliasedLineWidthRange: describeRange(gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE)), aliasedPointSizeRange: describeRange(gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE)), maxViewportDimensions: describeRange(gl.getParameter(gl.MAX_VIEWPORT_DIMS)), maxAnisotropy: getMaxAnisotropy(), vertexShaderBestPrecision: getBestFloatPrecision(gl.VERTEX_SHADER), fragmentShaderBestPrecision: getBestFloatPrecision(gl.FRAGMENT_SHADER), fragmentShaderFloatIntPrecision: getFloatIntPrecision(gl), extensions: gl.getSupportedExtensions(), draftExtensionsInstructions: getDraftExtensionsInstructions(), webgl2Status : webgl2Status.status, webgl2Functions : webgl2Status.functions }); if (webglVersion > 1) { report = _.extend(report, { maxVertexUniformComponents: showNull(gl.getParameter(gl.MAX_VERTEX_UNIFORM_COMPONENTS)), maxVertexUniformBlocks: showNull(gl.getParameter(gl.MAX_VERTEX_UNIFORM_BLOCKS)), maxVertexOutputComponents: showNull(gl.getParameter(gl.MAX_VERTEX_OUTPUT_COMPONENTS)), maxVaryingComponents: showNull(gl.getParameter(gl.MAX_VARYING_COMPONENTS)), maxFragmentUniformComponents: showNull(gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_COMPONENTS)), maxFragmentUniformBlocks: showNull(gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_BLOCKS)), maxFragmentInputComponents: showNull(gl.getParameter(gl.MAX_FRAGMENT_INPUT_COMPONENTS)), minProgramTexelOffset: showNull(gl.getParameter(gl.MIN_PROGRAM_TEXEL_OFFSET)), maxProgramTexelOffset: showNull(gl.getParameter(gl.MAX_PROGRAM_TEXEL_OFFSET)), maxDrawBuffers: showNull(gl.getParameter(gl.MAX_DRAW_BUFFERS)), maxColorAttachments: showNull(gl.getParameter(gl.MAX_COLOR_ATTACHMENTS)), maxSamples: showNull(gl.getParameter(gl.MAX_SAMPLES)), max3dTextureSize: showNull(gl.getParameter(gl.MAX_3D_TEXTURE_SIZE)), maxArrayTextureLayers: showNull(gl.getParameter(gl.MAX_ARRAY_TEXTURE_LAYERS)), maxTextureLodBias: showNull(gl.getParameter(gl.MAX_TEXTURE_LOD_BIAS)), maxUniformBufferBindings: showNull(gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS)), maxUniformBlockSize: showNull(gl.getParameter(gl.MAX_UNIFORM_BLOCK_SIZE)), uniformBufferOffsetAlignment: showNull(gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT)), maxCombinedUniformBlocks: showNull(gl.getParameter(gl.MAX_COMBINED_UNIFORM_BLOCKS)), maxCombinedVertexUniformComponents: showNull(gl.getParameter(gl.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS)), maxCombinedFragmentUniformComponents: showNull(gl.getParameter(gl.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS)), maxTransformFeedbackInterleavedComponents: showNull(gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS)), maxTransformFeedbackSeparateAttribs: showNull(gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS)), maxTransformFeedbackSeparateComponents: showNull(gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS)), maxElementIndex: showNull(gl.getParameter(gl.MAX_ELEMENT_INDEX)), maxServerWaitTimeout: showNull(gl.getParameter(gl.MAX_SERVER_WAIT_TIMEOUT)) }); } if (window.externalHost) { // Tab is running with Chrome Frame renderReport($('#webglSupportedChromeFrameTemplate').html()); } else { renderReport($('#webglSupportedTemplate').html()); } var pipeline = $('.pipeline') var background = $('.background')[0]; background.width = pipeline.width(); background.height = pipeline.height(); var hasVertexTextureUnits = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0; var context = background.getContext('2d'); context.shadowOffsetX = 3; context.shadowOffsetY = 3; context.shadowBlur = 7; context.shadowColor = 'rgba(0, 0, 0, 0.5)'; context.strokeStyle = 'black'; var boxPadding = 4; function drawBox(element, fill) { var pos = element.position(); var x = pos.left - boxPadding; var y = pos.top - boxPadding; var width = element.outerWidth() + (boxPadding * 2); var height = element.outerHeight() + (boxPadding * 2); var radius = 10; context.fillStyle = fill; context.lineWidth = 2; context.beginPath(); context.moveTo(x + radius, y); context.lineTo(x + width - radius, y); context.quadraticCurveTo(x + width, y, x + width, y + radius); context.lineTo(x + width, y + height - radius); context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height); context.lineTo(x + radius, y + height); context.quadraticCurveTo(x, y + height, x, y + height - radius); context.lineTo(x, y + radius); context.quadraticCurveTo(x, y, x + radius, y); context.closePath(); context.stroke(); context.fill(); return { x: x, y: y, width: width, height: height }; } function drawLeftHead(x, y) { context.beginPath(); context.moveTo(x + 5, y + 15); context.lineTo(x - 10, y); context.lineTo(x + 5, y - 15); context.quadraticCurveTo(x, y, x + 5, y + 15); context.fill(); } function drawRightHead(x, y) { context.beginPath(); context.moveTo(x - 5, y + 15); context.lineTo(x + 10, y); context.lineTo(x - 5, y - 15); context.quadraticCurveTo(x, y, x - 5, y + 15); context.fill(); } function drawDownHead(x, y) { context.beginPath(); context.moveTo(x + 15, y - 5); context.lineTo(x, y + 10); context.lineTo(x - 15, y - 5); context.quadraticCurveTo(x, y, x + 15, y - 5); context.fill(); } function drawDownArrow(topBox, bottomBox) { context.beginPath(); var arrowTopX = topBox.x + topBox.width / 2; var arrowTopY = topBox.y + topBox.height; var arrowBottomX = bottomBox.x + bottomBox.width / 2; var arrowBottomY = bottomBox.y - 15; context.moveTo(arrowTopX, arrowTopY); context.lineTo(arrowBottomX, arrowBottomY); context.stroke(); drawDownHead(arrowBottomX, arrowBottomY); } function drawRightArrow(leftBox, rightBox, factor) { context.beginPath(); var arrowLeftX = leftBox.x + leftBox.width; var arrowRightX = rightBox.x - 15; var arrowRightY = rightBox.y + rightBox.height * factor; context.moveTo(arrowLeftX, arrowRightY); context.lineTo(arrowRightX, arrowRightY); context.stroke(); drawRightHead(arrowRightX, arrowRightY); } var webgl2color = (webglVersion > 1) ? '#02AFCF' : '#aaa'; var vertexShaderBox = drawBox($('.vertexShader'), '#ff6700'); var transformFeedbackBox = drawBox($('.transformFeedback'), webgl2color); var rasterizerBox = drawBox($('.rasterizer'), '#3130cb'); var fragmentShaderBox = drawBox($('.fragmentShader'), '#ff6700'); var framebufferBox = drawBox($('.framebuffer'), '#7c177e'); var texturesBox = drawBox($('.textures'), '#3130cb'); var uniformBuffersBox = drawBox($('.uniformBuffers'), webgl2color); var arrowRightX = texturesBox.x; var arrowRightY = texturesBox.y + (texturesBox.height / 2); var arrowMidX = (texturesBox.x + vertexShaderBox.x + vertexShaderBox.width) / 2; var arrowMidY = arrowRightY; var arrowTopMidY = texturesBox.y - 15; var arrowBottomMidY = fragmentShaderBox.y + (fragmentShaderBox.height * 0.55); var arrowTopLeftX = vertexShaderBox.x + vertexShaderBox.width + 15; var arrowTopLeftY = arrowTopMidY; var arrowBottomLeftX = fragmentShaderBox.x + fragmentShaderBox.width + 15; var arrowBottomLeftY = arrowBottomMidY; if (hasVertexTextureUnits) { context.fillStyle = context.strokeStyle = 'black'; context.lineWidth = 10; } else { context.fillStyle = context.strokeStyle = '#FFF'; context.shadowColor = '#000'; context.shadowOffsetX = context.shadowOffsetY = 0; context.lineWidth = 8; } context.beginPath(); context.moveTo(arrowMidX, arrowMidY); context.lineTo(arrowMidX, arrowTopMidY); if (hasVertexTextureUnits) { context.lineTo(arrowTopLeftX, arrowTopMidY); context.stroke(); drawLeftHead(arrowTopLeftX, arrowTopLeftY); } else { context.stroke(); context.shadowColor = '#000'; context.font = 'bold 14pt arial, Sans-Serif'; context.fillText('No vertex textures available.', arrowMidX - 8, arrowTopMidY - 8); } context.lineWidth = 10; context.fillStyle = context.strokeStyle = 'black'; context.shadowColor = 'rgba(0, 0, 0, 0.5)'; context.shadowOffsetX = context.shadowOffsetY = 3; context.beginPath(); context.moveTo(arrowRightX, arrowRightY); context.lineTo(arrowMidX - context.lineWidth * 0.5, arrowMidY); context.moveTo(arrowMidX, arrowMidY); context.lineTo(arrowMidX, arrowBottomMidY); context.lineTo(arrowBottomLeftX, arrowBottomLeftY); var uniformBuffersMidY = uniformBuffersBox.y + uniformBuffersBox.height / 2; context.moveTo(arrowMidX, uniformBuffersMidY); context.lineTo(arrowRightX, uniformBuffersMidY); context.stroke(); drawLeftHead(arrowBottomLeftX, arrowBottomLeftY); drawRightArrow(vertexShaderBox, transformFeedbackBox, 0.5); drawDownArrow(vertexShaderBox, rasterizerBox); drawDownArrow(rasterizerBox, fragmentShaderBox); if (webglVersion === 1) { drawDownArrow(fragmentShaderBox, framebufferBox); } else { drawRightArrow(fragmentShaderBox, framebufferBox, 0.7); } window.gl = gl; });