text: /**
   * skylark-jsmodeler - A version of jsmodeler that ported to running on skylarkjs
   * @author Hudaokeji, Inc.
   * @version v0.9.0
   * @link https://github.com/skylark-integration/skylark-jsmodeler/
   * @license MIT
   */
  define(["../core/jsm"],function(e){return e.IsPowerOfTwo=function(e){return e&e-1==0},e.NextPowerOfTwo=function(r){if(e.IsPowerOfTwo(r))return r;for(var t=1;t<r;)t*=2;return t},e.ResizeImageToPowerOfTwoSides=function(r){if(e.IsPowerOfTwo(r.width)&&!e.IsPowerOfTwo(r.height))return r;var t=e.NextPowerOfTwo(r.width),n=e.NextPowerOfTwo(r.height),a=document.createElement("canvas");a.width=t,a.height=n;var o=a.getContext("2d");return o.drawImage(r,0,0,t,n),o.getImageData(0,0,t,n)},e.WebGLInitContext=function(e){if(null===e)return null;if(void 0===e.getContext)return null;var r=e.getContext("webgl")||e.getContext("experimental-webgl");return null===r?null:(r.viewport(0,0,e.width,e.height),r.clearColor(1,1,1,1),r)},e.WebGLInitShaderProgram=function(e,r,t,n){function a(e,r,t,n){var a=e.createShader(t);return e.shaderSource(a,r),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS)?a:(void 0!==n&&null!==n&&n(e.getShaderInfoLog(a)),null)}var o=function(e,r,t,n){var o=a(e,r,e.FRAGMENT_SHADER,n),u=a(e,t,e.VERTEX_SHADER,n);if(null===o||null===u)return null;var T=e.createProgram();return e.attachShader(T,u),e.attachShader(T,o),e.linkProgram(T),e.getProgramParameter(T,e.LINK_STATUS)?T:null}(e,t,r,n);return null===o?null:(e.useProgram(o),o)},e.WebGLGetFloatTextureBufferSize=function(r){return e.NextPowerOfTwo(Math.ceil(Math.sqrt(r.length/4)))},e.WebGLCreateFloatTextureBuffer=function(e,r,t){var n=null;if(null!==r){for(;r.length<t*t*4;)r.push(0);n=new Float32Array(r)}var a=e.createTexture();return e.bindTexture(e.TEXTURE_2D,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,t,0,e.RGBA,e.FLOAT,n),e.bindTexture(e.TEXTURE_2D,null),a},e});
  //# sourceMappingURL=../sourcemaps/renderer/webglutils.js.map
  