1 line
497 KiB
Plaintext
1 line
497 KiB
Plaintext
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/shapes/hexsphere_r1_d4.bin","webpack:///./node_modules/gl-mat4/identity.js","webpack:///./src/shapes/hexsphere_r1_d0.bin","webpack:///./src/shapes/hexsphere_r1_d1.bin","webpack:///./src/shapes/hexsphere_r1_d2.bin","webpack:///./src/shapes/hexsphere_r1_d3.bin","webpack:///./src/shapes/hexsphere_r1_d5.bin","webpack:///./src/shapes/hexsphere_r1_d6.bin","webpack:///./src/shapes/icosahedron_r1_d0.bin","webpack:///./src/shapes/icosahedron_r1_d1.bin","webpack:///./src/shapes/icosahedron_r1_d2.bin","webpack:///./src/shapes/icosahedron_r1_d3.bin","webpack:///./src/shapes/icosahedron_r1_d4.bin","webpack:///./src/shapes/icosahedron_r1_d5.bin","webpack:///./src/shapes/icosahedron_r1_d6.bin","webpack:///./src/shapes/icosahedron_r1_d7.bin","webpack:///./src/regl_index.js","webpack:///./node_modules/regl/dist/regl.js","webpack:///./node_modules/regl-camera/regl-camera.js","webpack:///./node_modules/mouse-change/mouse-listen.js","webpack:///./node_modules/mouse-event/mouse.js","webpack:///./node_modules/mouse-wheel/wheel.js","webpack:///./node_modules/to-px/browser.js","webpack:///./node_modules/parse-unit/index.js","webpack:///./node_modules/gl-mat4/perspective.js","webpack:///./node_modules/gl-mat4/lookAt.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","out","__webpack_exports__","_shapes_hexsphere_r1_d0_bin__WEBPACK_IMPORTED_MODULE_0__","_shapes_hexsphere_r1_d0_bin__WEBPACK_IMPORTED_MODULE_0___default","_shapes_hexsphere_r1_d1_bin__WEBPACK_IMPORTED_MODULE_1__","_shapes_hexsphere_r1_d1_bin__WEBPACK_IMPORTED_MODULE_1___default","_shapes_hexsphere_r1_d2_bin__WEBPACK_IMPORTED_MODULE_2__","_shapes_hexsphere_r1_d2_bin__WEBPACK_IMPORTED_MODULE_2___default","_shapes_hexsphere_r1_d3_bin__WEBPACK_IMPORTED_MODULE_3__","_shapes_hexsphere_r1_d3_bin__WEBPACK_IMPORTED_MODULE_3___default","_shapes_hexsphere_r1_d4_bin__WEBPACK_IMPORTED_MODULE_4__","_shapes_hexsphere_r1_d4_bin__WEBPACK_IMPORTED_MODULE_4___default","_shapes_hexsphere_r1_d5_bin__WEBPACK_IMPORTED_MODULE_5__","_shapes_hexsphere_r1_d5_bin__WEBPACK_IMPORTED_MODULE_5___default","_shapes_hexsphere_r1_d6_bin__WEBPACK_IMPORTED_MODULE_6__","_shapes_hexsphere_r1_d6_bin__WEBPACK_IMPORTED_MODULE_6___default","_shapes_icosahedron_r1_d0_bin__WEBPACK_IMPORTED_MODULE_7__","_shapes_icosahedron_r1_d0_bin__WEBPACK_IMPORTED_MODULE_7___default","_shapes_icosahedron_r1_d1_bin__WEBPACK_IMPORTED_MODULE_8__","_shapes_icosahedron_r1_d1_bin__WEBPACK_IMPORTED_MODULE_8___default","_shapes_icosahedron_r1_d2_bin__WEBPACK_IMPORTED_MODULE_9__","_shapes_icosahedron_r1_d2_bin__WEBPACK_IMPORTED_MODULE_9___default","_shapes_icosahedron_r1_d3_bin__WEBPACK_IMPORTED_MODULE_10__","_shapes_icosahedron_r1_d3_bin__WEBPACK_IMPORTED_MODULE_10___default","_shapes_icosahedron_r1_d4_bin__WEBPACK_IMPORTED_MODULE_11__","_shapes_icosahedron_r1_d4_bin__WEBPACK_IMPORTED_MODULE_11___default","_shapes_icosahedron_r1_d5_bin__WEBPACK_IMPORTED_MODULE_12__","_shapes_icosahedron_r1_d5_bin__WEBPACK_IMPORTED_MODULE_12___default","_shapes_icosahedron_r1_d6_bin__WEBPACK_IMPORTED_MODULE_13__","_shapes_icosahedron_r1_d6_bin__WEBPACK_IMPORTED_MODULE_13___default","_shapes_icosahedron_r1_d7_bin__WEBPACK_IMPORTED_MODULE_14__","_shapes_icosahedron_r1_d7_bin__WEBPACK_IMPORTED_MODULE_14___default","shapes","hexsphere_0","a","hexsphere_1","hexsphere_2","hexsphere_3","hexsphere_4","hexsphere_5","hexsphere_6","icosahedron_0","icosahedron_1","icosahedron_2","icosahedron_3","icosahedron_4","icosahedron_5","icosahedron_6","icosahedron_7","regl","extensions","camera","center","distance","draw","loadShape","shape","fetch","then","response","arrayBuffer","buffer","reader","DataView","numVertices","getUint32","numCells","shapeData","positions","Float32Array","normals","colors","cells","Uint32Array","hexsphere","vert","frag","attributes","position","normal","color","elements","uniforms","lights[0].color","lights[0].position","tick","Math","cos","sin","drawShape","frame","clear","depth","shapeSelectLoading","style","display","shapeSelect","document","querySelector","addEventListener","event","target","isTypedArray","x","Uint8Array","Uint16Array","Int8Array","Int16Array","Int32Array","Float64Array","Uint8ClampedArray","extend","base","opts","keys","length","endl","raise","message","error","Error","console","check","pred","encolon","checkOneOf","list","indexOf","constructorKeys","leftPad","str","ShaderFile","this","lines","index","hasErrors","ShaderLine","number","line","errors","ShaderError","fileNumber","lineNumber","file","guessCommand","stack","toString","pat","exec","pat2","guessCallSite","parseSource","source","command","split","files","unknown","0","push","parts","lineNumberInfo","nameInfo","atob","forEach","saveCommandRef","_commandRef","commandRaise","callSite","checkCommandType","type","GL_CLAMP_TO_EDGE","GL_NEAREST","GL_NEAREST_MIPMAP_NEAREST","GL_LINEAR_MIPMAP_NEAREST","GL_NEAREST_MIPMAP_LINEAR","GL_LINEAR_MIPMAP_LINEAR","GL_FLOAT","GL_UNSIGNED_SHORT_4_4_4_4","GL_UNSIGNED_SHORT_5_5_5_1","GL_UNSIGNED_SHORT_5_6_5","GL_UNSIGNED_INT_24_8_WEBGL","TYPE_SIZE","pixelSize","channels","isPow2","v","check$1","optional","block","parameter","param","possibilities","join","commandParameter","constructor","obj","commandType","data","nni","oneOf","shaderError","gl","shader","getShaderParameter","COMPILE_STATUS","errLog","getShaderInfoLog","typeName","FRAGMENT_SHADER","result","errMsg","trim","parseErrorLog","annotateFiles","strings","styles","offset","token","tokenPat","max","window","chrome","log","apply","linkError","program","fragShader","vertShader","getProgramParameter","LINK_STATUS","getProgramInfoLog","fragParse","vertParse","header","saveDrawInfo","stringStore","id","addProps","dict","set","u","_fragId","static","_vertId","uniformSet","_uniformSet","dynamic","attributeSet","_attributeSet","_hasCount","framebufferFormat","attachment","texFormats","rbFormats","texture","_texture","internalformat","renderbuffer","_renderbuffer","format","texture2D","info","mipData","limits","w","width","h","height","maxTextureSize","wrapS","wrapT","mipmask","minFilter","magFilter","genMipmaps","mipimages","images","mw","mh","img","compressed","rowSize","ceil","unpackAlignment","byteLength","element","copy","textureCube","faces","face","mipmaps","j","VARIABLE_COUNTER","DYN_FUNC","DynamicVariable","escapeStr","replace","toAccessorString","splitParts","firstChar","charAt","lastChar","substr","concat","subparts","define","isDynamic","_reglType","unbox","path","accessor","raf","next","requestAnimationFrame","cb","setTimeout","cancel","cancelAnimationFrame","clearTimeout","clock","performance","now","Date","parseExtensions","input","Array","isArray","getElement","desc","parseArgs","args_","container","canvas","args","contextAttributes","optionalExtensions","pixelRatio","devicePixelRatio","profile","onDone","err","onDestroy","nodeName","appendChild","getBoundingClientRect","drawArrays","drawElements","isWebGLContext","toLowerCase","createElement","resize","innerWidth","innerHeight","body","bounds","right","left","bottom","top","border","margin","padding","removeEventListener","removeChild","createCanvas","getContext","e","createContext","loop","f","GL_BYTE$1","GL_UNSIGNED_BYTE$2","GL_SHORT$1","GL_UNSIGNED_SHORT$1","GL_INT$1","GL_UNSIGNED_INT$1","GL_FLOAT$2","log2","shift","createPool","bufferPool","alloc","sz","nextPow16","bin","pop","ArrayBuffer","free","buf","allocType","subarray","freeType","array","pool","zero","wrapLimits","maxAnisotropic","ext_texture_filter_anisotropic","getParameter","maxDrawbuffers","maxColorAttachments","webgl_draw_buffers","readFloat","oes_texture_float","readFloatTexture","createTexture","bindTexture","texImage2D","fbo","createFramebuffer","bindFramebuffer","framebufferTexture2D","checkFramebufferStatus","viewport","clearColor","pixels","readPixels","getError","deleteFramebuffer","deleteTexture","isIE","navigator","test","userAgent","appVersion","npotTextureCube","cubeTexture","activeTexture","colorBits","depthBits","stencilBits","subpixelBits","filter","ext","pointSizeDims","lineWidthDims","maxViewportDims","maxCombinedTextureUnits","maxCubeMapSize","maxRenderbufferSize","maxTextureUnits","maxAttributes","maxVertexUniforms","maxVertexTextureUnits","maxVaryingVectors","maxFragmentUniforms","glsl","renderer","vendor","version","isNDArrayLike","stride","values","map","flattenUtils","array_","flatten","out_","nx","flatten1D","ny","ptr","row","flatten2D","flatten3D","flattenRec","level","nz","ptr_","col","k","arrayTypes","[object Int8Array]","[object Int16Array]","[object Int32Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Uint16Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","[object ArrayBuffer]","glTypes","int8","int16","int32","uint8","uint16","uint32","float","float32","usageTypes","stream","arrayFlatten","arrayShape","GL_STATIC_DRAW","GL_STREAM_DRAW","GL_UNSIGNED_BYTE$3","GL_FLOAT$3","DTYPES_SIZES","typedArrayCode","copyArray","inp","transpose","shapeX","shapeY","strideX","strideY","primTypes","points","point","triangles","triangle","line loop","line strip","triangle strip","triangle fan","GL_POINTS","GL_LINES","GL_TRIANGLES","GL_BYTE$2","GL_UNSIGNED_BYTE$4","GL_SHORT$2","GL_UNSIGNED_SHORT$2","GL_INT$2","GL_UNSIGNED_INT$2","GL_ELEMENT_ARRAY_BUFFER","GL_STREAM_DRAW$1","GL_STATIC_DRAW$1","FLOAT","INT","GL_UNSIGNED_SHORT$4","convertToHalfFloat","ushorts","isNaN","Infinity","sgn","exp","frac","isArrayLike","isPow2$1","GL_COMPRESSED_TEXTURE_FORMATS","GL_TEXTURE_2D$1","GL_TEXTURE_CUBE_MAP$1","GL_TEXTURE_CUBE_MAP_POSITIVE_X$1","GL_RGBA$1","GL_ALPHA","GL_RGB","GL_LUMINANCE","GL_LUMINANCE_ALPHA","GL_RGBA4","GL_RGB5_A1","GL_RGB565","GL_UNSIGNED_SHORT_4_4_4_4$1","GL_UNSIGNED_SHORT_5_5_5_1$1","GL_UNSIGNED_SHORT_5_6_5$1","GL_UNSIGNED_INT_24_8_WEBGL$1","GL_DEPTH_COMPONENT","GL_DEPTH_STENCIL","GL_SRGB_EXT","GL_SRGB_ALPHA_EXT","GL_HALF_FLOAT_OES$1","GL_COMPRESSED_RGB_S3TC_DXT1_EXT","GL_COMPRESSED_RGBA_S3TC_DXT1_EXT","GL_COMPRESSED_RGBA_S3TC_DXT3_EXT","GL_COMPRESSED_RGBA_S3TC_DXT5_EXT","GL_COMPRESSED_RGB_ATC_WEBGL","GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL","GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL","GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG","GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG","GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG","GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG","GL_COMPRESSED_RGB_ETC1_WEBGL","GL_UNSIGNED_BYTE$5","GL_UNSIGNED_SHORT$3","GL_UNSIGNED_INT$3","GL_FLOAT$4","GL_TEXTURE_WRAP_S","GL_TEXTURE_WRAP_T","GL_REPEAT","GL_CLAMP_TO_EDGE$1","GL_MIRRORED_REPEAT","GL_TEXTURE_MAG_FILTER","GL_TEXTURE_MIN_FILTER","GL_NEAREST$1","GL_LINEAR","GL_NEAREST_MIPMAP_NEAREST$1","GL_LINEAR_MIPMAP_NEAREST$1","GL_NEAREST_MIPMAP_LINEAR$1","GL_LINEAR_MIPMAP_LINEAR$1","GL_GENERATE_MIPMAP_HINT","GL_DONT_CARE","GL_FASTEST","GL_NICEST","GL_TEXTURE_MAX_ANISOTROPY_EXT","GL_UNPACK_ALIGNMENT","GL_UNPACK_FLIP_Y_WEBGL","GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL","GL_UNPACK_COLORSPACE_CONVERSION_WEBGL","GL_BROWSER_DEFAULT_WEBGL","GL_TEXTURE0$1","MIPMAP_FILTERS","CHANNELS_FORMAT","FORMAT_CHANNELS","objectName","CANVAS_CLASS","CONTEXT2D_CLASS","BITMAP_CLASS","IMAGE_CLASS","VIDEO_CLASS","PIXEL_CLASSES","TYPE_SIZES","FORMAT_SIZES_SPECIAL","isNumericArray","arr","isRectArray","classString","isCanvasElement","isPixelData","className","typedArrayCode$1","preConvert","image","postConvert","getTextureSize","isMipmap","isCube","total","createTextureSet","reglPoll","contextState","stats","config","mipmapHint","don't care","dont care","nice","fast","wrapModes","repeat","clamp","mirror","magFilters","nearest","linear","minFilters","mipmap","nearest mipmap nearest","linear mipmap nearest","nearest mipmap linear","linear mipmap linear","colorSpace","none","browser","textureTypes","rgba4","rgb565","rgb5 a1","textureFormats","alpha","luminance","luminance alpha","rgb","rgba","compressedTextureFormats","ext_srgb","srgb","srgba","oes_texture_half_float","webgl_depth_texture","depth stencil","webgl_compressed_texture_s3tc","rgb s3tc dxt1","rgba s3tc dxt1","rgba s3tc dxt3","rgba s3tc dxt5","webgl_compressed_texture_atc","rgb atc","rgba atc explicit alpha","rgba atc interpolated alpha","webgl_compressed_texture_pvrtc","rgb pvrtc 4bppv1","rgb pvrtc 2bppv1","rgba pvrtc 4bppv1","rgba pvrtc 2bppv1","webgl_compressed_texture_etc1","supportedCompressedFormats","slice","supportedFormats","textureFormatsInvert","val","textureTypesInvert","magFiltersInvert","minFiltersInvert","wrapModesInvert","colorFormats","reduce","glenum","TexFlags","premultiplyAlpha","flipY","copyFlags","other","parseFlags","flags","options","alignment","hasChannels","radius","hasFormat","formatStr","setFlags","pixelStorei","TexImage","xOffset","yOffset","needsFree","needsCopy","parseImage","y","viewW","viewportWidth","viewH","viewportHeight","converted","convertData","shapeC","strideC","transposeData","isBitmap","isImageElement","naturalWidth","naturalHeight","isVideoElement","videoWidth","videoHeight","dd","allocData","setImage","miplevel","compressedTexImage2D","copyTexImage2D","nullData","setSubImage","texSubImage2D","compressedTexSubImage2D","copyTexSubImage2D","imagePool","allocImage","freeImage","MipMap","parseMipMapFromShape","parseMipMapFromObject","imgData","setMipMap","mipPool","allocMipMap","freeMipMap","TexInfo","anisotropic","parseTexInfo","min","mag","wrap","optWrapS","optWrapT","hasMipMap","setTexInfo","texParameteri","hint","generateMipmap","textureCount","textureSet","numTexUnits","textureUnits","REGLTexture","refCount","unit","bindCount","texInfo","size","tempBind","tempRestore","prev","destroy","handle","params","unbind","decRef","getTotalTextureSize","create2D","b","reglTexture2D","subimage","x_","y_","level_","imageData","w_","h_","_w","_h","createCube","a0","a1","a2","a3","a4","a5","cubeCount","reglTextureCube","face_input","radius_","getTexture","wrapper","restore","tex","GL_RENDERBUFFER","GL_RGBA4$1","FORMAT_SIZES","getRenderbufferSize","wrapRenderbuffers","formatTypes","stencil","ext_color_buffer_half_float","webgl_color_buffer_float","formatTypesInvert","renderbufferCount","renderbufferSet","REGLRenderbuffer","rb","bindRenderbuffer","deleteRenderbuffer","getTotalRenderbufferSize","createRenderbuffer","reglRenderbuffer","renderbufferStorage","GL_FRAMEBUFFER$1","GL_RENDERBUFFER$1","GL_TEXTURE_2D$2","GL_TEXTURE_CUBE_MAP_POSITIVE_X$2","GL_COLOR_ATTACHMENT0$1","GL_DEPTH_ATTACHMENT","GL_STENCIL_ATTACHMENT","GL_DEPTH_STENCIL_ATTACHMENT","GL_FRAMEBUFFER_COMPLETE$1","GL_DEPTH_COMPONENT$1","colorTextureFormatEnums","textureFormatChannels","textureTypeSizes","GL_DEPTH_COMPONENT16$1","GL_STENCIL_INDEX8$1","GL_DEPTH_STENCIL$2","colorRenderbufferFormatEnums","statusCode","GL_FLOAT$6","AttributeRecord","state","z","normalized","divisor","GL_FRAGMENT_SHADER","GL_VERTEX_SHADER","GL_ACTIVE_UNIFORMS","GL_ACTIVE_ATTRIBUTES","GL_RGBA$3","GL_UNSIGNED_BYTE$7","GL_PACK_ALIGNMENT","GL_FLOAT$7","wrapReadPixels","framebufferState","context","glAttributes","readPixelsImpl","preserveDrawingBuffer","colorAttachments","framebufferWidth","framebufferHeight","setFBO","framebuffer","readPixelsFBO","CUTE_COMPONENTS","GL_UNSIGNED_BYTE$8","ATTRIB_STATE_POINTER","ATTRIB_STATE_CONSTANT","DYN_FUNC$1","DYN_PROP$1","DYN_CONTEXT$1","DYN_STATE$1","DYN_THUNK","S_DITHER","S_BLEND_ENABLE","S_BLEND_COLOR","S_BLEND_EQUATION","S_BLEND_FUNC","S_DEPTH_ENABLE","S_DEPTH_FUNC","S_DEPTH_RANGE","S_DEPTH_MASK","S_COLOR_MASK","S_CULL_ENABLE","S_CULL_FACE","S_FRONT_FACE","S_LINE_WIDTH","S_POLYGON_OFFSET_ENABLE","S_POLYGON_OFFSET_OFFSET","S_SAMPLE_ALPHA","S_SAMPLE_ENABLE","S_SAMPLE_COVERAGE","S_STENCIL_ENABLE","S_STENCIL_MASK","S_STENCIL_FUNC","S_STENCIL_OPFRONT","S_STENCIL_OPBACK","S_SCISSOR_ENABLE","S_SCISSOR_BOX","S_VIEWPORT","S_PROFILE","S_FRAMEBUFFER","S_VERT","S_FRAG","S_ELEMENTS","S_PRIMITIVE","S_COUNT","S_OFFSET","S_INSTANCES","S_FRAMEBUFFER_WIDTH","S_FRAMEBUFFER_HEIGHT","S_VIEWPORT_WIDTH","S_VIEWPORT_HEIGHT","S_DRAWINGBUFFER_WIDTH","S_DRAWINGBUFFER","S_DRAWINGBUFFER_HEIGHT","NESTED_OPTIONS","GL_ARRAY_BUFFER$1","GL_ELEMENT_ARRAY_BUFFER$1","GL_TEXTURE_2D$3","GL_TEXTURE_CUBE_MAP$2","GL_CULL_FACE","GL_BLEND","GL_DITHER","GL_STENCIL_TEST","GL_DEPTH_TEST","GL_SCISSOR_TEST","GL_POLYGON_OFFSET_FILL","GL_SAMPLE_ALPHA_TO_COVERAGE","GL_SAMPLE_COVERAGE","GL_FLOAT$8","GL_FLOAT_VEC2","GL_FLOAT_VEC3","GL_FLOAT_VEC4","GL_INT$3","GL_INT_VEC2","GL_INT_VEC3","GL_INT_VEC4","GL_BOOL","GL_BOOL_VEC2","GL_BOOL_VEC3","GL_BOOL_VEC4","GL_FLOAT_MAT2","GL_FLOAT_MAT3","GL_FLOAT_MAT4","GL_SAMPLER_2D","GL_SAMPLER_CUBE","GL_TRIANGLES$1","GL_FRONT","GL_BACK","GL_CW","GL_CCW","GL_MIN_EXT","GL_MAX_EXT","GL_ALWAYS","GL_KEEP","GL_ZERO","GL_ONE","GL_FUNC_ADD","GL_LESS","GL_FRAMEBUFFER$2","GL_COLOR_ATTACHMENT0$2","blendFuncs","1","one","src color","one minus src color","src alpha","one minus src alpha","dst color","one minus dst color","dst alpha","one minus dst alpha","constant color","one minus constant color","constant alpha","one minus constant alpha","src alpha saturate","invalidBlendCombinations","compareFuncs","never","less","<","equal","=","==","===","lequal","<=","greater",">","notequal","!=","!==","gequal",">=","always","stencilOps","keep","increment","decrement","increment wrap","decrement wrap","invert","shaderType","orientationType","cw","ccw","isBufferArgs","sortState","sort","Declaration","thisDep","contextDep","propDep","append","isStatic","decl","createStaticDecl","createDynamicDecl","dyn","numArgs","SCOPE_DECL","reglCore","bufferState","elementState","textureState","uniformState","attributeState","shaderState","drawState","timer","Record","blendEquations","add","subtract","reverse subtract","ext_blend_minmax","extInstancing","angle_instanced_arrays","extDrawBuffers","currentState","dirty","nextState","GL_STATE_NAMES","GL_FLAGS","GL_VARIABLES","propName","stateFlag","sname","cap","init","stateVariable","func","drawingBufferWidth","drawingBufferHeight","sharedState","current","sharedConstants","backBuffer","drawBuffer","drawCallCounter","createREGLEnvironment","env","varCounter","linkedNames","linkedValues","code","vars","arguments","def","scope","entry","exit","entryToString","exitToString","save","prop","globalBlock","procedures","global","link","proc","count","arg","bodyToString","cond","thenBlock","elseBlock","thenToString","elseToString","else","elseClause","compile","src","Function","createEnvironment","batchId","SHARED","shared","props","CHECK","commandStr","assert","nextVars","currentVars","variable","constants","JSON","stringify","invoke","argList","ref","attribCache","scopeAttribs","scopeAttrib","binding","parseArguments","staticOptions","dynamicOptions","KEY_NAMES","checkKeys","getFramebuffer","FRAMEBUFFER","CONTEXT","FRAMEBUFFER_FUNC","FRAMEBUFFER_STATE","parseFramebuffer","viewportAndScissor","parseBox","box","BOX_W","BOX_H","dynBox","BOX","BOX_X","BOX_Y","prevViewport","VIEWPORT","scissor_box","parseViewportScissor","getElements","ELEMENTS","IS_BUFFER_ARGS","ELEMENT_STATE","elementDefn","elementStream","ifte","parseElements","parseParam","isOffset","OFFSET","dynValue","primitive","dynPrimitive","PRIM_TYPES","prim","parsePrimitive","dynCount","MISSING","DYNAMIC","parseVertCount","instances","parseDraw","STATE","parseStatic","parseDynamic","COMPARE_FUNCS","srcRGB","srcAlpha","dstRGB","dst","dstAlpha","BLEND_FUNCS","read","prefix","suffix","INVALID_BLEND_COMBINATIONS","SRC_RGB","SRC_ALPHA","BLEND_EQUATIONS","RGB","ALPHA","checkProp","cmp","mask","fail","zfail","zpass","STENCIL_OPS","factor","units","sampleValue","sampleInvert","parseGLState","parseShader","progVar","fragId","vertId","SHADER_STATE","progDef","parseProgram","copyBox","defn","profileEnable","enable","parseProfile","staticUniforms","dynamicUniforms","UNIFORMS","reglType","parseUniforms","staticAttributes","dynamicAttributes","attributeDefs","attribute","record","getBuffer","constant","VALID_KEYS","dtype","cache","isStream","VALUE","BUFFER_STATE","defaultRecord","BUFFER","TYPE","emitReadRecord","parseAttributes","staticContext","dynamicContext","parseContext","emitContext","contextEnter","emitPollFramebuffer","skipCheck","EXT_DRAW_BUFFERS","GL","NEXT","DRAW_BUFFERS","BACK_BUFFER","emitPollState","CURRENT_VARS","NEXT_VARS","CURRENT_STATE","NEXT_STATE","CURRENT","emitSetOptions","flag","injectExtensions","instancing","emitProfile","useScope","incrementCounter","CPU_START","QUERY_COUNTER","USE_PROFILE","STATS","TIMER","profileArg","perfCounter","emitProfileStart","emitProfileEnd","scopeProfile","start","end","emitAttributes","ATTRIBUTE","LOCATION","BINDING","CONST_COMPONENTS","COMMON_KEYS","emitBuffer","SIZE","DIVISOR","emitConstant","emitBindAttribute","typeLength","emitUniforms","infix","uniform","UNIFORM","TEX_VALUE","MAT_VALUE","dim","checkType","checkVector","checkTexture","unroll","TEX","matSize","pow","STORAGE","emitDraw","outer","inner","DRAW_STATE","drawOptions","contextDynamic","emitElements","emitValue","INSTANCES","EXT_INSTANCING","PRIMITIVE","COUNT","emitCount","ELEMENT_TYPE","elementsStatic","emitInstancing","emitRegular","createBody","emitBody","parentEnv","emitDrawBody","emitBatchDynamicShaderBody","all","emitBatchBody","BATCH_ID","PROPS","isInnerDefn","isOuterDefn","needsContext","needsFramebuffer","progCache","PROGRAM","PROG_ID","CACHED_PROC","splatObject","isDynamicObject","globals","objectRef","deps","procs","poll","refresh","common","INSTANCING","drawCache","emitDrawProc","saveShader","opt","emitScopeProc","batch","progDefn","batchCache","emitBatchProc","GL_QUERY_RESULT_EXT","GL_QUERY_RESULT_AVAILABLE_EXT","GL_TIME_ELAPSED_EXT","createTimer","ext_disjoint_timer_query","queryPool","freeQuery","query","pendingQueries","PendingStats","startQueryIndex","endQueryIndex","sum","pendingStatsPool","freePendingStats","pendingStats","pushScopeStats","ps","timeSum","queryPtr","beginQuery","createQueryEXT","beginQueryEXT","endQuery","endQueryEXT","update","queryTime","getQueryObjectEXT","startPtr","endPtr","gpuTime","getNumPendingQueries","deleteQueryEXT","GL_COLOR_BUFFER_BIT","GL_DEPTH_BUFFER_BIT","GL_STENCIL_BUFFER_BIT","GL_ARRAY_BUFFER","CONTEXT_LOST_EVENT","CONTEXT_RESTORED_EVENT","DYN_PROP","DYN_CONTEXT","DYN_STATE","find","haystack","needle","getContextAttributes","contextLost","isContextLost","extensionState","tryLoadExtension","name_","getExtension","createExtensionCache","stringIds","stringValues","","stats$$1","bufferCount","elementsCount","framebufferCount","shaderCount","START_TIME","WIDTH","HEIGHT","time","NUM_ATTRIBUTES","attributeBindings","wrapAttributeState","bufferSet","REGLBuffer","createBuffer","usage","dimension","persistentData","bindBuffer","streamPool","initBufferFromTypedArray","bufferData","initBufferFromData","persist","flatData","typedData","disableVertexAttribArray","deleteBuffer","getTotalBufferSize","deferInit","persistent","reglBuffer","setSubData","bufferSubData","_buffer","subdata","offset_","createStream","destroyStream","stream$$1","_initBuffer","wrapBufferState","elementSet","elementCount","elementTypes","REGLElementBuffer","primType","vertCount","oes_element_index_uint","initElements","predictedType","destroyElements","reglElements","_elements","wrapElementsState","fragShaders","vertShaders","ActiveInfo","location","insertActiveInfo","getShader","createShader","shaderSource","compileShader","programCache","programList","PROGRAM_COUNTER","REGLProgram","uniformsCount","attributesCount","linkProgram","createProgram","attachShader","numUniforms","getActiveUniform","getUniformLocation","numAttributes","getActiveAttrib","getAttribLocation","getMaxUniformsCount","getMaxAttributesCount","deleteShader","deleteProgram","wrapShaderState","core","renderbufferState","cur","colorTextureFormats","colorRenderbufferFormats","colorTypes","FramebufferAttachment","incRefAndCheckShape","tw","th","attach","framebufferRenderbuffer","parseAttachment","allocAttachment","isTexture","unwrapAttachment","resizeAttachment","framebufferSet","REGLFramebuffer","depthAttachment","stencilAttachment","depthStencilAttachment","decFBORefs","updateFramebuffer","status","createFBO","reglFramebuffer","needsDepth","needsStencil","colorBuffer","colorTexture","colorFormat","colorType","colorCount","depthBuffer","stencilBuffer","depthStencilBuffer","depthStencilTexture","depthTexture","depthStencil","commonColorAttachmentSize","colorAttachmentSize","_framebuffer","use","reglFramebufferCube","colorCubes","cubeMapParams","cube","fb","wrapFBOState","rafCallbacks","lossCallbacks","restoreCallbacks","destroyCallbacks","activeRAF","handleRAF","flush","startRAF","stopRAF","handleContextLoss","preventDefault","handleContextRestored","compileProcedure","separateDynamic","staticItems","dynamicItems","option","merge","child","op","opBack","opFront","flattenNestedOptions","cpuTime","compiled","EMPTY_ARRAY","reserve","clearImpl","_","clearFlags","clearDepth","clearStencil","pendingCancel","pollViewport","scissorBox","framebuffer_reglType","framebufferCube","on","callback","callbacks","hasExtension","_gl","_refresh","factory","mouseChange","mouseWheel","identity","perspective","lookAt","props_","noScroll","cameraState","view","projection","theta","phi","eye","up","fovy","PI","near","far","dtheta","dphi","rotationSpeed","zoomSpeed","renderOnDirty","undefined","damping","front","minDistance","maxDistance","ddistance","prevX","prevY","isBrowser","mouse","getHeight","offsetHeight","buttons","dx","offsetWidth","dy","damp","xd","abs","lo","hi","injectContext","assign","setupCamera","vf","vr","vu","updateCamera","buttonState","mods","alt","control","meta","attached","updateMods","ev","changed","altKey","shiftKey","ctrlKey","metaKey","handleEvent","nextButtons","nextX","nextY","clearState","handleBlur","handleMods","handleMouseMove","handleMouseDown","handleMouseUp","attachListeners","defineProperties","enabled","mouseElement","srcElement","which","button","offsetX","clientX","offsetY","clientY","toPX","lineHeight","listener","deltaX","deltaY","dz","deltaZ","deltaMode","scale","parseUnit","PIXELS_PER_INCH","getSizeBrutal","getPropertyInPX","getComputedStyle","getPropertyValue","testDIV","clientHeight","px","String","num","parseFloat","match","aspect","tan","nf","x0","x1","x2","y0","y1","y2","z0","z1","z2","len","eyex","eyey","eyez","upx","upy","upz","centerx","centery","centerz","sqrt"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,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,EAAA,KACAA,EAAA,GAAA+qD,EACA/qD,EAAA,GAAAkrD,EACAlrD,EAAA,IAAAqrD,EACArrD,EAAA,MACAA,EAAA,MAAA6qD,EAAAU,EAAAT,EAAAU,EAAAT,EAAAU,GACAzrD,EAAA,MAAAgrD,EAAAO,EAAAN,EAAAO,EAAAN,EAAAO,GACAzrD,EAAA,MAAAmrD,EAAAI,EAAAH,EAAAI,EAAAH,EAAAI,GACAzrD,EAAA,MAEAA","file":"main.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 16);\n","module.exports = __webpack_public_path__ + \"dcbe4e47e8a4cb4c76f00dc2ca584ea3.bin\";","module.exports = identity;\n\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n};","module.exports = __webpack_public_path__ + \"8c72ff38eff4b3d878b6e59563fb2558.bin\";","module.exports = __webpack_public_path__ + \"c40f782b6d48c16bbdfa867a67914314.bin\";","module.exports = __webpack_public_path__ + \"670398984b2a839f0da3039cd8ae215a.bin\";","module.exports = __webpack_public_path__ + \"4cc86edf6517c35dd8aecdbf6a4b1a2e.bin\";","module.exports = __webpack_public_path__ + \"aad316ae2f3185e637764ab20f4536ee.bin\";","module.exports = __webpack_public_path__ + \"c5d1e42d1b2c2960ef12ca75b5e71fc1.bin\";","module.exports = __webpack_public_path__ + \"80e3348d39fbc859dfe0bb2cda08c5b1.bin\";","module.exports = __webpack_public_path__ + \"8ab0cc172cd882ef6b69422eaa5a502d.bin\";","module.exports = __webpack_public_path__ + \"88a1fb4d8c42c36a027c7ab503de7511.bin\";","module.exports = __webpack_public_path__ + \"a7a417e76651f9fa75e63e45e22095e6.bin\";","module.exports = __webpack_public_path__ + \"b8f9c879c9c795656294aa401ac3854c.bin\";","module.exports = __webpack_public_path__ + \"5293ee29e3db7bbd05f03823aa9bd53a.bin\";","module.exports = __webpack_public_path__ + \"6f2d59ca82e22144ee26889cc862912f.bin\";","module.exports = __webpack_public_path__ + \"f988ae2257d2f750090c9bda21c58f10.bin\";","import hexsphere_0 from \"./shapes/hexsphere_r1_d0.bin\"\nimport hexsphere_1 from \"./shapes/hexsphere_r1_d1.bin\"\nimport hexsphere_2 from \"./shapes/hexsphere_r1_d2.bin\"\nimport hexsphere_3 from \"./shapes/hexsphere_r1_d3.bin\"\nimport hexsphere_4 from \"./shapes/hexsphere_r1_d4.bin\"\nimport hexsphere_5 from \"./shapes/hexsphere_r1_d5.bin\"\nimport hexsphere_6 from \"./shapes/hexsphere_r1_d6.bin\"\nimport icosahedron_0 from \"./shapes/icosahedron_r1_d0.bin\"\nimport icosahedron_1 from \"./shapes/icosahedron_r1_d1.bin\"\nimport icosahedron_2 from \"./shapes/icosahedron_r1_d2.bin\"\nimport icosahedron_3 from \"./shapes/icosahedron_r1_d3.bin\"\nimport icosahedron_4 from \"./shapes/icosahedron_r1_d4.bin\"\nimport icosahedron_5 from \"./shapes/icosahedron_r1_d5.bin\"\nimport icosahedron_6 from \"./shapes/icosahedron_r1_d6.bin\"\nimport icosahedron_7 from \"./shapes/icosahedron_r1_d7.bin\"\n\nconst shapes = {\n \"hexsphere_0\": hexsphere_0,\n \"hexsphere_1\": hexsphere_1,\n \"hexsphere_2\": hexsphere_2,\n \"hexsphere_3\": hexsphere_3,\n \"hexsphere_4\": hexsphere_4,\n \"hexsphere_5\": hexsphere_5,\n \"hexsphere_6\": hexsphere_6,\n \"icosahedron_0\": icosahedron_0,\n \"icosahedron_1\": icosahedron_1,\n \"icosahedron_2\": icosahedron_2,\n \"icosahedron_3\": icosahedron_3,\n \"icosahedron_4\": icosahedron_4,\n \"icosahedron_5\": icosahedron_5,\n \"icosahedron_6\": icosahedron_6,\n \"icosahedron_7\": icosahedron_7,\n}\n\nconst regl = require(\"regl\")({\n extensions: [\"OES_element_index_uint\"],\n})\nconst camera = require(\"regl-camera\")(regl, {\n center: [0, 0, 0],\n distance: 3,\n})\n\nconst drawShape = hexsphere => regl({\n vert: `\n precision mediump float;\n uniform mat4 projection, view;\n attribute vec3 position, normal, color;\n varying vec3 fragNormal, fragPosition, fragColor;\n void main() {\n fragNormal = normal;\n fragPosition = position;\n fragColor = color;\n gl_Position = projection * view * vec4(position, 1.0);\n }`,\n\n frag: `\n precision mediump float;\n struct Light {\n vec3 color;\n vec3 position;\n };\n uniform Light lights[1];\n varying vec3 fragNormal, fragPosition, fragColor;\n void main() {\n vec3 normal = normalize(fragNormal);\n vec3 light = vec3(0.1, 0.1, 0.1);\n for (int i = 0; i < 1; i++) {\n vec3 lightDir = normalize(lights[i].position - fragPosition);\n float diffuse = max(0.0, dot(lightDir, normal));\n light += diffuse * lights[i].color;\n }\n gl_FragColor = vec4(fragColor * light, 1.0);\n }`,\n\n attributes: {\n position: hexsphere.positions,\n normal: hexsphere.normals,\n color: hexsphere.colors,\n },\n elements: hexsphere.cells,\n uniforms: {\n \"lights[0].color\": [1, 1, 1],\n \"lights[0].position\": ({ tick }) => {\n const t = 0.008 * tick\n return [\n 1000 * Math.cos(t),\n 1000 * Math.sin(t),\n 1000 * Math.sin(t)\n ]\n },\n },\n})\n\nlet draw = null\n\nconst loadShape = shape => {\n fetch(shape)\n .then(response => response.arrayBuffer())\n .then(buffer => {\n let reader = new DataView(buffer);\n let numVertices = reader.getUint32(0, true);\n let numCells = reader.getUint32(4, true);\n const shapeData = {\n positions: new Float32Array(buffer, 8, numVertices * 3),\n normals: new Float32Array(buffer, numVertices * 12 + 8, numVertices * 3),\n colors: new Float32Array(buffer, numVertices * 24 + 8, numVertices * 3),\n cells: new Uint32Array(buffer, numVertices * 36 + 8, numCells * 3),\n }\n draw = drawShape(shapeData)\n regl.frame(() => {\n regl.clear({\n depth: 1,\n color: [0, 0, 0, 1]\n })\n\n camera(() => {\n draw()\n })\n })\n shapeSelectLoading.style.display = \"none\"\n })\n}\n\nconst shapeSelect = document.querySelector(\"select#shape-select\")\nconst shapeSelectLoading = document.querySelector(\"#shape-loading\")\nshapeSelect.value = \"hexsphere_4\"\nloadShape(hexsphere_4)\n\nshapeSelect.addEventListener(\"change\", event => {\n shapeSelectLoading.style.display = \"inline\"\n loadShape(shapes[event.target.value])\n})\n","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.createREGL = factory());\n}(this, (function () { 'use strict';\n\nvar isTypedArray = function (x) {\r\n return (\r\n x instanceof Uint8Array ||\r\n x instanceof Uint16Array ||\r\n x instanceof Uint32Array ||\r\n x instanceof Int8Array ||\r\n x instanceof Int16Array ||\r\n x instanceof Int32Array ||\r\n x instanceof Float32Array ||\r\n x instanceof Float64Array ||\r\n x instanceof Uint8ClampedArray\r\n )\r\n};\n\nvar extend = function (base, opts) {\r\n var keys = Object.keys(opts);\r\n for (var i = 0; i < keys.length; ++i) {\r\n base[keys[i]] = opts[keys[i]];\r\n }\r\n return base\r\n};\n\n// Error checking and parameter validation.\r\n//\r\n// Statements for the form `check.someProcedure(...)` get removed by\r\n// a browserify transform for optimized/minified bundles.\r\n//\r\n/* globals atob */\r\nvar endl = '\\n';\r\n\r\n// only used for extracting shader names. if atob not present, then errors\r\n// will be slightly crappier\r\nfunction decodeB64 (str) {\r\n if (typeof atob !== 'undefined') {\r\n return atob(str)\r\n }\r\n return 'base64:' + str\r\n}\r\n\r\nfunction raise (message) {\r\n var error = new Error('(regl) ' + message);\r\n console.error(error);\r\n throw error\r\n}\r\n\r\nfunction check (pred, message) {\r\n if (!pred) {\r\n raise(message);\r\n }\r\n}\r\n\r\nfunction encolon (message) {\r\n if (message) {\r\n return ': ' + message\r\n }\r\n return ''\r\n}\r\n\r\nfunction checkParameter (param, possibilities, message) {\r\n if (!(param in possibilities)) {\r\n raise('unknown parameter (' + param + ')' + encolon(message) +\r\n '. possible values: ' + Object.keys(possibilities).join());\r\n }\r\n}\r\n\r\nfunction checkIsTypedArray (data, message) {\r\n if (!isTypedArray(data)) {\r\n raise(\r\n 'invalid parameter type' + encolon(message) +\r\n '. must be a typed array');\r\n }\r\n}\r\n\r\nfunction checkTypeOf (value, type, message) {\r\n if (typeof value !== type) {\r\n raise(\r\n 'invalid parameter type' + encolon(message) +\r\n '. expected ' + type + ', got ' + (typeof value));\r\n }\r\n}\r\n\r\nfunction checkNonNegativeInt (value, message) {\r\n if (!((value >= 0) &&\r\n ((value | 0) === value))) {\r\n raise('invalid parameter type, (' + value + ')' + encolon(message) +\r\n '. must be a nonnegative integer');\r\n }\r\n}\r\n\r\nfunction checkOneOf (value, list, message) {\r\n if (list.indexOf(value) < 0) {\r\n raise('invalid value' + encolon(message) + '. must be one of: ' + list);\r\n }\r\n}\r\n\r\nvar constructorKeys = [\r\n 'gl',\r\n 'canvas',\r\n 'container',\r\n 'attributes',\r\n 'pixelRatio',\r\n 'extensions',\r\n 'optionalExtensions',\r\n 'profile',\r\n 'onDone'\r\n];\r\n\r\nfunction checkConstructor (obj) {\r\n Object.keys(obj).forEach(function (key) {\r\n if (constructorKeys.indexOf(key) < 0) {\r\n raise('invalid regl constructor argument \"' + key + '\". must be one of ' + constructorKeys);\r\n }\r\n });\r\n}\r\n\r\nfunction leftPad (str, n) {\r\n str = str + '';\r\n while (str.length < n) {\r\n str = ' ' + str;\r\n }\r\n return str\r\n}\r\n\r\nfunction ShaderFile () {\r\n this.name = 'unknown';\r\n this.lines = [];\r\n this.index = {};\r\n this.hasErrors = false;\r\n}\r\n\r\nfunction ShaderLine (number, line) {\r\n this.number = number;\r\n this.line = line;\r\n this.errors = [];\r\n}\r\n\r\nfunction ShaderError (fileNumber, lineNumber, message) {\r\n this.file = fileNumber;\r\n this.line = lineNumber;\r\n this.message = message;\r\n}\r\n\r\nfunction guessCommand () {\r\n var error = new Error();\r\n var stack = (error.stack || error).toString();\r\n var pat = /compileProcedure.*\\n\\s*at.*\\((.*)\\)/.exec(stack);\r\n if (pat) {\r\n return pat[1]\r\n }\r\n var pat2 = /compileProcedure.*\\n\\s*at\\s+(.*)(\\n|$)/.exec(stack);\r\n if (pat2) {\r\n return pat2[1]\r\n }\r\n return 'unknown'\r\n}\r\n\r\nfunction guessCallSite () {\r\n var error = new Error();\r\n var stack = (error.stack || error).toString();\r\n var pat = /at REGLCommand.*\\n\\s+at.*\\((.*)\\)/.exec(stack);\r\n if (pat) {\r\n return pat[1]\r\n }\r\n var pat2 = /at REGLCommand.*\\n\\s+at\\s+(.*)\\n/.exec(stack);\r\n if (pat2) {\r\n return pat2[1]\r\n }\r\n return 'unknown'\r\n}\r\n\r\nfunction parseSource (source, command) {\r\n var lines = source.split('\\n');\r\n var lineNumber = 1;\r\n var fileNumber = 0;\r\n var files = {\r\n unknown: new ShaderFile(),\r\n 0: new ShaderFile()\r\n };\r\n files.unknown.name = files[0].name = command || guessCommand();\r\n files.unknown.lines.push(new ShaderLine(0, ''));\r\n for (var i = 0; i < lines.length; ++i) {\r\n var line = lines[i];\r\n var parts = /^\\s*\\#\\s*(\\w+)\\s+(.+)\\s*$/.exec(line);\r\n if (parts) {\r\n switch (parts[1]) {\r\n case 'line':\r\n var lineNumberInfo = /(\\d+)(\\s+\\d+)?/.exec(parts[2]);\r\n if (lineNumberInfo) {\r\n lineNumber = lineNumberInfo[1] | 0;\r\n if (lineNumberInfo[2]) {\r\n fileNumber = lineNumberInfo[2] | 0;\r\n if (!(fileNumber in files)) {\r\n files[fileNumber] = new ShaderFile();\r\n }\r\n }\r\n }\r\n break\r\n case 'define':\r\n var nameInfo = /SHADER_NAME(_B64)?\\s+(.*)$/.exec(parts[2]);\r\n if (nameInfo) {\r\n files[fileNumber].name = (nameInfo[1]\r\n ? decodeB64(nameInfo[2])\r\n : nameInfo[2]);\r\n }\r\n break\r\n }\r\n }\r\n files[fileNumber].lines.push(new ShaderLine(lineNumber++, line));\r\n }\r\n Object.keys(files).forEach(function (fileNumber) {\r\n var file = files[fileNumber];\r\n file.lines.forEach(function (line) {\r\n file.index[line.number] = line;\r\n });\r\n });\r\n return files\r\n}\r\n\r\nfunction parseErrorLog (errLog) {\r\n var result = [];\r\n errLog.split('\\n').forEach(function (errMsg) {\r\n if (errMsg.length < 5) {\r\n return\r\n }\r\n var parts = /^ERROR\\:\\s+(\\d+)\\:(\\d+)\\:\\s*(.*)$/.exec(errMsg);\r\n if (parts) {\r\n result.push(new ShaderError(\r\n parts[1] | 0,\r\n parts[2] | 0,\r\n parts[3].trim()));\r\n } else if (errMsg.length > 0) {\r\n result.push(new ShaderError('unknown', 0, errMsg));\r\n }\r\n });\r\n return result\r\n}\r\n\r\nfunction annotateFiles (files, errors) {\r\n errors.forEach(function (error) {\r\n var file = files[error.file];\r\n if (file) {\r\n var line = file.index[error.line];\r\n if (line) {\r\n line.errors.push(error);\r\n file.hasErrors = true;\r\n return\r\n }\r\n }\r\n files.unknown.hasErrors = true;\r\n files.unknown.lines[0].errors.push(error);\r\n });\r\n}\r\n\r\nfunction checkShaderError (gl, shader, source, type, command) {\r\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n var errLog = gl.getShaderInfoLog(shader);\r\n var typeName = type === gl.FRAGMENT_SHADER ? 'fragment' : 'vertex';\r\n checkCommandType(source, 'string', typeName + ' shader source must be a string', command);\r\n var files = parseSource(source, command);\r\n var errors = parseErrorLog(errLog);\r\n annotateFiles(files, errors);\r\n\r\n Object.keys(files).forEach(function (fileNumber) {\r\n var file = files[fileNumber];\r\n if (!file.hasErrors) {\r\n return\r\n }\r\n\r\n var strings = [''];\r\n var styles = [''];\r\n\r\n function push (str, style) {\r\n strings.push(str);\r\n styles.push(style || '');\r\n }\r\n\r\n push('file number ' + fileNumber + ': ' + file.name + '\\n', 'color:red;text-decoration:underline;font-weight:bold');\r\n\r\n file.lines.forEach(function (line) {\r\n if (line.errors.length > 0) {\r\n push(leftPad(line.number, 4) + '| ', 'background-color:yellow; font-weight:bold');\r\n push(line.line + endl, 'color:red; background-color:yellow; font-weight:bold');\r\n\r\n // try to guess token\r\n var offset = 0;\r\n line.errors.forEach(function (error) {\r\n var message = error.message;\r\n var token = /^\\s*\\'(.*)\\'\\s*\\:\\s*(.*)$/.exec(message);\r\n if (token) {\r\n var tokenPat = token[1];\r\n message = token[2];\r\n switch (tokenPat) {\r\n case 'assign':\r\n tokenPat = '=';\r\n break\r\n }\r\n offset = Math.max(line.line.indexOf(tokenPat, offset), 0);\r\n } else {\r\n offset = 0;\r\n }\r\n\r\n push(leftPad('| ', 6));\r\n push(leftPad('^^^', offset + 3) + endl, 'font-weight:bold');\r\n push(leftPad('| ', 6));\r\n push(message + endl, 'font-weight:bold');\r\n });\r\n push(leftPad('| ', 6) + endl);\r\n } else {\r\n push(leftPad(line.number, 4) + '| ');\r\n push(line.line + endl, 'color:red');\r\n }\r\n });\r\n if (typeof document !== 'undefined' && !window.chrome) {\r\n styles[0] = strings.join('%c');\r\n console.log.apply(console, styles);\r\n } else {\r\n console.log(strings.join(''));\r\n }\r\n });\r\n\r\n check.raise('Error compiling ' + typeName + ' shader, ' + files[0].name);\r\n }\r\n}\r\n\r\nfunction checkLinkError (gl, program, fragShader, vertShader, command) {\r\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\r\n var errLog = gl.getProgramInfoLog(program);\r\n var fragParse = parseSource(fragShader, command);\r\n var vertParse = parseSource(vertShader, command);\r\n\r\n var header = 'Error linking program with vertex shader, \"' +\r\n vertParse[0].name + '\", and fragment shader \"' + fragParse[0].name + '\"';\r\n\r\n if (typeof document !== 'undefined') {\r\n console.log('%c' + header + endl + '%c' + errLog,\r\n 'color:red;text-decoration:underline;font-weight:bold',\r\n 'color:red');\r\n } else {\r\n console.log(header + endl + errLog);\r\n }\r\n check.raise(header);\r\n }\r\n}\r\n\r\nfunction saveCommandRef (object) {\r\n object._commandRef = guessCommand();\r\n}\r\n\r\nfunction saveDrawCommandInfo (opts, uniforms, attributes, stringStore) {\r\n saveCommandRef(opts);\r\n\r\n function id (str) {\r\n if (str) {\r\n return stringStore.id(str)\r\n }\r\n return 0\r\n }\r\n opts._fragId = id(opts.static.frag);\r\n opts._vertId = id(opts.static.vert);\r\n\r\n function addProps (dict, set) {\r\n Object.keys(set).forEach(function (u) {\r\n dict[stringStore.id(u)] = true;\r\n });\r\n }\r\n\r\n var uniformSet = opts._uniformSet = {};\r\n addProps(uniformSet, uniforms.static);\r\n addProps(uniformSet, uniforms.dynamic);\r\n\r\n var attributeSet = opts._attributeSet = {};\r\n addProps(attributeSet, attributes.static);\r\n addProps(attributeSet, attributes.dynamic);\r\n\r\n opts._hasCount = (\r\n 'count' in opts.static ||\r\n 'count' in opts.dynamic ||\r\n 'elements' in opts.static ||\r\n 'elements' in opts.dynamic);\r\n}\r\n\r\nfunction commandRaise (message, command) {\r\n var callSite = guessCallSite();\r\n raise(message +\r\n ' in command ' + (command || guessCommand()) +\r\n (callSite === 'unknown' ? '' : ' called from ' + callSite));\r\n}\r\n\r\nfunction checkCommand (pred, message, command) {\r\n if (!pred) {\r\n commandRaise(message, command || guessCommand());\r\n }\r\n}\r\n\r\nfunction checkParameterCommand (param, possibilities, message, command) {\r\n if (!(param in possibilities)) {\r\n commandRaise(\r\n 'unknown parameter (' + param + ')' + encolon(message) +\r\n '. possible values: ' + Object.keys(possibilities).join(),\r\n command || guessCommand());\r\n }\r\n}\r\n\r\nfunction checkCommandType (value, type, message, command) {\r\n if (typeof value !== type) {\r\n commandRaise(\r\n 'invalid parameter type' + encolon(message) +\r\n '. expected ' + type + ', got ' + (typeof value),\r\n command || guessCommand());\r\n }\r\n}\r\n\r\nfunction checkOptional (block) {\r\n block();\r\n}\r\n\r\nfunction checkFramebufferFormat (attachment, texFormats, rbFormats) {\r\n if (attachment.texture) {\r\n checkOneOf(\r\n attachment.texture._texture.internalformat,\r\n texFormats,\r\n 'unsupported texture format for attachment');\r\n } else {\r\n checkOneOf(\r\n attachment.renderbuffer._renderbuffer.format,\r\n rbFormats,\r\n 'unsupported renderbuffer format for attachment');\r\n }\r\n}\r\n\r\nvar GL_CLAMP_TO_EDGE = 0x812F;\r\n\r\nvar GL_NEAREST = 0x2600;\r\nvar GL_NEAREST_MIPMAP_NEAREST = 0x2700;\r\nvar GL_LINEAR_MIPMAP_NEAREST = 0x2701;\r\nvar GL_NEAREST_MIPMAP_LINEAR = 0x2702;\r\nvar GL_LINEAR_MIPMAP_LINEAR = 0x2703;\r\n\r\nvar GL_BYTE = 5120;\r\nvar GL_UNSIGNED_BYTE = 5121;\r\nvar GL_SHORT = 5122;\r\nvar GL_UNSIGNED_SHORT = 5123;\r\nvar GL_INT = 5124;\r\nvar GL_UNSIGNED_INT = 5125;\r\nvar GL_FLOAT = 5126;\r\n\r\nvar GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;\r\nvar GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;\r\nvar GL_UNSIGNED_SHORT_5_6_5 = 0x8363;\r\nvar GL_UNSIGNED_INT_24_8_WEBGL = 0x84FA;\r\n\r\nvar GL_HALF_FLOAT_OES = 0x8D61;\r\n\r\nvar TYPE_SIZE = {};\r\n\r\nTYPE_SIZE[GL_BYTE] =\r\nTYPE_SIZE[GL_UNSIGNED_BYTE] = 1;\r\n\r\nTYPE_SIZE[GL_SHORT] =\r\nTYPE_SIZE[GL_UNSIGNED_SHORT] =\r\nTYPE_SIZE[GL_HALF_FLOAT_OES] =\r\nTYPE_SIZE[GL_UNSIGNED_SHORT_5_6_5] =\r\nTYPE_SIZE[GL_UNSIGNED_SHORT_4_4_4_4] =\r\nTYPE_SIZE[GL_UNSIGNED_SHORT_5_5_5_1] = 2;\r\n\r\nTYPE_SIZE[GL_INT] =\r\nTYPE_SIZE[GL_UNSIGNED_INT] =\r\nTYPE_SIZE[GL_FLOAT] =\r\nTYPE_SIZE[GL_UNSIGNED_INT_24_8_WEBGL] = 4;\r\n\r\nfunction pixelSize (type, channels) {\r\n if (type === GL_UNSIGNED_SHORT_5_5_5_1 ||\r\n type === GL_UNSIGNED_SHORT_4_4_4_4 ||\r\n type === GL_UNSIGNED_SHORT_5_6_5) {\r\n return 2\r\n } else if (type === GL_UNSIGNED_INT_24_8_WEBGL) {\r\n return 4\r\n } else {\r\n return TYPE_SIZE[type] * channels\r\n }\r\n}\r\n\r\nfunction isPow2 (v) {\r\n return !(v & (v - 1)) && (!!v)\r\n}\r\n\r\nfunction checkTexture2D (info, mipData, limits) {\r\n var i;\r\n var w = mipData.width;\r\n var h = mipData.height;\r\n var c = mipData.channels;\r\n\r\n // Check texture shape\r\n check(w > 0 && w <= limits.maxTextureSize &&\r\n h > 0 && h <= limits.maxTextureSize,\r\n 'invalid texture shape');\r\n\r\n // check wrap mode\r\n if (info.wrapS !== GL_CLAMP_TO_EDGE || info.wrapT !== GL_CLAMP_TO_EDGE) {\r\n check(isPow2(w) && isPow2(h),\r\n 'incompatible wrap mode for texture, both width and height must be power of 2');\r\n }\r\n\r\n if (mipData.mipmask === 1) {\r\n if (w !== 1 && h !== 1) {\r\n check(\r\n info.minFilter !== GL_NEAREST_MIPMAP_NEAREST &&\r\n info.minFilter !== GL_NEAREST_MIPMAP_LINEAR &&\r\n info.minFilter !== GL_LINEAR_MIPMAP_NEAREST &&\r\n info.minFilter !== GL_LINEAR_MIPMAP_LINEAR,\r\n 'min filter requires mipmap');\r\n }\r\n } else {\r\n // texture must be power of 2\r\n check(isPow2(w) && isPow2(h),\r\n 'texture must be a square power of 2 to support mipmapping');\r\n check(mipData.mipmask === (w << 1) - 1,\r\n 'missing or incomplete mipmap data');\r\n }\r\n\r\n if (mipData.type === GL_FLOAT) {\r\n if (limits.extensions.indexOf('oes_texture_float_linear') < 0) {\r\n check(info.minFilter === GL_NEAREST && info.magFilter === GL_NEAREST,\r\n 'filter not supported, must enable oes_texture_float_linear');\r\n }\r\n check(!info.genMipmaps,\r\n 'mipmap generation not supported with float textures');\r\n }\r\n\r\n // check image complete\r\n var mipimages = mipData.images;\r\n for (i = 0; i < 16; ++i) {\r\n if (mipimages[i]) {\r\n var mw = w >> i;\r\n var mh = h >> i;\r\n check(mipData.mipmask & (1 << i), 'missing mipmap data');\r\n\r\n var img = mipimages[i];\r\n\r\n check(\r\n img.width === mw &&\r\n img.height === mh,\r\n 'invalid shape for mip images');\r\n\r\n check(\r\n img.format === mipData.format &&\r\n img.internalformat === mipData.internalformat &&\r\n img.type === mipData.type,\r\n 'incompatible type for mip image');\r\n\r\n if (img.compressed) {\r\n // TODO: check size for compressed images\r\n } else if (img.data) {\r\n // check(img.data.byteLength === mw * mh *\r\n // Math.max(pixelSize(img.type, c), img.unpackAlignment),\r\n var rowSize = Math.ceil(pixelSize(img.type, c) * mw / img.unpackAlignment) * img.unpackAlignment;\r\n check(img.data.byteLength === rowSize * mh,\r\n 'invalid data for image, buffer size is inconsistent with image format');\r\n } else if (img.element) {\r\n // TODO: check element can be loaded\r\n } else if (img.copy) {\r\n // TODO: check compatible format and type\r\n }\r\n } else if (!info.genMipmaps) {\r\n check((mipData.mipmask & (1 << i)) === 0, 'extra mipmap data');\r\n }\r\n }\r\n\r\n if (mipData.compressed) {\r\n check(!info.genMipmaps,\r\n 'mipmap generation for compressed images not supported');\r\n }\r\n}\r\n\r\nfunction checkTextureCube (texture, info, faces, limits) {\r\n var w = texture.width;\r\n var h = texture.height;\r\n var c = texture.channels;\r\n\r\n // Check texture shape\r\n check(\r\n w > 0 && w <= limits.maxTextureSize && h > 0 && h <= limits.maxTextureSize,\r\n 'invalid texture shape');\r\n check(\r\n w === h,\r\n 'cube map must be square');\r\n check(\r\n info.wrapS === GL_CLAMP_TO_EDGE && info.wrapT === GL_CLAMP_TO_EDGE,\r\n 'wrap mode not supported by cube map');\r\n\r\n for (var i = 0; i < faces.length; ++i) {\r\n var face = faces[i];\r\n check(\r\n face.width === w && face.height === h,\r\n 'inconsistent cube map face shape');\r\n\r\n if (info.genMipmaps) {\r\n check(!face.compressed,\r\n 'can not generate mipmap for compressed textures');\r\n check(face.mipmask === 1,\r\n 'can not specify mipmaps and generate mipmaps');\r\n } else {\r\n // TODO: check mip and filter mode\r\n }\r\n\r\n var mipmaps = face.images;\r\n for (var j = 0; j < 16; ++j) {\r\n var img = mipmaps[j];\r\n if (img) {\r\n var mw = w >> j;\r\n var mh = h >> j;\r\n check(face.mipmask & (1 << j), 'missing mipmap data');\r\n check(\r\n img.width === mw &&\r\n img.height === mh,\r\n 'invalid shape for mip images');\r\n check(\r\n img.format === texture.format &&\r\n img.internalformat === texture.internalformat &&\r\n img.type === texture.type,\r\n 'incompatible type for mip image');\r\n\r\n if (img.compressed) {\r\n // TODO: check size for compressed images\r\n } else if (img.data) {\r\n check(img.data.byteLength === mw * mh *\r\n Math.max(pixelSize(img.type, c), img.unpackAlignment),\r\n 'invalid data for image, buffer size is inconsistent with image format');\r\n } else if (img.element) {\r\n // TODO: check element can be loaded\r\n } else if (img.copy) {\r\n // TODO: check compatible format and type\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nvar check$1 = extend(check, {\r\n optional: checkOptional,\r\n raise: raise,\r\n commandRaise: commandRaise,\r\n command: checkCommand,\r\n parameter: checkParameter,\r\n commandParameter: checkParameterCommand,\r\n constructor: checkConstructor,\r\n type: checkTypeOf,\r\n commandType: checkCommandType,\r\n isTypedArray: checkIsTypedArray,\r\n nni: checkNonNegativeInt,\r\n oneOf: checkOneOf,\r\n shaderError: checkShaderError,\r\n linkError: checkLinkError,\r\n callSite: guessCallSite,\r\n saveCommandRef: saveCommandRef,\r\n saveDrawInfo: saveDrawCommandInfo,\r\n framebufferFormat: checkFramebufferFormat,\r\n guessCommand: guessCommand,\r\n texture2D: checkTexture2D,\r\n textureCube: checkTextureCube\r\n});\n\nvar VARIABLE_COUNTER = 0;\r\n\r\nvar DYN_FUNC = 0;\r\n\r\nfunction DynamicVariable (type, data) {\r\n this.id = (VARIABLE_COUNTER++);\r\n this.type = type;\r\n this.data = data;\r\n}\r\n\r\nfunction escapeStr (str) {\r\n return str.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\r\n}\r\n\r\nfunction splitParts (str) {\r\n if (str.length === 0) {\r\n return []\r\n }\r\n\r\n var firstChar = str.charAt(0);\r\n var lastChar = str.charAt(str.length - 1);\r\n\r\n if (str.length > 1 &&\r\n firstChar === lastChar &&\r\n (firstChar === '\"' || firstChar === \"'\")) {\r\n return ['\"' + escapeStr(str.substr(1, str.length - 2)) + '\"']\r\n }\r\n\r\n var parts = /\\[(false|true|null|\\d+|'[^']*'|\"[^\"]*\")\\]/.exec(str);\r\n if (parts) {\r\n return (\r\n splitParts(str.substr(0, parts.index))\r\n .concat(splitParts(parts[1]))\r\n .concat(splitParts(str.substr(parts.index + parts[0].length)))\r\n )\r\n }\r\n\r\n var subparts = str.split('.');\r\n if (subparts.length === 1) {\r\n return ['\"' + escapeStr(str) + '\"']\r\n }\r\n\r\n var result = [];\r\n for (var i = 0; i < subparts.length; ++i) {\r\n result = result.concat(splitParts(subparts[i]));\r\n }\r\n return result\r\n}\r\n\r\nfunction toAccessorString (str) {\r\n return '[' + splitParts(str).join('][') + ']'\r\n}\r\n\r\nfunction defineDynamic (type, data) {\r\n return new DynamicVariable(type, toAccessorString(data + ''))\r\n}\r\n\r\nfunction isDynamic (x) {\r\n return (typeof x === 'function' && !x._reglType) ||\r\n x instanceof DynamicVariable\r\n}\r\n\r\nfunction unbox (x, path) {\r\n if (typeof x === 'function') {\r\n return new DynamicVariable(DYN_FUNC, x)\r\n }\r\n return x\r\n}\r\n\r\nvar dynamic = {\r\n DynamicVariable: DynamicVariable,\r\n define: defineDynamic,\r\n isDynamic: isDynamic,\r\n unbox: unbox,\r\n accessor: toAccessorString\r\n};\n\n/* globals requestAnimationFrame, cancelAnimationFrame */\r\nvar raf = {\r\n next: typeof requestAnimationFrame === 'function'\r\n ? function (cb) { return requestAnimationFrame(cb) }\r\n : function (cb) { return setTimeout(cb, 16) },\r\n cancel: typeof cancelAnimationFrame === 'function'\r\n ? function (raf) { return cancelAnimationFrame(raf) }\r\n : clearTimeout\r\n};\n\n/* globals performance */\r\nvar clock = (typeof performance !== 'undefined' && performance.now)\r\n ? function () { return performance.now() }\r\n : function () { return +(new Date()) };\n\nfunction createStringStore () {\r\n var stringIds = {'': 0};\r\n var stringValues = [''];\r\n return {\r\n id: function (str) {\r\n var result = stringIds[str];\r\n if (result) {\r\n return result\r\n }\r\n result = stringIds[str] = stringValues.length;\r\n stringValues.push(str);\r\n return result\r\n },\r\n\r\n str: function (id) {\r\n return stringValues[id]\r\n }\r\n }\r\n}\n\n// Context and canvas creation helper functions\r\nfunction createCanvas (element, onDone, pixelRatio) {\r\n var canvas = document.createElement('canvas');\r\n extend(canvas.style, {\r\n border: 0,\r\n margin: 0,\r\n padding: 0,\r\n top: 0,\r\n left: 0\r\n });\r\n element.appendChild(canvas);\r\n\r\n if (element === document.body) {\r\n canvas.style.position = 'absolute';\r\n extend(element.style, {\r\n margin: 0,\r\n padding: 0\r\n });\r\n }\r\n\r\n function resize () {\r\n var w = window.innerWidth;\r\n var h = window.innerHeight;\r\n if (element !== document.body) {\r\n var bounds = element.getBoundingClientRect();\r\n w = bounds.right - bounds.left;\r\n h = bounds.bottom - bounds.top;\r\n }\r\n canvas.width = pixelRatio * w;\r\n canvas.height = pixelRatio * h;\r\n extend(canvas.style, {\r\n width: w + 'px',\r\n height: h + 'px'\r\n });\r\n }\r\n\r\n window.addEventListener('resize', resize, false);\r\n\r\n function onDestroy () {\r\n window.removeEventListener('resize', resize);\r\n element.removeChild(canvas);\r\n }\r\n\r\n resize();\r\n\r\n return {\r\n canvas: canvas,\r\n onDestroy: onDestroy\r\n }\r\n}\r\n\r\nfunction createContext (canvas, contextAttributes) {\r\n function get (name) {\r\n try {\r\n return canvas.getContext(name, contextAttributes)\r\n } catch (e) {\r\n return null\r\n }\r\n }\r\n return (\r\n get('webgl') ||\r\n get('experimental-webgl') ||\r\n get('webgl-experimental')\r\n )\r\n}\r\n\r\nfunction isHTMLElement (obj) {\r\n return (\r\n typeof obj.nodeName === 'string' &&\r\n typeof obj.appendChild === 'function' &&\r\n typeof obj.getBoundingClientRect === 'function'\r\n )\r\n}\r\n\r\nfunction isWebGLContext (obj) {\r\n return (\r\n typeof obj.drawArrays === 'function' ||\r\n typeof obj.drawElements === 'function'\r\n )\r\n}\r\n\r\nfunction parseExtensions (input) {\r\n if (typeof input === 'string') {\r\n return input.split()\r\n }\r\n check$1(Array.isArray(input), 'invalid extension array');\r\n return input\r\n}\r\n\r\nfunction getElement (desc) {\r\n if (typeof desc === 'string') {\r\n check$1(typeof document !== 'undefined', 'not supported outside of DOM');\r\n return document.querySelector(desc)\r\n }\r\n return desc\r\n}\r\n\r\nfunction parseArgs (args_) {\r\n var args = args_ || {};\r\n var element, container, canvas, gl;\r\n var contextAttributes = {};\r\n var extensions = [];\r\n var optionalExtensions = [];\r\n var pixelRatio = (typeof window === 'undefined' ? 1 : window.devicePixelRatio);\r\n var profile = false;\r\n var onDone = function (err) {\r\n if (err) {\r\n check$1.raise(err);\r\n }\r\n };\r\n var onDestroy = function () {};\r\n if (typeof args === 'string') {\r\n check$1(\r\n typeof document !== 'undefined',\r\n 'selector queries only supported in DOM enviroments');\r\n element = document.querySelector(args);\r\n check$1(element, 'invalid query string for element');\r\n } else if (typeof args === 'object') {\r\n if (isHTMLElement(args)) {\r\n element = args;\r\n } else if (isWebGLContext(args)) {\r\n gl = args;\r\n canvas = gl.canvas;\r\n } else {\r\n check$1.constructor(args);\r\n if ('gl' in args) {\r\n gl = args.gl;\r\n } else if ('canvas' in args) {\r\n canvas = getElement(args.canvas);\r\n } else if ('container' in args) {\r\n container = getElement(args.container);\r\n }\r\n if ('attributes' in args) {\r\n contextAttributes = args.attributes;\r\n check$1.type(contextAttributes, 'object', 'invalid context attributes');\r\n }\r\n if ('extensions' in args) {\r\n extensions = parseExtensions(args.extensions);\r\n }\r\n if ('optionalExtensions' in args) {\r\n optionalExtensions = parseExtensions(args.optionalExtensions);\r\n }\r\n if ('onDone' in args) {\r\n check$1.type(\r\n args.onDone, 'function',\r\n 'invalid or missing onDone callback');\r\n onDone = args.onDone;\r\n }\r\n if ('profile' in args) {\r\n profile = !!args.profile;\r\n }\r\n if ('pixelRatio' in args) {\r\n pixelRatio = +args.pixelRatio;\r\n check$1(pixelRatio > 0, 'invalid pixel ratio');\r\n }\r\n }\r\n } else {\r\n check$1.raise('invalid arguments to regl');\r\n }\r\n\r\n if (element) {\r\n if (element.nodeName.toLowerCase() === 'canvas') {\r\n canvas = element;\r\n } else {\r\n container = element;\r\n }\r\n }\r\n\r\n if (!gl) {\r\n if (!canvas) {\r\n check$1(\r\n typeof document !== 'undefined',\r\n 'must manually specify webgl context outside of DOM environments');\r\n var result = createCanvas(container || document.body, onDone, pixelRatio);\r\n if (!result) {\r\n return null\r\n }\r\n canvas = result.canvas;\r\n onDestroy = result.onDestroy;\r\n }\r\n gl = createContext(canvas, contextAttributes);\r\n }\r\n\r\n if (!gl) {\r\n onDestroy();\r\n onDone('webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org');\r\n return null\r\n }\r\n\r\n return {\r\n gl: gl,\r\n canvas: canvas,\r\n container: container,\r\n extensions: extensions,\r\n optionalExtensions: optionalExtensions,\r\n pixelRatio: pixelRatio,\r\n profile: profile,\r\n onDone: onDone,\r\n onDestroy: onDestroy\r\n }\r\n}\n\nfunction createExtensionCache (gl, config) {\r\n var extensions = {};\r\n\r\n function tryLoadExtension (name_) {\r\n check$1.type(name_, 'string', 'extension name must be string');\r\n var name = name_.toLowerCase();\r\n var ext;\r\n try {\r\n ext = extensions[name] = gl.getExtension(name);\r\n } catch (e) {}\r\n return !!ext\r\n }\r\n\r\n for (var i = 0; i < config.extensions.length; ++i) {\r\n var name = config.extensions[i];\r\n if (!tryLoadExtension(name)) {\r\n config.onDestroy();\r\n config.onDone('\"' + name + '\" extension is not supported by the current WebGL context, try upgrading your system or a different browser');\r\n return null\r\n }\r\n }\r\n\r\n config.optionalExtensions.forEach(tryLoadExtension);\r\n\r\n return {\r\n extensions: extensions,\r\n restore: function () {\r\n Object.keys(extensions).forEach(function (name) {\r\n if (extensions[name] && !tryLoadExtension(name)) {\r\n throw new Error('(regl): error restoring extension ' + name)\r\n }\r\n });\r\n }\r\n }\r\n}\n\nfunction loop (n, f) {\r\n var result = Array(n);\r\n for (var i = 0; i < n; ++i) {\r\n result[i] = f(i);\r\n }\r\n return result\r\n}\n\nvar GL_BYTE$1 = 5120;\r\nvar GL_UNSIGNED_BYTE$2 = 5121;\r\nvar GL_SHORT$1 = 5122;\r\nvar GL_UNSIGNED_SHORT$1 = 5123;\r\nvar GL_INT$1 = 5124;\r\nvar GL_UNSIGNED_INT$1 = 5125;\r\nvar GL_FLOAT$2 = 5126;\r\n\r\nfunction nextPow16 (v) {\r\n for (var i = 16; i <= (1 << 28); i *= 16) {\r\n if (v <= i) {\r\n return i\r\n }\r\n }\r\n return 0\r\n}\r\n\r\nfunction log2 (v) {\r\n var r, shift;\r\n r = (v > 0xFFFF) << 4;\r\n v >>>= r;\r\n shift = (v > 0xFF) << 3;\r\n v >>>= shift; r |= shift;\r\n shift = (v > 0xF) << 2;\r\n v >>>= shift; r |= shift;\r\n shift = (v > 0x3) << 1;\r\n v >>>= shift; r |= shift;\r\n return r | (v >> 1)\r\n}\r\n\r\nfunction createPool () {\r\n var bufferPool = loop(8, function () {\r\n return []\r\n });\r\n\r\n function alloc (n) {\r\n var sz = nextPow16(n);\r\n var bin = bufferPool[log2(sz) >> 2];\r\n if (bin.length > 0) {\r\n return bin.pop()\r\n }\r\n return new ArrayBuffer(sz)\r\n }\r\n\r\n function free (buf) {\r\n bufferPool[log2(buf.byteLength) >> 2].push(buf);\r\n }\r\n\r\n function allocType (type, n) {\r\n var result = null;\r\n switch (type) {\r\n case GL_BYTE$1:\r\n result = new Int8Array(alloc(n), 0, n);\r\n break\r\n case GL_UNSIGNED_BYTE$2:\r\n result = new Uint8Array(alloc(n), 0, n);\r\n break\r\n case GL_SHORT$1:\r\n result = new Int16Array(alloc(2 * n), 0, n);\r\n break\r\n case GL_UNSIGNED_SHORT$1:\r\n result = new Uint16Array(alloc(2 * n), 0, n);\r\n break\r\n case GL_INT$1:\r\n result = new Int32Array(alloc(4 * n), 0, n);\r\n break\r\n case GL_UNSIGNED_INT$1:\r\n result = new Uint32Array(alloc(4 * n), 0, n);\r\n break\r\n case GL_FLOAT$2:\r\n result = new Float32Array(alloc(4 * n), 0, n);\r\n break\r\n default:\r\n return null\r\n }\r\n if (result.length !== n) {\r\n return result.subarray(0, n)\r\n }\r\n return result\r\n }\r\n\r\n function freeType (array) {\r\n free(array.buffer);\r\n }\r\n\r\n return {\r\n alloc: alloc,\r\n free: free,\r\n allocType: allocType,\r\n freeType: freeType\r\n }\r\n}\r\n\r\nvar pool = createPool();\r\n\r\n// zero pool for initial zero data\r\npool.zero = createPool();\n\nvar GL_SUBPIXEL_BITS = 0x0D50;\r\nvar GL_RED_BITS = 0x0D52;\r\nvar GL_GREEN_BITS = 0x0D53;\r\nvar GL_BLUE_BITS = 0x0D54;\r\nvar GL_ALPHA_BITS = 0x0D55;\r\nvar GL_DEPTH_BITS = 0x0D56;\r\nvar GL_STENCIL_BITS = 0x0D57;\r\n\r\nvar GL_ALIASED_POINT_SIZE_RANGE = 0x846D;\r\nvar GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;\r\n\r\nvar GL_MAX_TEXTURE_SIZE = 0x0D33;\r\nvar GL_MAX_VIEWPORT_DIMS = 0x0D3A;\r\nvar GL_MAX_VERTEX_ATTRIBS = 0x8869;\r\nvar GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;\r\nvar GL_MAX_VARYING_VECTORS = 0x8DFC;\r\nvar GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;\r\nvar GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;\r\nvar GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872;\r\nvar GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;\r\nvar GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;\r\nvar GL_MAX_RENDERBUFFER_SIZE = 0x84E8;\r\n\r\nvar GL_VENDOR = 0x1F00;\r\nvar GL_RENDERER = 0x1F01;\r\nvar GL_VERSION = 0x1F02;\r\nvar GL_SHADING_LANGUAGE_VERSION = 0x8B8C;\r\n\r\nvar GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;\r\n\r\nvar GL_MAX_COLOR_ATTACHMENTS_WEBGL = 0x8CDF;\r\nvar GL_MAX_DRAW_BUFFERS_WEBGL = 0x8824;\r\n\r\nvar GL_TEXTURE_2D = 0x0DE1;\r\nvar GL_TEXTURE_CUBE_MAP = 0x8513;\r\nvar GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;\r\nvar GL_TEXTURE0 = 0x84C0;\r\nvar GL_RGBA = 0x1908;\r\nvar GL_FLOAT$1 = 0x1406;\r\nvar GL_UNSIGNED_BYTE$1 = 0x1401;\r\nvar GL_FRAMEBUFFER = 0x8D40;\r\nvar GL_FRAMEBUFFER_COMPLETE = 0x8CD5;\r\nvar GL_COLOR_ATTACHMENT0 = 0x8CE0;\r\nvar GL_COLOR_BUFFER_BIT$1 = 0x4000;\r\n\r\nvar wrapLimits = function (gl, extensions) {\r\n var maxAnisotropic = 1;\r\n if (extensions.ext_texture_filter_anisotropic) {\r\n maxAnisotropic = gl.getParameter(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT);\r\n }\r\n\r\n var maxDrawbuffers = 1;\r\n var maxColorAttachments = 1;\r\n if (extensions.webgl_draw_buffers) {\r\n maxDrawbuffers = gl.getParameter(GL_MAX_DRAW_BUFFERS_WEBGL);\r\n maxColorAttachments = gl.getParameter(GL_MAX_COLOR_ATTACHMENTS_WEBGL);\r\n }\r\n\r\n // detect if reading float textures is available (Safari doesn't support)\r\n var readFloat = !!extensions.oes_texture_float;\r\n if (readFloat) {\r\n var readFloatTexture = gl.createTexture();\r\n gl.bindTexture(GL_TEXTURE_2D, readFloatTexture);\r\n gl.texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_FLOAT$1, null);\r\n\r\n var fbo = gl.createFramebuffer();\r\n gl.bindFramebuffer(GL_FRAMEBUFFER, fbo);\r\n gl.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, readFloatTexture, 0);\r\n gl.bindTexture(GL_TEXTURE_2D, null);\r\n\r\n if (gl.checkFramebufferStatus(GL_FRAMEBUFFER) !== GL_FRAMEBUFFER_COMPLETE) readFloat = false;\r\n\r\n else {\r\n gl.viewport(0, 0, 1, 1);\r\n gl.clearColor(1.0, 0.0, 0.0, 1.0);\r\n gl.clear(GL_COLOR_BUFFER_BIT$1);\r\n var pixels = pool.allocType(GL_FLOAT$1, 4);\r\n gl.readPixels(0, 0, 1, 1, GL_RGBA, GL_FLOAT$1, pixels);\r\n\r\n if (gl.getError()) readFloat = false;\r\n else {\r\n gl.deleteFramebuffer(fbo);\r\n gl.deleteTexture(readFloatTexture);\r\n\r\n readFloat = pixels[0] === 1.0;\r\n }\r\n\r\n pool.freeType(pixels);\r\n }\r\n }\r\n\r\n // detect non power of two cube textures support (IE doesn't support)\r\n var isIE = typeof navigator !== 'undefined' && (/MSIE/.test(navigator.userAgent) || /Trident\\//.test(navigator.appVersion) || /Edge/.test(navigator.userAgent));\r\n\r\n var npotTextureCube = true;\r\n\r\n if (!isIE) {\r\n var cubeTexture = gl.createTexture();\r\n var data = pool.allocType(GL_UNSIGNED_BYTE$1, 36);\r\n gl.activeTexture(GL_TEXTURE0);\r\n gl.bindTexture(GL_TEXTURE_CUBE_MAP, cubeTexture);\r\n gl.texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA, 3, 3, 0, GL_RGBA, GL_UNSIGNED_BYTE$1, data);\r\n pool.freeType(data);\r\n gl.bindTexture(GL_TEXTURE_CUBE_MAP, null);\r\n gl.deleteTexture(cubeTexture);\r\n npotTextureCube = !gl.getError();\r\n }\r\n\r\n return {\r\n // drawing buffer bit depth\r\n colorBits: [\r\n gl.getParameter(GL_RED_BITS),\r\n gl.getParameter(GL_GREEN_BITS),\r\n gl.getParameter(GL_BLUE_BITS),\r\n gl.getParameter(GL_ALPHA_BITS)\r\n ],\r\n depthBits: gl.getParameter(GL_DEPTH_BITS),\r\n stencilBits: gl.getParameter(GL_STENCIL_BITS),\r\n subpixelBits: gl.getParameter(GL_SUBPIXEL_BITS),\r\n\r\n // supported extensions\r\n extensions: Object.keys(extensions).filter(function (ext) {\r\n return !!extensions[ext]\r\n }),\r\n\r\n // max aniso samples\r\n maxAnisotropic: maxAnisotropic,\r\n\r\n // max draw buffers\r\n maxDrawbuffers: maxDrawbuffers,\r\n maxColorAttachments: maxColorAttachments,\r\n\r\n // point and line size ranges\r\n pointSizeDims: gl.getParameter(GL_ALIASED_POINT_SIZE_RANGE),\r\n lineWidthDims: gl.getParameter(GL_ALIASED_LINE_WIDTH_RANGE),\r\n maxViewportDims: gl.getParameter(GL_MAX_VIEWPORT_DIMS),\r\n maxCombinedTextureUnits: gl.getParameter(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS),\r\n maxCubeMapSize: gl.getParameter(GL_MAX_CUBE_MAP_TEXTURE_SIZE),\r\n maxRenderbufferSize: gl.getParameter(GL_MAX_RENDERBUFFER_SIZE),\r\n maxTextureUnits: gl.getParameter(GL_MAX_TEXTURE_IMAGE_UNITS),\r\n maxTextureSize: gl.getParameter(GL_MAX_TEXTURE_SIZE),\r\n maxAttributes: gl.getParameter(GL_MAX_VERTEX_ATTRIBS),\r\n maxVertexUniforms: gl.getParameter(GL_MAX_VERTEX_UNIFORM_VECTORS),\r\n maxVertexTextureUnits: gl.getParameter(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS),\r\n maxVaryingVectors: gl.getParameter(GL_MAX_VARYING_VECTORS),\r\n maxFragmentUniforms: gl.getParameter(GL_MAX_FRAGMENT_UNIFORM_VECTORS),\r\n\r\n // vendor info\r\n glsl: gl.getParameter(GL_SHADING_LANGUAGE_VERSION),\r\n renderer: gl.getParameter(GL_RENDERER),\r\n vendor: gl.getParameter(GL_VENDOR),\r\n version: gl.getParameter(GL_VERSION),\r\n\r\n // quirks\r\n readFloat: readFloat,\r\n npotTextureCube: npotTextureCube\r\n }\r\n};\n\nfunction isNDArrayLike (obj) {\r\n return (\r\n !!obj &&\r\n typeof obj === 'object' &&\r\n Array.isArray(obj.shape) &&\r\n Array.isArray(obj.stride) &&\r\n typeof obj.offset === 'number' &&\r\n obj.shape.length === obj.stride.length &&\r\n (Array.isArray(obj.data) ||\r\n isTypedArray(obj.data)))\r\n}\n\nvar values = function (obj) {\r\n return Object.keys(obj).map(function (key) { return obj[key] })\r\n};\n\nvar flattenUtils = {\r\n shape: arrayShape$1,\r\n flatten: flattenArray\r\n};\r\n\r\nfunction flatten1D (array, nx, out) {\r\n for (var i = 0; i < nx; ++i) {\r\n out[i] = array[i];\r\n }\r\n}\r\n\r\nfunction flatten2D (array, nx, ny, out) {\r\n var ptr = 0;\r\n for (var i = 0; i < nx; ++i) {\r\n var row = array[i];\r\n for (var j = 0; j < ny; ++j) {\r\n out[ptr++] = row[j];\r\n }\r\n }\r\n}\r\n\r\nfunction flatten3D (array, nx, ny, nz, out, ptr_) {\r\n var ptr = ptr_;\r\n for (var i = 0; i < nx; ++i) {\r\n var row = array[i];\r\n for (var j = 0; j < ny; ++j) {\r\n var col = row[j];\r\n for (var k = 0; k < nz; ++k) {\r\n out[ptr++] = col[k];\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction flattenRec (array, shape, level, out, ptr) {\r\n var stride = 1;\r\n for (var i = level + 1; i < shape.length; ++i) {\r\n stride *= shape[i];\r\n }\r\n var n = shape[level];\r\n if (shape.length - level === 4) {\r\n var nx = shape[level + 1];\r\n var ny = shape[level + 2];\r\n var nz = shape[level + 3];\r\n for (i = 0; i < n; ++i) {\r\n flatten3D(array[i], nx, ny, nz, out, ptr);\r\n ptr += stride;\r\n }\r\n } else {\r\n for (i = 0; i < n; ++i) {\r\n flattenRec(array[i], shape, level + 1, out, ptr);\r\n ptr += stride;\r\n }\r\n }\r\n}\r\n\r\nfunction flattenArray (array, shape, type, out_) {\r\n var sz = 1;\r\n if (shape.length) {\r\n for (var i = 0; i < shape.length; ++i) {\r\n sz *= shape[i];\r\n }\r\n } else {\r\n sz = 0;\r\n }\r\n var out = out_ || pool.allocType(type, sz);\r\n switch (shape.length) {\r\n case 0:\r\n break\r\n case 1:\r\n flatten1D(array, shape[0], out);\r\n break\r\n case 2:\r\n flatten2D(array, shape[0], shape[1], out);\r\n break\r\n case 3:\r\n flatten3D(array, shape[0], shape[1], shape[2], out, 0);\r\n break\r\n default:\r\n flattenRec(array, shape, 0, out, 0);\r\n }\r\n return out\r\n}\r\n\r\nfunction arrayShape$1 (array_) {\r\n var shape = [];\r\n for (var array = array_; array.length; array = array[0]) {\r\n shape.push(array.length);\r\n }\r\n return shape\r\n}\n\nvar arrayTypes = {\n\t\"[object Int8Array]\": 5120,\n\t\"[object Int16Array]\": 5122,\n\t\"[object Int32Array]\": 5124,\n\t\"[object Uint8Array]\": 5121,\n\t\"[object Uint8ClampedArray]\": 5121,\n\t\"[object Uint16Array]\": 5123,\n\t\"[object Uint32Array]\": 5125,\n\t\"[object Float32Array]\": 5126,\n\t\"[object Float64Array]\": 5121,\n\t\"[object ArrayBuffer]\": 5121\n};\n\nvar int8 = 5120;\nvar int16 = 5122;\nvar int32 = 5124;\nvar uint8 = 5121;\nvar uint16 = 5123;\nvar uint32 = 5125;\nvar float = 5126;\nvar float32 = 5126;\nvar glTypes = {\n\tint8: int8,\n\tint16: int16,\n\tint32: int32,\n\tuint8: uint8,\n\tuint16: uint16,\n\tuint32: uint32,\n\tfloat: float,\n\tfloat32: float32\n};\n\nvar dynamic$1 = 35048;\nvar stream = 35040;\nvar usageTypes = {\n\tdynamic: dynamic$1,\n\tstream: stream,\n\t\"static\": 35044\n};\n\nvar arrayFlatten = flattenUtils.flatten;\r\nvar arrayShape = flattenUtils.shape;\r\n\r\nvar GL_STATIC_DRAW = 0x88E4;\r\nvar GL_STREAM_DRAW = 0x88E0;\r\n\r\nvar GL_UNSIGNED_BYTE$3 = 5121;\r\nvar GL_FLOAT$3 = 5126;\r\n\r\nvar DTYPES_SIZES = [];\r\nDTYPES_SIZES[5120] = 1; // int8\r\nDTYPES_SIZES[5122] = 2; // int16\r\nDTYPES_SIZES[5124] = 4; // int32\r\nDTYPES_SIZES[5121] = 1; // uint8\r\nDTYPES_SIZES[5123] = 2; // uint16\r\nDTYPES_SIZES[5125] = 4; // uint32\r\nDTYPES_SIZES[5126] = 4; // float32\r\n\r\nfunction typedArrayCode (data) {\r\n return arrayTypes[Object.prototype.toString.call(data)] | 0\r\n}\r\n\r\nfunction copyArray (out, inp) {\r\n for (var i = 0; i < inp.length; ++i) {\r\n out[i] = inp[i];\r\n }\r\n}\r\n\r\nfunction transpose (\r\n result, data, shapeX, shapeY, strideX, strideY, offset) {\r\n var ptr = 0;\r\n for (var i = 0; i < shapeX; ++i) {\r\n for (var j = 0; j < shapeY; ++j) {\r\n result[ptr++] = data[strideX * i + strideY * j + offset];\r\n }\r\n }\r\n}\r\n\r\nfunction wrapBufferState (gl, stats, config, attributeState) {\r\n var bufferCount = 0;\r\n var bufferSet = {};\r\n\r\n function REGLBuffer (type) {\r\n this.id = bufferCount++;\r\n this.buffer = gl.createBuffer();\r\n this.type = type;\r\n this.usage = GL_STATIC_DRAW;\r\n this.byteLength = 0;\r\n this.dimension = 1;\r\n this.dtype = GL_UNSIGNED_BYTE$3;\r\n\r\n this.persistentData = null;\r\n\r\n if (config.profile) {\r\n this.stats = {size: 0};\r\n }\r\n }\r\n\r\n REGLBuffer.prototype.bind = function () {\r\n gl.bindBuffer(this.type, this.buffer);\r\n };\r\n\r\n REGLBuffer.prototype.destroy = function () {\r\n destroy(this);\r\n };\r\n\r\n var streamPool = [];\r\n\r\n function createStream (type, data) {\r\n var buffer = streamPool.pop();\r\n if (!buffer) {\r\n buffer = new REGLBuffer(type);\r\n }\r\n buffer.bind();\r\n initBufferFromData(buffer, data, GL_STREAM_DRAW, 0, 1, false);\r\n return buffer\r\n }\r\n\r\n function destroyStream (stream$$1) {\r\n streamPool.push(stream$$1);\r\n }\r\n\r\n function initBufferFromTypedArray (buffer, data, usage) {\r\n buffer.byteLength = data.byteLength;\r\n gl.bufferData(buffer.type, data, usage);\r\n }\r\n\r\n function initBufferFromData (buffer, data, usage, dtype, dimension, persist) {\r\n var shape;\r\n buffer.usage = usage;\r\n if (Array.isArray(data)) {\r\n buffer.dtype = dtype || GL_FLOAT$3;\r\n if (data.length > 0) {\r\n var flatData;\r\n if (Array.isArray(data[0])) {\r\n shape = arrayShape(data);\r\n var dim = 1;\r\n for (var i = 1; i < shape.length; ++i) {\r\n dim *= shape[i];\r\n }\r\n buffer.dimension = dim;\r\n flatData = arrayFlatten(data, shape, buffer.dtype);\r\n initBufferFromTypedArray(buffer, flatData, usage);\r\n if (persist) {\r\n buffer.persistentData = flatData;\r\n } else {\r\n pool.freeType(flatData);\r\n }\r\n } else if (typeof data[0] === 'number') {\r\n buffer.dimension = dimension;\r\n var typedData = pool.allocType(buffer.dtype, data.length);\r\n copyArray(typedData, data);\r\n initBufferFromTypedArray(buffer, typedData, usage);\r\n if (persist) {\r\n buffer.persistentData = typedData;\r\n } else {\r\n pool.freeType(typedData);\r\n }\r\n } else if (isTypedArray(data[0])) {\r\n buffer.dimension = data[0].length;\r\n buffer.dtype = dtype || typedArrayCode(data[0]) || GL_FLOAT$3;\r\n flatData = arrayFlatten(\r\n data,\r\n [data.length, data[0].length],\r\n buffer.dtype);\r\n initBufferFromTypedArray(buffer, flatData, usage);\r\n if (persist) {\r\n buffer.persistentData = flatData;\r\n } else {\r\n pool.freeType(flatData);\r\n }\r\n } else {\r\n check$1.raise('invalid buffer data');\r\n }\r\n }\r\n } else if (isTypedArray(data)) {\r\n buffer.dtype = dtype || typedArrayCode(data);\r\n buffer.dimension = dimension;\r\n initBufferFromTypedArray(buffer, data, usage);\r\n if (persist) {\r\n buffer.persistentData = new Uint8Array(new Uint8Array(data.buffer));\r\n }\r\n } else if (isNDArrayLike(data)) {\r\n shape = data.shape;\r\n var stride = data.stride;\r\n var offset = data.offset;\r\n\r\n var shapeX = 0;\r\n var shapeY = 0;\r\n var strideX = 0;\r\n var strideY = 0;\r\n if (shape.length === 1) {\r\n shapeX = shape[0];\r\n shapeY = 1;\r\n strideX = stride[0];\r\n strideY = 0;\r\n } else if (shape.length === 2) {\r\n shapeX = shape[0];\r\n shapeY = shape[1];\r\n strideX = stride[0];\r\n strideY = stride[1];\r\n } else {\r\n check$1.raise('invalid shape');\r\n }\r\n\r\n buffer.dtype = dtype || typedArrayCode(data.data) || GL_FLOAT$3;\r\n buffer.dimension = shapeY;\r\n\r\n var transposeData = pool.allocType(buffer.dtype, shapeX * shapeY);\r\n transpose(transposeData,\r\n data.data,\r\n shapeX, shapeY,\r\n strideX, strideY,\r\n offset);\r\n initBufferFromTypedArray(buffer, transposeData, usage);\r\n if (persist) {\r\n buffer.persistentData = transposeData;\r\n } else {\r\n pool.freeType(transposeData);\r\n }\r\n } else {\r\n check$1.raise('invalid buffer data');\r\n }\r\n }\r\n\r\n function destroy (buffer) {\r\n stats.bufferCount--;\r\n\r\n for (var i = 0; i < attributeState.state.length; ++i) {\r\n var record = attributeState.state[i];\r\n if (record.buffer === buffer) {\r\n gl.disableVertexAttribArray(i);\r\n record.buffer = null;\r\n }\r\n }\r\n\r\n var handle = buffer.buffer;\r\n check$1(handle, 'buffer must not be deleted already');\r\n gl.deleteBuffer(handle);\r\n buffer.buffer = null;\r\n delete bufferSet[buffer.id];\r\n }\r\n\r\n function createBuffer (options, type, deferInit, persistent) {\r\n stats.bufferCount++;\r\n\r\n var buffer = new REGLBuffer(type);\r\n bufferSet[buffer.id] = buffer;\r\n\r\n function reglBuffer (options) {\r\n var usage = GL_STATIC_DRAW;\r\n var data = null;\r\n var byteLength = 0;\r\n var dtype = 0;\r\n var dimension = 1;\r\n if (Array.isArray(options) ||\r\n isTypedArray(options) ||\r\n isNDArrayLike(options)) {\r\n data = options;\r\n } else if (typeof options === 'number') {\r\n byteLength = options | 0;\r\n } else if (options) {\r\n check$1.type(\r\n options, 'object',\r\n 'buffer arguments must be an object, a number or an array');\r\n\r\n if ('data' in options) {\r\n check$1(\r\n data === null ||\r\n Array.isArray(data) ||\r\n isTypedArray(data) ||\r\n isNDArrayLike(data),\r\n 'invalid data for buffer');\r\n data = options.data;\r\n }\r\n\r\n if ('usage' in options) {\r\n check$1.parameter(options.usage, usageTypes, 'invalid buffer usage');\r\n usage = usageTypes[options.usage];\r\n }\r\n\r\n if ('type' in options) {\r\n check$1.parameter(options.type, glTypes, 'invalid buffer type');\r\n dtype = glTypes[options.type];\r\n }\r\n\r\n if ('dimension' in options) {\r\n check$1.type(options.dimension, 'number', 'invalid dimension');\r\n dimension = options.dimension | 0;\r\n }\r\n\r\n if ('length' in options) {\r\n check$1.nni(byteLength, 'buffer length must be a nonnegative integer');\r\n byteLength = options.length | 0;\r\n }\r\n }\r\n\r\n buffer.bind();\r\n if (!data) {\r\n // #475\r\n if (byteLength) gl.bufferData(buffer.type, byteLength, usage);\r\n buffer.dtype = dtype || GL_UNSIGNED_BYTE$3;\r\n buffer.usage = usage;\r\n buffer.dimension = dimension;\r\n buffer.byteLength = byteLength;\r\n } else {\r\n initBufferFromData(buffer, data, usage, dtype, dimension, persistent);\r\n }\r\n\r\n if (config.profile) {\r\n buffer.stats.size = buffer.byteLength * DTYPES_SIZES[buffer.dtype];\r\n }\r\n\r\n return reglBuffer\r\n }\r\n\r\n function setSubData (data, offset) {\r\n check$1(offset + data.byteLength <= buffer.byteLength,\r\n 'invalid buffer subdata call, buffer is too small. ' + ' Can\\'t write data of size ' + data.byteLength + ' starting from offset ' + offset + ' to a buffer of size ' + buffer.byteLength);\r\n\r\n gl.bufferSubData(buffer.type, offset, data);\r\n }\r\n\r\n function subdata (data, offset_) {\r\n var offset = (offset_ || 0) | 0;\r\n var shape;\r\n buffer.bind();\r\n if (isTypedArray(data)) {\r\n setSubData(data, offset);\r\n } else if (Array.isArray(data)) {\r\n if (data.length > 0) {\r\n if (typeof data[0] === 'number') {\r\n var converted = pool.allocType(buffer.dtype, data.length);\r\n copyArray(converted, data);\r\n setSubData(converted, offset);\r\n pool.freeType(converted);\r\n } else if (Array.isArray(data[0]) || isTypedArray(data[0])) {\r\n shape = arrayShape(data);\r\n var flatData = arrayFlatten(data, shape, buffer.dtype);\r\n setSubData(flatData, offset);\r\n pool.freeType(flatData);\r\n } else {\r\n check$1.raise('invalid buffer data');\r\n }\r\n }\r\n } else if (isNDArrayLike(data)) {\r\n shape = data.shape;\r\n var stride = data.stride;\r\n\r\n var shapeX = 0;\r\n var shapeY = 0;\r\n var strideX = 0;\r\n var strideY = 0;\r\n if (shape.length === 1) {\r\n shapeX = shape[0];\r\n shapeY = 1;\r\n strideX = stride[0];\r\n strideY = 0;\r\n } else if (shape.length === 2) {\r\n shapeX = shape[0];\r\n shapeY = shape[1];\r\n strideX = stride[0];\r\n strideY = stride[1];\r\n } else {\r\n check$1.raise('invalid shape');\r\n }\r\n var dtype = Array.isArray(data.data)\r\n ? buffer.dtype\r\n : typedArrayCode(data.data);\r\n\r\n var transposeData = pool.allocType(dtype, shapeX * shapeY);\r\n transpose(transposeData,\r\n data.data,\r\n shapeX, shapeY,\r\n strideX, strideY,\r\n data.offset);\r\n setSubData(transposeData, offset);\r\n pool.freeType(transposeData);\r\n } else {\r\n check$1.raise('invalid data for buffer subdata');\r\n }\r\n return reglBuffer\r\n }\r\n\r\n if (!deferInit) {\r\n reglBuffer(options);\r\n }\r\n\r\n reglBuffer._reglType = 'buffer';\r\n reglBuffer._buffer = buffer;\r\n reglBuffer.subdata = subdata;\r\n if (config.profile) {\r\n reglBuffer.stats = buffer.stats;\r\n }\r\n reglBuffer.destroy = function () { destroy(buffer); };\r\n\r\n return reglBuffer\r\n }\r\n\r\n function restoreBuffers () {\r\n values(bufferSet).forEach(function (buffer) {\r\n buffer.buffer = gl.createBuffer();\r\n gl.bindBuffer(buffer.type, buffer.buffer);\r\n gl.bufferData(\r\n buffer.type, buffer.persistentData || buffer.byteLength, buffer.usage);\r\n });\r\n }\r\n\r\n if (config.profile) {\r\n stats.getTotalBufferSize = function () {\r\n var total = 0;\r\n // TODO: Right now, the streams are not part of the total count.\r\n Object.keys(bufferSet).forEach(function (key) {\r\n total += bufferSet[key].stats.size;\r\n });\r\n return total\r\n };\r\n }\r\n\r\n return {\r\n create: createBuffer,\r\n\r\n createStream: createStream,\r\n destroyStream: destroyStream,\r\n\r\n clear: function () {\r\n values(bufferSet).forEach(destroy);\r\n streamPool.forEach(destroy);\r\n },\r\n\r\n getBuffer: function (wrapper) {\r\n if (wrapper && wrapper._buffer instanceof REGLBuffer) {\r\n return wrapper._buffer\r\n }\r\n return null\r\n },\r\n\r\n restore: restoreBuffers,\r\n\r\n _initBuffer: initBufferFromData\r\n }\r\n}\n\nvar points = 0;\nvar point = 0;\nvar lines = 1;\nvar line = 1;\nvar triangles = 4;\nvar triangle = 4;\nvar primTypes = {\n\tpoints: points,\n\tpoint: point,\n\tlines: lines,\n\tline: line,\n\ttriangles: triangles,\n\ttriangle: triangle,\n\t\"line loop\": 2,\n\t\"line strip\": 3,\n\t\"triangle strip\": 5,\n\t\"triangle fan\": 6\n};\n\nvar GL_POINTS = 0;\r\nvar GL_LINES = 1;\r\nvar GL_TRIANGLES = 4;\r\n\r\nvar GL_BYTE$2 = 5120;\r\nvar GL_UNSIGNED_BYTE$4 = 5121;\r\nvar GL_SHORT$2 = 5122;\r\nvar GL_UNSIGNED_SHORT$2 = 5123;\r\nvar GL_INT$2 = 5124;\r\nvar GL_UNSIGNED_INT$2 = 5125;\r\n\r\nvar GL_ELEMENT_ARRAY_BUFFER = 34963;\r\n\r\nvar GL_STREAM_DRAW$1 = 0x88E0;\r\nvar GL_STATIC_DRAW$1 = 0x88E4;\r\n\r\nfunction wrapElementsState (gl, extensions, bufferState, stats) {\r\n var elementSet = {};\r\n var elementCount = 0;\r\n\r\n var elementTypes = {\r\n 'uint8': GL_UNSIGNED_BYTE$4,\r\n 'uint16': GL_UNSIGNED_SHORT$2\r\n };\r\n\r\n if (extensions.oes_element_index_uint) {\r\n elementTypes.uint32 = GL_UNSIGNED_INT$2;\r\n }\r\n\r\n function REGLElementBuffer (buffer) {\r\n this.id = elementCount++;\r\n elementSet[this.id] = this;\r\n this.buffer = buffer;\r\n this.primType = GL_TRIANGLES;\r\n this.vertCount = 0;\r\n this.type = 0;\r\n }\r\n\r\n REGLElementBuffer.prototype.bind = function () {\r\n this.buffer.bind();\r\n };\r\n\r\n var bufferPool = [];\r\n\r\n function createElementStream (data) {\r\n var result = bufferPool.pop();\r\n if (!result) {\r\n result = new REGLElementBuffer(bufferState.create(\r\n null,\r\n GL_ELEMENT_ARRAY_BUFFER,\r\n true,\r\n false)._buffer);\r\n }\r\n initElements(result, data, GL_STREAM_DRAW$1, -1, -1, 0, 0);\r\n return result\r\n }\r\n\r\n function destroyElementStream (elements) {\r\n bufferPool.push(elements);\r\n }\r\n\r\n function initElements (\r\n elements,\r\n data,\r\n usage,\r\n prim,\r\n count,\r\n byteLength,\r\n type) {\r\n elements.buffer.bind();\r\n if (data) {\r\n var predictedType = type;\r\n if (!type && (\r\n !isTypedArray(data) ||\r\n (isNDArrayLike(data) && !isTypedArray(data.data)))) {\r\n predictedType = extensions.oes_element_index_uint\r\n ? GL_UNSIGNED_INT$2\r\n : GL_UNSIGNED_SHORT$2;\r\n }\r\n bufferState._initBuffer(\r\n elements.buffer,\r\n data,\r\n usage,\r\n predictedType,\r\n 3);\r\n } else {\r\n gl.bufferData(GL_ELEMENT_ARRAY_BUFFER, byteLength, usage);\r\n elements.buffer.dtype = dtype || GL_UNSIGNED_BYTE$4;\r\n elements.buffer.usage = usage;\r\n elements.buffer.dimension = 3;\r\n elements.buffer.byteLength = byteLength;\r\n }\r\n\r\n var dtype = type;\r\n if (!type) {\r\n switch (elements.buffer.dtype) {\r\n case GL_UNSIGNED_BYTE$4:\r\n case GL_BYTE$2:\r\n dtype = GL_UNSIGNED_BYTE$4;\r\n break\r\n\r\n case GL_UNSIGNED_SHORT$2:\r\n case GL_SHORT$2:\r\n dtype = GL_UNSIGNED_SHORT$2;\r\n break\r\n\r\n case GL_UNSIGNED_INT$2:\r\n case GL_INT$2:\r\n dtype = GL_UNSIGNED_INT$2;\r\n break\r\n\r\n default:\r\n check$1.raise('unsupported type for element array');\r\n }\r\n elements.buffer.dtype = dtype;\r\n }\r\n elements.type = dtype;\r\n\r\n // Check oes_element_index_uint extension\r\n check$1(\r\n dtype !== GL_UNSIGNED_INT$2 ||\r\n !!extensions.oes_element_index_uint,\r\n '32 bit element buffers not supported, enable oes_element_index_uint first');\r\n\r\n // try to guess default primitive type and arguments\r\n var vertCount = count;\r\n if (vertCount < 0) {\r\n vertCount = elements.buffer.byteLength;\r\n if (dtype === GL_UNSIGNED_SHORT$2) {\r\n vertCount >>= 1;\r\n } else if (dtype === GL_UNSIGNED_INT$2) {\r\n vertCount >>= 2;\r\n }\r\n }\r\n elements.vertCount = vertCount;\r\n\r\n // try to guess primitive type from cell dimension\r\n var primType = prim;\r\n if (prim < 0) {\r\n primType = GL_TRIANGLES;\r\n var dimension = elements.buffer.dimension;\r\n if (dimension === 1) primType = GL_POINTS;\r\n if (dimension === 2) primType = GL_LINES;\r\n if (dimension === 3) primType = GL_TRIANGLES;\r\n }\r\n elements.primType = primType;\r\n }\r\n\r\n function destroyElements (elements) {\r\n stats.elementsCount--;\r\n\r\n check$1(elements.buffer !== null, 'must not double destroy elements');\r\n delete elementSet[elements.id];\r\n elements.buffer.destroy();\r\n elements.buffer = null;\r\n }\r\n\r\n function createElements (options, persistent) {\r\n var buffer = bufferState.create(null, GL_ELEMENT_ARRAY_BUFFER, true);\r\n var elements = new REGLElementBuffer(buffer._buffer);\r\n stats.elementsCount++;\r\n\r\n function reglElements (options) {\r\n if (!options) {\r\n buffer();\r\n elements.primType = GL_TRIANGLES;\r\n elements.vertCount = 0;\r\n elements.type = GL_UNSIGNED_BYTE$4;\r\n } else if (typeof options === 'number') {\r\n buffer(options);\r\n elements.primType = GL_TRIANGLES;\r\n elements.vertCount = options | 0;\r\n elements.type = GL_UNSIGNED_BYTE$4;\r\n } else {\r\n var data = null;\r\n var usage = GL_STATIC_DRAW$1;\r\n var primType = -1;\r\n var vertCount = -1;\r\n var byteLength = 0;\r\n var dtype = 0;\r\n if (Array.isArray(options) ||\r\n isTypedArray(options) ||\r\n isNDArrayLike(options)) {\r\n data = options;\r\n } else {\r\n check$1.type(options, 'object', 'invalid arguments for elements');\r\n if ('data' in options) {\r\n data = options.data;\r\n check$1(\r\n Array.isArray(data) ||\r\n isTypedArray(data) ||\r\n isNDArrayLike(data),\r\n 'invalid data for element buffer');\r\n }\r\n if ('usage' in options) {\r\n check$1.parameter(\r\n options.usage,\r\n usageTypes,\r\n 'invalid element buffer usage');\r\n usage = usageTypes[options.usage];\r\n }\r\n if ('primitive' in options) {\r\n check$1.parameter(\r\n options.primitive,\r\n primTypes,\r\n 'invalid element buffer primitive');\r\n primType = primTypes[options.primitive];\r\n }\r\n if ('count' in options) {\r\n check$1(\r\n typeof options.count === 'number' && options.count >= 0,\r\n 'invalid vertex count for elements');\r\n vertCount = options.count | 0;\r\n }\r\n if ('type' in options) {\r\n check$1.parameter(\r\n options.type,\r\n elementTypes,\r\n 'invalid buffer type');\r\n dtype = elementTypes[options.type];\r\n }\r\n if ('length' in options) {\r\n byteLength = options.length | 0;\r\n } else {\r\n byteLength = vertCount;\r\n if (dtype === GL_UNSIGNED_SHORT$2 || dtype === GL_SHORT$2) {\r\n byteLength *= 2;\r\n } else if (dtype === GL_UNSIGNED_INT$2 || dtype === GL_INT$2) {\r\n byteLength *= 4;\r\n }\r\n }\r\n }\r\n initElements(\r\n elements,\r\n data,\r\n usage,\r\n primType,\r\n vertCount,\r\n byteLength,\r\n dtype);\r\n }\r\n\r\n return reglElements\r\n }\r\n\r\n reglElements(options);\r\n\r\n reglElements._reglType = 'elements';\r\n reglElements._elements = elements;\r\n reglElements.subdata = function (data, offset) {\r\n buffer.subdata(data, offset);\r\n return reglElements\r\n };\r\n reglElements.destroy = function () {\r\n destroyElements(elements);\r\n };\r\n\r\n return reglElements\r\n }\r\n\r\n return {\r\n create: createElements,\r\n createStream: createElementStream,\r\n destroyStream: destroyElementStream,\r\n getElements: function (elements) {\r\n if (typeof elements === 'function' &&\r\n elements._elements instanceof REGLElementBuffer) {\r\n return elements._elements\r\n }\r\n return null\r\n },\r\n clear: function () {\r\n values(elementSet).forEach(destroyElements);\r\n }\r\n }\r\n}\n\nvar FLOAT = new Float32Array(1);\r\nvar INT = new Uint32Array(FLOAT.buffer);\r\n\r\nvar GL_UNSIGNED_SHORT$4 = 5123;\r\n\r\nfunction convertToHalfFloat (array) {\r\n var ushorts = pool.allocType(GL_UNSIGNED_SHORT$4, array.length);\r\n\r\n for (var i = 0; i < array.length; ++i) {\r\n if (isNaN(array[i])) {\r\n ushorts[i] = 0xffff;\r\n } else if (array[i] === Infinity) {\r\n ushorts[i] = 0x7c00;\r\n } else if (array[i] === -Infinity) {\r\n ushorts[i] = 0xfc00;\r\n } else {\r\n FLOAT[0] = array[i];\r\n var x = INT[0];\r\n\r\n var sgn = (x >>> 31) << 15;\r\n var exp = ((x << 1) >>> 24) - 127;\r\n var frac = (x >> 13) & ((1 << 10) - 1);\r\n\r\n if (exp < -24) {\r\n // round non-representable denormals to 0\r\n ushorts[i] = sgn;\r\n } else if (exp < -14) {\r\n // handle denormals\r\n var s = -14 - exp;\r\n ushorts[i] = sgn + ((frac + (1 << 10)) >> s);\r\n } else if (exp > 15) {\r\n // round overflow to +/- Infinity\r\n ushorts[i] = sgn + 0x7c00;\r\n } else {\r\n // otherwise convert directly\r\n ushorts[i] = sgn + ((exp + 15) << 10) + frac;\r\n }\r\n }\r\n }\r\n\r\n return ushorts\r\n}\n\nfunction isArrayLike (s) {\r\n return Array.isArray(s) || isTypedArray(s)\r\n}\n\nvar isPow2$1 = function (v) {\r\n return !(v & (v - 1)) && (!!v)\r\n};\n\nvar GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;\r\n\r\nvar GL_TEXTURE_2D$1 = 0x0DE1;\r\nvar GL_TEXTURE_CUBE_MAP$1 = 0x8513;\r\nvar GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 = 0x8515;\r\n\r\nvar GL_RGBA$1 = 0x1908;\r\nvar GL_ALPHA = 0x1906;\r\nvar GL_RGB = 0x1907;\r\nvar GL_LUMINANCE = 0x1909;\r\nvar GL_LUMINANCE_ALPHA = 0x190A;\r\n\r\nvar GL_RGBA4 = 0x8056;\r\nvar GL_RGB5_A1 = 0x8057;\r\nvar GL_RGB565 = 0x8D62;\r\n\r\nvar GL_UNSIGNED_SHORT_4_4_4_4$1 = 0x8033;\r\nvar GL_UNSIGNED_SHORT_5_5_5_1$1 = 0x8034;\r\nvar GL_UNSIGNED_SHORT_5_6_5$1 = 0x8363;\r\nvar GL_UNSIGNED_INT_24_8_WEBGL$1 = 0x84FA;\r\n\r\nvar GL_DEPTH_COMPONENT = 0x1902;\r\nvar GL_DEPTH_STENCIL = 0x84F9;\r\n\r\nvar GL_SRGB_EXT = 0x8C40;\r\nvar GL_SRGB_ALPHA_EXT = 0x8C42;\r\n\r\nvar GL_HALF_FLOAT_OES$1 = 0x8D61;\r\n\r\nvar GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;\r\nvar GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;\r\nvar GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;\r\nvar GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;\r\n\r\nvar GL_COMPRESSED_RGB_ATC_WEBGL = 0x8C92;\r\nvar GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;\r\nvar GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE;\r\n\r\nvar GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;\r\nvar GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;\r\nvar GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;\r\nvar GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;\r\n\r\nvar GL_COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;\r\n\r\nvar GL_UNSIGNED_BYTE$5 = 0x1401;\r\nvar GL_UNSIGNED_SHORT$3 = 0x1403;\r\nvar GL_UNSIGNED_INT$3 = 0x1405;\r\nvar GL_FLOAT$4 = 0x1406;\r\n\r\nvar GL_TEXTURE_WRAP_S = 0x2802;\r\nvar GL_TEXTURE_WRAP_T = 0x2803;\r\n\r\nvar GL_REPEAT = 0x2901;\r\nvar GL_CLAMP_TO_EDGE$1 = 0x812F;\r\nvar GL_MIRRORED_REPEAT = 0x8370;\r\n\r\nvar GL_TEXTURE_MAG_FILTER = 0x2800;\r\nvar GL_TEXTURE_MIN_FILTER = 0x2801;\r\n\r\nvar GL_NEAREST$1 = 0x2600;\r\nvar GL_LINEAR = 0x2601;\r\nvar GL_NEAREST_MIPMAP_NEAREST$1 = 0x2700;\r\nvar GL_LINEAR_MIPMAP_NEAREST$1 = 0x2701;\r\nvar GL_NEAREST_MIPMAP_LINEAR$1 = 0x2702;\r\nvar GL_LINEAR_MIPMAP_LINEAR$1 = 0x2703;\r\n\r\nvar GL_GENERATE_MIPMAP_HINT = 0x8192;\r\nvar GL_DONT_CARE = 0x1100;\r\nvar GL_FASTEST = 0x1101;\r\nvar GL_NICEST = 0x1102;\r\n\r\nvar GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;\r\n\r\nvar GL_UNPACK_ALIGNMENT = 0x0CF5;\r\nvar GL_UNPACK_FLIP_Y_WEBGL = 0x9240;\r\nvar GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;\r\nvar GL_UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;\r\n\r\nvar GL_BROWSER_DEFAULT_WEBGL = 0x9244;\r\n\r\nvar GL_TEXTURE0$1 = 0x84C0;\r\n\r\nvar MIPMAP_FILTERS = [\r\n GL_NEAREST_MIPMAP_NEAREST$1,\r\n GL_NEAREST_MIPMAP_LINEAR$1,\r\n GL_LINEAR_MIPMAP_NEAREST$1,\r\n GL_LINEAR_MIPMAP_LINEAR$1\r\n];\r\n\r\nvar CHANNELS_FORMAT = [\r\n 0,\r\n GL_LUMINANCE,\r\n GL_LUMINANCE_ALPHA,\r\n GL_RGB,\r\n GL_RGBA$1\r\n];\r\n\r\nvar FORMAT_CHANNELS = {};\r\nFORMAT_CHANNELS[GL_LUMINANCE] =\r\nFORMAT_CHANNELS[GL_ALPHA] =\r\nFORMAT_CHANNELS[GL_DEPTH_COMPONENT] = 1;\r\nFORMAT_CHANNELS[GL_DEPTH_STENCIL] =\r\nFORMAT_CHANNELS[GL_LUMINANCE_ALPHA] = 2;\r\nFORMAT_CHANNELS[GL_RGB] =\r\nFORMAT_CHANNELS[GL_SRGB_EXT] = 3;\r\nFORMAT_CHANNELS[GL_RGBA$1] =\r\nFORMAT_CHANNELS[GL_SRGB_ALPHA_EXT] = 4;\r\n\r\nfunction objectName (str) {\r\n return '[object ' + str + ']'\r\n}\r\n\r\nvar CANVAS_CLASS = objectName('HTMLCanvasElement');\r\nvar CONTEXT2D_CLASS = objectName('CanvasRenderingContext2D');\r\nvar BITMAP_CLASS = objectName('ImageBitmap');\r\nvar IMAGE_CLASS = objectName('HTMLImageElement');\r\nvar VIDEO_CLASS = objectName('HTMLVideoElement');\r\n\r\nvar PIXEL_CLASSES = Object.keys(arrayTypes).concat([\r\n CANVAS_CLASS,\r\n CONTEXT2D_CLASS,\r\n BITMAP_CLASS,\r\n IMAGE_CLASS,\r\n VIDEO_CLASS\r\n]);\r\n\r\n// for every texture type, store\r\n// the size in bytes.\r\nvar TYPE_SIZES = [];\r\nTYPE_SIZES[GL_UNSIGNED_BYTE$5] = 1;\r\nTYPE_SIZES[GL_FLOAT$4] = 4;\r\nTYPE_SIZES[GL_HALF_FLOAT_OES$1] = 2;\r\n\r\nTYPE_SIZES[GL_UNSIGNED_SHORT$3] = 2;\r\nTYPE_SIZES[GL_UNSIGNED_INT$3] = 4;\r\n\r\nvar FORMAT_SIZES_SPECIAL = [];\r\nFORMAT_SIZES_SPECIAL[GL_RGBA4] = 2;\r\nFORMAT_SIZES_SPECIAL[GL_RGB5_A1] = 2;\r\nFORMAT_SIZES_SPECIAL[GL_RGB565] = 2;\r\nFORMAT_SIZES_SPECIAL[GL_DEPTH_STENCIL] = 4;\r\n\r\nFORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_S3TC_DXT1_EXT] = 0.5;\r\nFORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_S3TC_DXT1_EXT] = 0.5;\r\nFORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_S3TC_DXT3_EXT] = 1;\r\nFORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_S3TC_DXT5_EXT] = 1;\r\n\r\nFORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_ATC_WEBGL] = 0.5;\r\nFORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL] = 1;\r\nFORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL] = 1;\r\n\r\nFORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG] = 0.5;\r\nFORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG] = 0.25;\r\nFORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG] = 0.5;\r\nFORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG] = 0.25;\r\n\r\nFORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_ETC1_WEBGL] = 0.5;\r\n\r\nfunction isNumericArray (arr) {\r\n return (\r\n Array.isArray(arr) &&\r\n (arr.length === 0 ||\r\n typeof arr[0] === 'number'))\r\n}\r\n\r\nfunction isRectArray (arr) {\r\n if (!Array.isArray(arr)) {\r\n return false\r\n }\r\n var width = arr.length;\r\n if (width === 0 || !isArrayLike(arr[0])) {\r\n return false\r\n }\r\n return true\r\n}\r\n\r\nfunction classString (x) {\r\n return Object.prototype.toString.call(x)\r\n}\r\n\r\nfunction isCanvasElement (object) {\r\n return classString(object) === CANVAS_CLASS\r\n}\r\n\r\nfunction isContext2D (object) {\r\n return classString(object) === CONTEXT2D_CLASS\r\n}\r\n\r\nfunction isBitmap (object) {\r\n return classString(object) === BITMAP_CLASS\r\n}\r\n\r\nfunction isImageElement (object) {\r\n return classString(object) === IMAGE_CLASS\r\n}\r\n\r\nfunction isVideoElement (object) {\r\n return classString(object) === VIDEO_CLASS\r\n}\r\n\r\nfunction isPixelData (object) {\r\n if (!object) {\r\n return false\r\n }\r\n var className = classString(object);\r\n if (PIXEL_CLASSES.indexOf(className) >= 0) {\r\n return true\r\n }\r\n return (\r\n isNumericArray(object) ||\r\n isRectArray(object) ||\r\n isNDArrayLike(object))\r\n}\r\n\r\nfunction typedArrayCode$1 (data) {\r\n return arrayTypes[Object.prototype.toString.call(data)] | 0\r\n}\r\n\r\nfunction convertData (result, data) {\r\n var n = data.length;\r\n switch (result.type) {\r\n case GL_UNSIGNED_BYTE$5:\r\n case GL_UNSIGNED_SHORT$3:\r\n case GL_UNSIGNED_INT$3:\r\n case GL_FLOAT$4:\r\n var converted = pool.allocType(result.type, n);\r\n converted.set(data);\r\n result.data = converted;\r\n break\r\n\r\n case GL_HALF_FLOAT_OES$1:\r\n result.data = convertToHalfFloat(data);\r\n break\r\n\r\n default:\r\n check$1.raise('unsupported texture type, must specify a typed array');\r\n }\r\n}\r\n\r\nfunction preConvert (image, n) {\r\n return pool.allocType(\r\n image.type === GL_HALF_FLOAT_OES$1\r\n ? GL_FLOAT$4\r\n : image.type, n)\r\n}\r\n\r\nfunction postConvert (image, data) {\r\n if (image.type === GL_HALF_FLOAT_OES$1) {\r\n image.data = convertToHalfFloat(data);\r\n pool.freeType(data);\r\n } else {\r\n image.data = data;\r\n }\r\n}\r\n\r\nfunction transposeData (image, array, strideX, strideY, strideC, offset) {\r\n var w = image.width;\r\n var h = image.height;\r\n var c = image.channels;\r\n var n = w * h * c;\r\n var data = preConvert(image, n);\r\n\r\n var p = 0;\r\n for (var i = 0; i < h; ++i) {\r\n for (var j = 0; j < w; ++j) {\r\n for (var k = 0; k < c; ++k) {\r\n data[p++] = array[strideX * j + strideY * i + strideC * k + offset];\r\n }\r\n }\r\n }\r\n\r\n postConvert(image, data);\r\n}\r\n\r\nfunction getTextureSize (format, type, width, height, isMipmap, isCube) {\r\n var s;\r\n if (typeof FORMAT_SIZES_SPECIAL[format] !== 'undefined') {\r\n // we have a special array for dealing with weird color formats such as RGB5A1\r\n s = FORMAT_SIZES_SPECIAL[format];\r\n } else {\r\n s = FORMAT_CHANNELS[format] * TYPE_SIZES[type];\r\n }\r\n\r\n if (isCube) {\r\n s *= 6;\r\n }\r\n\r\n if (isMipmap) {\r\n // compute the total size of all the mipmaps.\r\n var total = 0;\r\n\r\n var w = width;\r\n while (w >= 1) {\r\n // we can only use mipmaps on a square image,\r\n // so we can simply use the width and ignore the height:\r\n total += s * w * w;\r\n w /= 2;\r\n }\r\n return total\r\n } else {\r\n return s * width * height\r\n }\r\n}\r\n\r\nfunction createTextureSet (\r\n gl, extensions, limits, reglPoll, contextState, stats, config) {\r\n // -------------------------------------------------------\r\n // Initialize constants and parameter tables here\r\n // -------------------------------------------------------\r\n var mipmapHint = {\r\n \"don't care\": GL_DONT_CARE,\r\n 'dont care': GL_DONT_CARE,\r\n 'nice': GL_NICEST,\r\n 'fast': GL_FASTEST\r\n };\r\n\r\n var wrapModes = {\r\n 'repeat': GL_REPEAT,\r\n 'clamp': GL_CLAMP_TO_EDGE$1,\r\n 'mirror': GL_MIRRORED_REPEAT\r\n };\r\n\r\n var magFilters = {\r\n 'nearest': GL_NEAREST$1,\r\n 'linear': GL_LINEAR\r\n };\r\n\r\n var minFilters = extend({\r\n 'mipmap': GL_LINEAR_MIPMAP_LINEAR$1,\r\n 'nearest mipmap nearest': GL_NEAREST_MIPMAP_NEAREST$1,\r\n 'linear mipmap nearest': GL_LINEAR_MIPMAP_NEAREST$1,\r\n 'nearest mipmap linear': GL_NEAREST_MIPMAP_LINEAR$1,\r\n 'linear mipmap linear': GL_LINEAR_MIPMAP_LINEAR$1\r\n }, magFilters);\r\n\r\n var colorSpace = {\r\n 'none': 0,\r\n 'browser': GL_BROWSER_DEFAULT_WEBGL\r\n };\r\n\r\n var textureTypes = {\r\n 'uint8': GL_UNSIGNED_BYTE$5,\r\n 'rgba4': GL_UNSIGNED_SHORT_4_4_4_4$1,\r\n 'rgb565': GL_UNSIGNED_SHORT_5_6_5$1,\r\n 'rgb5 a1': GL_UNSIGNED_SHORT_5_5_5_1$1\r\n };\r\n\r\n var textureFormats = {\r\n 'alpha': GL_ALPHA,\r\n 'luminance': GL_LUMINANCE,\r\n 'luminance alpha': GL_LUMINANCE_ALPHA,\r\n 'rgb': GL_RGB,\r\n 'rgba': GL_RGBA$1,\r\n 'rgba4': GL_RGBA4,\r\n 'rgb5 a1': GL_RGB5_A1,\r\n 'rgb565': GL_RGB565\r\n };\r\n\r\n var compressedTextureFormats = {};\r\n\r\n if (extensions.ext_srgb) {\r\n textureFormats.srgb = GL_SRGB_EXT;\r\n textureFormats.srgba = GL_SRGB_ALPHA_EXT;\r\n }\r\n\r\n if (extensions.oes_texture_float) {\r\n textureTypes.float32 = textureTypes.float = GL_FLOAT$4;\r\n }\r\n\r\n if (extensions.oes_texture_half_float) {\r\n textureTypes['float16'] = textureTypes['half float'] = GL_HALF_FLOAT_OES$1;\r\n }\r\n\r\n if (extensions.webgl_depth_texture) {\r\n extend(textureFormats, {\r\n 'depth': GL_DEPTH_COMPONENT,\r\n 'depth stencil': GL_DEPTH_STENCIL\r\n });\r\n\r\n extend(textureTypes, {\r\n 'uint16': GL_UNSIGNED_SHORT$3,\r\n 'uint32': GL_UNSIGNED_INT$3,\r\n 'depth stencil': GL_UNSIGNED_INT_24_8_WEBGL$1\r\n });\r\n }\r\n\r\n if (extensions.webgl_compressed_texture_s3tc) {\r\n extend(compressedTextureFormats, {\r\n 'rgb s3tc dxt1': GL_COMPRESSED_RGB_S3TC_DXT1_EXT,\r\n 'rgba s3tc dxt1': GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,\r\n 'rgba s3tc dxt3': GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,\r\n 'rgba s3tc dxt5': GL_COMPRESSED_RGBA_S3TC_DXT5_EXT\r\n });\r\n }\r\n\r\n if (extensions.webgl_compressed_texture_atc) {\r\n extend(compressedTextureFormats, {\r\n 'rgb atc': GL_COMPRESSED_RGB_ATC_WEBGL,\r\n 'rgba atc explicit alpha': GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,\r\n 'rgba atc interpolated alpha': GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL\r\n });\r\n }\r\n\r\n if (extensions.webgl_compressed_texture_pvrtc) {\r\n extend(compressedTextureFormats, {\r\n 'rgb pvrtc 4bppv1': GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG,\r\n 'rgb pvrtc 2bppv1': GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG,\r\n 'rgba pvrtc 4bppv1': GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,\r\n 'rgba pvrtc 2bppv1': GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG\r\n });\r\n }\r\n\r\n if (extensions.webgl_compressed_texture_etc1) {\r\n compressedTextureFormats['rgb etc1'] = GL_COMPRESSED_RGB_ETC1_WEBGL;\r\n }\r\n\r\n // Copy over all texture formats\r\n var supportedCompressedFormats = Array.prototype.slice.call(\r\n gl.getParameter(GL_COMPRESSED_TEXTURE_FORMATS));\r\n Object.keys(compressedTextureFormats).forEach(function (name) {\r\n var format = compressedTextureFormats[name];\r\n if (supportedCompressedFormats.indexOf(format) >= 0) {\r\n textureFormats[name] = format;\r\n }\r\n });\r\n\r\n var supportedFormats = Object.keys(textureFormats);\r\n limits.textureFormats = supportedFormats;\r\n\r\n // associate with every format string its\r\n // corresponding GL-value.\r\n var textureFormatsInvert = [];\r\n Object.keys(textureFormats).forEach(function (key) {\r\n var val = textureFormats[key];\r\n textureFormatsInvert[val] = key;\r\n });\r\n\r\n // associate with every type string its\r\n // corresponding GL-value.\r\n var textureTypesInvert = [];\r\n Object.keys(textureTypes).forEach(function (key) {\r\n var val = textureTypes[key];\r\n textureTypesInvert[val] = key;\r\n });\r\n\r\n var magFiltersInvert = [];\r\n Object.keys(magFilters).forEach(function (key) {\r\n var val = magFilters[key];\r\n magFiltersInvert[val] = key;\r\n });\r\n\r\n var minFiltersInvert = [];\r\n Object.keys(minFilters).forEach(function (key) {\r\n var val = minFilters[key];\r\n minFiltersInvert[val] = key;\r\n });\r\n\r\n var wrapModesInvert = [];\r\n Object.keys(wrapModes).forEach(function (key) {\r\n var val = wrapModes[key];\r\n wrapModesInvert[val] = key;\r\n });\r\n\r\n // colorFormats[] gives the format (channels) associated to an\r\n // internalformat\r\n var colorFormats = supportedFormats.reduce(function (color, key) {\r\n var glenum = textureFormats[key];\r\n if (glenum === GL_LUMINANCE ||\r\n glenum === GL_ALPHA ||\r\n glenum === GL_LUMINANCE ||\r\n glenum === GL_LUMINANCE_ALPHA ||\r\n glenum === GL_DEPTH_COMPONENT ||\r\n glenum === GL_DEPTH_STENCIL) {\r\n color[glenum] = glenum;\r\n } else if (glenum === GL_RGB5_A1 || key.indexOf('rgba') >= 0) {\r\n color[glenum] = GL_RGBA$1;\r\n } else {\r\n color[glenum] = GL_RGB;\r\n }\r\n return color\r\n }, {});\r\n\r\n function TexFlags () {\r\n // format info\r\n this.internalformat = GL_RGBA$1;\r\n this.format = GL_RGBA$1;\r\n this.type = GL_UNSIGNED_BYTE$5;\r\n this.compressed = false;\r\n\r\n // pixel storage\r\n this.premultiplyAlpha = false;\r\n this.flipY = false;\r\n this.unpackAlignment = 1;\r\n this.colorSpace = GL_BROWSER_DEFAULT_WEBGL;\r\n\r\n // shape info\r\n this.width = 0;\r\n this.height = 0;\r\n this.channels = 0;\r\n }\r\n\r\n function copyFlags (result, other) {\r\n result.internalformat = other.internalformat;\r\n result.format = other.format;\r\n result.type = other.type;\r\n result.compressed = other.compressed;\r\n\r\n result.premultiplyAlpha = other.premultiplyAlpha;\r\n result.flipY = other.flipY;\r\n result.unpackAlignment = other.unpackAlignment;\r\n result.colorSpace = other.colorSpace;\r\n\r\n result.width = other.width;\r\n result.height = other.height;\r\n result.channels = other.channels;\r\n }\r\n\r\n function parseFlags (flags, options) {\r\n if (typeof options !== 'object' || !options) {\r\n return\r\n }\r\n\r\n if ('premultiplyAlpha' in options) {\r\n check$1.type(options.premultiplyAlpha, 'boolean',\r\n 'invalid premultiplyAlpha');\r\n flags.premultiplyAlpha = options.premultiplyAlpha;\r\n }\r\n\r\n if ('flipY' in options) {\r\n check$1.type(options.flipY, 'boolean',\r\n 'invalid texture flip');\r\n flags.flipY = options.flipY;\r\n }\r\n\r\n if ('alignment' in options) {\r\n check$1.oneOf(options.alignment, [1, 2, 4, 8],\r\n 'invalid texture unpack alignment');\r\n flags.unpackAlignment = options.alignment;\r\n }\r\n\r\n if ('colorSpace' in options) {\r\n check$1.parameter(options.colorSpace, colorSpace,\r\n 'invalid colorSpace');\r\n flags.colorSpace = colorSpace[options.colorSpace];\r\n }\r\n\r\n if ('type' in options) {\r\n var type = options.type;\r\n check$1(extensions.oes_texture_float ||\r\n !(type === 'float' || type === 'float32'),\r\n 'you must enable the OES_texture_float extension in order to use floating point textures.');\r\n check$1(extensions.oes_texture_half_float ||\r\n !(type === 'half float' || type === 'float16'),\r\n 'you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures.');\r\n check$1(extensions.webgl_depth_texture ||\r\n !(type === 'uint16' || type === 'uint32' || type === 'depth stencil'),\r\n 'you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures.');\r\n check$1.parameter(type, textureTypes,\r\n 'invalid texture type');\r\n flags.type = textureTypes[type];\r\n }\r\n\r\n var w = flags.width;\r\n var h = flags.height;\r\n var c = flags.channels;\r\n var hasChannels = false;\r\n if ('shape' in options) {\r\n check$1(Array.isArray(options.shape) && options.shape.length >= 2,\r\n 'shape must be an array');\r\n w = options.shape[0];\r\n h = options.shape[1];\r\n if (options.shape.length === 3) {\r\n c = options.shape[2];\r\n check$1(c > 0 && c <= 4, 'invalid number of channels');\r\n hasChannels = true;\r\n }\r\n check$1(w >= 0 && w <= limits.maxTextureSize, 'invalid width');\r\n check$1(h >= 0 && h <= limits.maxTextureSize, 'invalid height');\r\n } else {\r\n if ('radius' in options) {\r\n w = h = options.radius;\r\n check$1(w >= 0 && w <= limits.maxTextureSize, 'invalid radius');\r\n }\r\n if ('width' in options) {\r\n w = options.width;\r\n check$1(w >= 0 && w <= limits.maxTextureSize, 'invalid width');\r\n }\r\n if ('height' in options) {\r\n h = options.height;\r\n check$1(h >= 0 && h <= limits.maxTextureSize, 'invalid height');\r\n }\r\n if ('channels' in options) {\r\n c = options.channels;\r\n check$1(c > 0 && c <= 4, 'invalid number of channels');\r\n hasChannels = true;\r\n }\r\n }\r\n flags.width = w | 0;\r\n flags.height = h | 0;\r\n flags.channels = c | 0;\r\n\r\n var hasFormat = false;\r\n if ('format' in options) {\r\n var formatStr = options.format;\r\n check$1(extensions.webgl_depth_texture ||\r\n !(formatStr === 'depth' || formatStr === 'depth stencil'),\r\n 'you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures.');\r\n check$1.parameter(formatStr, textureFormats,\r\n 'invalid texture format');\r\n var internalformat = flags.internalformat = textureFormats[formatStr];\r\n flags.format = colorFormats[internalformat];\r\n if (formatStr in textureTypes) {\r\n if (!('type' in options)) {\r\n flags.type = textureTypes[formatStr];\r\n }\r\n }\r\n if (formatStr in compressedTextureFormats) {\r\n flags.compressed = true;\r\n }\r\n hasFormat = true;\r\n }\r\n\r\n // Reconcile channels and format\r\n if (!hasChannels && hasFormat) {\r\n flags.channels = FORMAT_CHANNELS[flags.format];\r\n } else if (hasChannels && !hasFormat) {\r\n if (flags.channels !== CHANNELS_FORMAT[flags.format]) {\r\n flags.format = flags.internalformat = CHANNELS_FORMAT[flags.channels];\r\n }\r\n } else if (hasFormat && hasChannels) {\r\n check$1(\r\n flags.channels === FORMAT_CHANNELS[flags.format],\r\n 'number of channels inconsistent with specified format');\r\n }\r\n }\r\n\r\n function setFlags (flags) {\r\n gl.pixelStorei(GL_UNPACK_FLIP_Y_WEBGL, flags.flipY);\r\n gl.pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL, flags.premultiplyAlpha);\r\n gl.pixelStorei(GL_UNPACK_COLORSPACE_CONVERSION_WEBGL, flags.colorSpace);\r\n gl.pixelStorei(GL_UNPACK_ALIGNMENT, flags.unpackAlignment);\r\n }\r\n\r\n // -------------------------------------------------------\r\n // Tex image data\r\n // -------------------------------------------------------\r\n function TexImage () {\r\n TexFlags.call(this);\r\n\r\n this.xOffset = 0;\r\n this.yOffset = 0;\r\n\r\n // data\r\n this.data = null;\r\n this.needsFree = false;\r\n\r\n // html element\r\n this.element = null;\r\n\r\n // copyTexImage info\r\n this.needsCopy = false;\r\n }\r\n\r\n function parseImage (image, options) {\r\n var data = null;\r\n if (isPixelData(options)) {\r\n data = options;\r\n } else if (options) {\r\n check$1.type(options, 'object', 'invalid pixel data type');\r\n parseFlags(image, options);\r\n if ('x' in options) {\r\n image.xOffset = options.x | 0;\r\n }\r\n if ('y' in options) {\r\n image.yOffset = options.y | 0;\r\n }\r\n if (isPixelData(options.data)) {\r\n data = options.data;\r\n }\r\n }\r\n\r\n check$1(\r\n !image.compressed ||\r\n data instanceof Uint8Array,\r\n 'compressed texture data must be stored in a uint8array');\r\n\r\n if (options.copy) {\r\n check$1(!data, 'can not specify copy and data field for the same texture');\r\n var viewW = contextState.viewportWidth;\r\n var viewH = contextState.viewportHeight;\r\n image.width = image.width || (viewW - image.xOffset);\r\n image.height = image.height || (viewH - image.yOffset);\r\n image.needsCopy = true;\r\n check$1(image.xOffset >= 0 && image.xOffset < viewW &&\r\n image.yOffset >= 0 && image.yOffset < viewH &&\r\n image.width > 0 && image.width <= viewW &&\r\n image.height > 0 && image.height <= viewH,\r\n 'copy texture read out of bounds');\r\n } else if (!data) {\r\n image.width = image.width || 1;\r\n image.height = image.height || 1;\r\n image.channels = image.channels || 4;\r\n } else if (isTypedArray(data)) {\r\n image.channels = image.channels || 4;\r\n image.data = data;\r\n if (!('type' in options) && image.type === GL_UNSIGNED_BYTE$5) {\r\n image.type = typedArrayCode$1(data);\r\n }\r\n } else if (isNumericArray(data)) {\r\n image.channels = image.channels || 4;\r\n convertData(image, data);\r\n image.alignment = 1;\r\n image.needsFree = true;\r\n } else if (isNDArrayLike(data)) {\r\n var array = data.data;\r\n if (!Array.isArray(array) && image.type === GL_UNSIGNED_BYTE$5) {\r\n image.type = typedArrayCode$1(array);\r\n }\r\n var shape = data.shape;\r\n var stride = data.stride;\r\n var shapeX, shapeY, shapeC, strideX, strideY, strideC;\r\n if (shape.length === 3) {\r\n shapeC = shape[2];\r\n strideC = stride[2];\r\n } else {\r\n check$1(shape.length === 2, 'invalid ndarray pixel data, must be 2 or 3D');\r\n shapeC = 1;\r\n strideC = 1;\r\n }\r\n shapeX = shape[0];\r\n shapeY = shape[1];\r\n strideX = stride[0];\r\n strideY = stride[1];\r\n image.alignment = 1;\r\n image.width = shapeX;\r\n image.height = shapeY;\r\n image.channels = shapeC;\r\n image.format = image.internalformat = CHANNELS_FORMAT[shapeC];\r\n image.needsFree = true;\r\n transposeData(image, array, strideX, strideY, strideC, data.offset);\r\n } else if (isCanvasElement(data) || isContext2D(data)) {\r\n if (isCanvasElement(data)) {\r\n image.element = data;\r\n } else {\r\n image.element = data.canvas;\r\n }\r\n image.width = image.element.width;\r\n image.height = image.element.height;\r\n image.channels = 4;\r\n } else if (isBitmap(data)) {\r\n image.element = data;\r\n image.width = data.width;\r\n image.height = data.height;\r\n image.channels = 4;\r\n } else if (isImageElement(data)) {\r\n image.element = data;\r\n image.width = data.naturalWidth;\r\n image.height = data.naturalHeight;\r\n image.channels = 4;\r\n } else if (isVideoElement(data)) {\r\n image.element = data;\r\n image.width = data.videoWidth;\r\n image.height = data.videoHeight;\r\n image.channels = 4;\r\n } else if (isRectArray(data)) {\r\n var w = image.width || data[0].length;\r\n var h = image.height || data.length;\r\n var c = image.channels;\r\n if (isArrayLike(data[0][0])) {\r\n c = c || data[0][0].length;\r\n } else {\r\n c = c || 1;\r\n }\r\n var arrayShape = flattenUtils.shape(data);\r\n var n = 1;\r\n for (var dd = 0; dd < arrayShape.length; ++dd) {\r\n n *= arrayShape[dd];\r\n }\r\n var allocData = preConvert(image, n);\r\n flattenUtils.flatten(data, arrayShape, '', allocData);\r\n postConvert(image, allocData);\r\n image.alignment = 1;\r\n image.width = w;\r\n image.height = h;\r\n image.channels = c;\r\n image.format = image.internalformat = CHANNELS_FORMAT[c];\r\n image.needsFree = true;\r\n }\r\n\r\n if (image.type === GL_FLOAT$4) {\r\n check$1(limits.extensions.indexOf('oes_texture_float') >= 0,\r\n 'oes_texture_float extension not enabled');\r\n } else if (image.type === GL_HALF_FLOAT_OES$1) {\r\n check$1(limits.extensions.indexOf('oes_texture_half_float') >= 0,\r\n 'oes_texture_half_float extension not enabled');\r\n }\r\n\r\n // do compressed texture validation here.\r\n }\r\n\r\n function setImage (info, target, miplevel) {\r\n var element = info.element;\r\n var data = info.data;\r\n var internalformat = info.internalformat;\r\n var format = info.format;\r\n var type = info.type;\r\n var width = info.width;\r\n var height = info.height;\r\n var channels = info.channels;\r\n\r\n setFlags(info);\r\n\r\n if (element) {\r\n gl.texImage2D(target, miplevel, format, format, type, element);\r\n } else if (info.compressed) {\r\n gl.compressedTexImage2D(target, miplevel, internalformat, width, height, 0, data);\r\n } else if (info.needsCopy) {\r\n reglPoll();\r\n gl.copyTexImage2D(\r\n target, miplevel, format, info.xOffset, info.yOffset, width, height, 0);\r\n } else {\r\n var nullData = !data;\r\n if (nullData) {\r\n data = pool.zero.allocType(type, width * height * channels);\r\n }\r\n\r\n gl.texImage2D(target, miplevel, format, width, height, 0, format, type, data);\r\n\r\n if (nullData && data) {\r\n pool.zero.freeType(data);\r\n }\r\n }\r\n }\r\n\r\n function setSubImage (info, target, x, y, miplevel) {\r\n var element = info.element;\r\n var data = info.data;\r\n var internalformat = info.internalformat;\r\n var format = info.format;\r\n var type = info.type;\r\n var width = info.width;\r\n var height = info.height;\r\n\r\n setFlags(info);\r\n\r\n if (element) {\r\n gl.texSubImage2D(\r\n target, miplevel, x, y, format, type, element);\r\n } else if (info.compressed) {\r\n gl.compressedTexSubImage2D(\r\n target, miplevel, x, y, internalformat, width, height, data);\r\n } else if (info.needsCopy) {\r\n reglPoll();\r\n gl.copyTexSubImage2D(\r\n target, miplevel, x, y, info.xOffset, info.yOffset, width, height);\r\n } else {\r\n gl.texSubImage2D(\r\n target, miplevel, x, y, width, height, format, type, data);\r\n }\r\n }\r\n\r\n // texImage pool\r\n var imagePool = [];\r\n\r\n function allocImage () {\r\n return imagePool.pop() || new TexImage()\r\n }\r\n\r\n function freeImage (image) {\r\n if (image.needsFree) {\r\n pool.freeType(image.data);\r\n }\r\n TexImage.call(image);\r\n imagePool.push(image);\r\n }\r\n\r\n // -------------------------------------------------------\r\n // Mip map\r\n // -------------------------------------------------------\r\n function MipMap () {\r\n TexFlags.call(this);\r\n\r\n this.genMipmaps = false;\r\n this.mipmapHint = GL_DONT_CARE;\r\n this.mipmask = 0;\r\n this.images = Array(16);\r\n }\r\n\r\n function parseMipMapFromShape (mipmap, width, height) {\r\n var img = mipmap.images[0] = allocImage();\r\n mipmap.mipmask = 1;\r\n img.width = mipmap.width = width;\r\n img.height = mipmap.height = height;\r\n img.channels = mipmap.channels = 4;\r\n }\r\n\r\n function parseMipMapFromObject (mipmap, options) {\r\n var imgData = null;\r\n if (isPixelData(options)) {\r\n imgData = mipmap.images[0] = allocImage();\r\n copyFlags(imgData, mipmap);\r\n parseImage(imgData, options);\r\n mipmap.mipmask = 1;\r\n } else {\r\n parseFlags(mipmap, options);\r\n if (Array.isArray(options.mipmap)) {\r\n var mipData = options.mipmap;\r\n for (var i = 0; i < mipData.length; ++i) {\r\n imgData = mipmap.images[i] = allocImage();\r\n copyFlags(imgData, mipmap);\r\n imgData.width >>= i;\r\n imgData.height >>= i;\r\n parseImage(imgData, mipData[i]);\r\n mipmap.mipmask |= (1 << i);\r\n }\r\n } else {\r\n imgData = mipmap.images[0] = allocImage();\r\n copyFlags(imgData, mipmap);\r\n parseImage(imgData, options);\r\n mipmap.mipmask = 1;\r\n }\r\n }\r\n copyFlags(mipmap, mipmap.images[0]);\r\n\r\n // For textures of the compressed format WEBGL_compressed_texture_s3tc\r\n // we must have that\r\n //\r\n // \"When level equals zero width and height must be a multiple of 4.\r\n // When level is greater than 0 width and height must be 0, 1, 2 or a multiple of 4. \"\r\n //\r\n // but we do not yet support having multiple mipmap levels for compressed textures,\r\n // so we only test for level zero.\r\n\r\n if (mipmap.compressed &&\r\n (mipmap.internalformat === GL_COMPRESSED_RGB_S3TC_DXT1_EXT) ||\r\n (mipmap.internalformat === GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) ||\r\n (mipmap.internalformat === GL_COMPRESSED_RGBA_S3TC_DXT3_EXT) ||\r\n (mipmap.internalformat === GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)) {\r\n check$1(mipmap.width % 4 === 0 &&\r\n mipmap.height % 4 === 0,\r\n 'for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4');\r\n }\r\n }\r\n\r\n function setMipMap (mipmap, target) {\r\n var images = mipmap.images;\r\n for (var i = 0; i < images.length; ++i) {\r\n if (!images[i]) {\r\n return\r\n }\r\n setImage(images[i], target, i);\r\n }\r\n }\r\n\r\n var mipPool = [];\r\n\r\n function allocMipMap () {\r\n var result = mipPool.pop() || new MipMap();\r\n TexFlags.call(result);\r\n result.mipmask = 0;\r\n for (var i = 0; i < 16; ++i) {\r\n result.images[i] = null;\r\n }\r\n return result\r\n }\r\n\r\n function freeMipMap (mipmap) {\r\n var images = mipmap.images;\r\n for (var i = 0; i < images.length; ++i) {\r\n if (images[i]) {\r\n freeImage(images[i]);\r\n }\r\n images[i] = null;\r\n }\r\n mipPool.push(mipmap);\r\n }\r\n\r\n // -------------------------------------------------------\r\n // Tex info\r\n // -------------------------------------------------------\r\n function TexInfo () {\r\n this.minFilter = GL_NEAREST$1;\r\n this.magFilter = GL_NEAREST$1;\r\n\r\n this.wrapS = GL_CLAMP_TO_EDGE$1;\r\n this.wrapT = GL_CLAMP_TO_EDGE$1;\r\n\r\n this.anisotropic = 1;\r\n\r\n this.genMipmaps = false;\r\n this.mipmapHint = GL_DONT_CARE;\r\n }\r\n\r\n function parseTexInfo (info, options) {\r\n if ('min' in options) {\r\n var minFilter = options.min;\r\n check$1.parameter(minFilter, minFilters);\r\n info.minFilter = minFilters[minFilter];\r\n if (MIPMAP_FILTERS.indexOf(info.minFilter) >= 0 && !('faces' in options)) {\r\n info.genMipmaps = true;\r\n }\r\n }\r\n\r\n if ('mag' in options) {\r\n var magFilter = options.mag;\r\n check$1.parameter(magFilter, magFilters);\r\n info.magFilter = magFilters[magFilter];\r\n }\r\n\r\n var wrapS = info.wrapS;\r\n var wrapT = info.wrapT;\r\n if ('wrap' in options) {\r\n var wrap = options.wrap;\r\n if (typeof wrap === 'string') {\r\n check$1.parameter(wrap, wrapModes);\r\n wrapS = wrapT = wrapModes[wrap];\r\n } else if (Array.isArray(wrap)) {\r\n check$1.parameter(wrap[0], wrapModes);\r\n check$1.parameter(wrap[1], wrapModes);\r\n wrapS = wrapModes[wrap[0]];\r\n wrapT = wrapModes[wrap[1]];\r\n }\r\n } else {\r\n if ('wrapS' in options) {\r\n var optWrapS = options.wrapS;\r\n check$1.parameter(optWrapS, wrapModes);\r\n wrapS = wrapModes[optWrapS];\r\n }\r\n if ('wrapT' in options) {\r\n var optWrapT = options.wrapT;\r\n check$1.parameter(optWrapT, wrapModes);\r\n wrapT = wrapModes[optWrapT];\r\n }\r\n }\r\n info.wrapS = wrapS;\r\n info.wrapT = wrapT;\r\n\r\n if ('anisotropic' in options) {\r\n var anisotropic = options.anisotropic;\r\n check$1(typeof anisotropic === 'number' &&\r\n anisotropic >= 1 && anisotropic <= limits.maxAnisotropic,\r\n 'aniso samples must be between 1 and ');\r\n info.anisotropic = options.anisotropic;\r\n }\r\n\r\n if ('mipmap' in options) {\r\n var hasMipMap = false;\r\n switch (typeof options.mipmap) {\r\n case 'string':\r\n check$1.parameter(options.mipmap, mipmapHint,\r\n 'invalid mipmap hint');\r\n info.mipmapHint = mipmapHint[options.mipmap];\r\n info.genMipmaps = true;\r\n hasMipMap = true;\r\n break\r\n\r\n case 'boolean':\r\n hasMipMap = info.genMipmaps = options.mipmap;\r\n break\r\n\r\n case 'object':\r\n check$1(Array.isArray(options.mipmap), 'invalid mipmap type');\r\n info.genMipmaps = false;\r\n hasMipMap = true;\r\n break\r\n\r\n default:\r\n check$1.raise('invalid mipmap type');\r\n }\r\n if (hasMipMap && !('min' in options)) {\r\n info.minFilter = GL_NEAREST_MIPMAP_NEAREST$1;\r\n }\r\n }\r\n }\r\n\r\n function setTexInfo (info, target) {\r\n gl.texParameteri(target, GL_TEXTURE_MIN_FILTER, info.minFilter);\r\n gl.texParameteri(target, GL_TEXTURE_MAG_FILTER, info.magFilter);\r\n gl.texParameteri(target, GL_TEXTURE_WRAP_S, info.wrapS);\r\n gl.texParameteri(target, GL_TEXTURE_WRAP_T, info.wrapT);\r\n if (extensions.ext_texture_filter_anisotropic) {\r\n gl.texParameteri(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, info.anisotropic);\r\n }\r\n if (info.genMipmaps) {\r\n gl.hint(GL_GENERATE_MIPMAP_HINT, info.mipmapHint);\r\n gl.generateMipmap(target);\r\n }\r\n }\r\n\r\n // -------------------------------------------------------\r\n // Full texture object\r\n // -------------------------------------------------------\r\n var textureCount = 0;\r\n var textureSet = {};\r\n var numTexUnits = limits.maxTextureUnits;\r\n var textureUnits = Array(numTexUnits).map(function () {\r\n return null\r\n });\r\n\r\n function REGLTexture (target) {\r\n TexFlags.call(this);\r\n this.mipmask = 0;\r\n this.internalformat = GL_RGBA$1;\r\n\r\n this.id = textureCount++;\r\n\r\n this.refCount = 1;\r\n\r\n this.target = target;\r\n this.texture = gl.createTexture();\r\n\r\n this.unit = -1;\r\n this.bindCount = 0;\r\n\r\n this.texInfo = new TexInfo();\r\n\r\n if (config.profile) {\r\n this.stats = {size: 0};\r\n }\r\n }\r\n\r\n function tempBind (texture) {\r\n gl.activeTexture(GL_TEXTURE0$1);\r\n gl.bindTexture(texture.target, texture.texture);\r\n }\r\n\r\n function tempRestore () {\r\n var prev = textureUnits[0];\r\n if (prev) {\r\n gl.bindTexture(prev.target, prev.texture);\r\n } else {\r\n gl.bindTexture(GL_TEXTURE_2D$1, null);\r\n }\r\n }\r\n\r\n function destroy (texture) {\r\n var handle = texture.texture;\r\n check$1(handle, 'must not double destroy texture');\r\n var unit = texture.unit;\r\n var target = texture.target;\r\n if (unit >= 0) {\r\n gl.activeTexture(GL_TEXTURE0$1 + unit);\r\n gl.bindTexture(target, null);\r\n textureUnits[unit] = null;\r\n }\r\n gl.deleteTexture(handle);\r\n texture.texture = null;\r\n texture.params = null;\r\n texture.pixels = null;\r\n texture.refCount = 0;\r\n delete textureSet[texture.id];\r\n stats.textureCount--;\r\n }\r\n\r\n extend(REGLTexture.prototype, {\r\n bind: function () {\r\n var texture = this;\r\n texture.bindCount += 1;\r\n var unit = texture.unit;\r\n if (unit < 0) {\r\n for (var i = 0; i < numTexUnits; ++i) {\r\n var other = textureUnits[i];\r\n if (other) {\r\n if (other.bindCount > 0) {\r\n continue\r\n }\r\n other.unit = -1;\r\n }\r\n textureUnits[i] = texture;\r\n unit = i;\r\n break\r\n }\r\n if (unit >= numTexUnits) {\r\n check$1.raise('insufficient number of texture units');\r\n }\r\n if (config.profile && stats.maxTextureUnits < (unit + 1)) {\r\n stats.maxTextureUnits = unit + 1; // +1, since the units are zero-based\r\n }\r\n texture.unit = unit;\r\n gl.activeTexture(GL_TEXTURE0$1 + unit);\r\n gl.bindTexture(texture.target, texture.texture);\r\n }\r\n return unit\r\n },\r\n\r\n unbind: function () {\r\n this.bindCount -= 1;\r\n },\r\n\r\n decRef: function () {\r\n if (--this.refCount <= 0) {\r\n destroy(this);\r\n }\r\n }\r\n });\r\n\r\n function createTexture2D (a, b) {\r\n var texture = new REGLTexture(GL_TEXTURE_2D$1);\r\n textureSet[texture.id] = texture;\r\n stats.textureCount++;\r\n\r\n function reglTexture2D (a, b) {\r\n var texInfo = texture.texInfo;\r\n TexInfo.call(texInfo);\r\n var mipData = allocMipMap();\r\n\r\n if (typeof a === 'number') {\r\n if (typeof b === 'number') {\r\n parseMipMapFromShape(mipData, a | 0, b | 0);\r\n } else {\r\n parseMipMapFromShape(mipData, a | 0, a | 0);\r\n }\r\n } else if (a) {\r\n check$1.type(a, 'object', 'invalid arguments to regl.texture');\r\n parseTexInfo(texInfo, a);\r\n parseMipMapFromObject(mipData, a);\r\n } else {\r\n // empty textures get assigned a default shape of 1x1\r\n parseMipMapFromShape(mipData, 1, 1);\r\n }\r\n\r\n if (texInfo.genMipmaps) {\r\n mipData.mipmask = (mipData.width << 1) - 1;\r\n }\r\n texture.mipmask = mipData.mipmask;\r\n\r\n copyFlags(texture, mipData);\r\n\r\n check$1.texture2D(texInfo, mipData, limits);\r\n texture.internalformat = mipData.internalformat;\r\n\r\n reglTexture2D.width = mipData.width;\r\n reglTexture2D.height = mipData.height;\r\n\r\n tempBind(texture);\r\n setMipMap(mipData, GL_TEXTURE_2D$1);\r\n setTexInfo(texInfo, GL_TEXTURE_2D$1);\r\n tempRestore();\r\n\r\n freeMipMap(mipData);\r\n\r\n if (config.profile) {\r\n texture.stats.size = getTextureSize(\r\n texture.internalformat,\r\n texture.type,\r\n mipData.width,\r\n mipData.height,\r\n texInfo.genMipmaps,\r\n false);\r\n }\r\n reglTexture2D.format = textureFormatsInvert[texture.internalformat];\r\n reglTexture2D.type = textureTypesInvert[texture.type];\r\n\r\n reglTexture2D.mag = magFiltersInvert[texInfo.magFilter];\r\n reglTexture2D.min = minFiltersInvert[texInfo.minFilter];\r\n\r\n reglTexture2D.wrapS = wrapModesInvert[texInfo.wrapS];\r\n reglTexture2D.wrapT = wrapModesInvert[texInfo.wrapT];\r\n\r\n return reglTexture2D\r\n }\r\n\r\n function subimage (image, x_, y_, level_) {\r\n check$1(!!image, 'must specify image data');\r\n\r\n var x = x_ | 0;\r\n var y = y_ | 0;\r\n var level = level_ | 0;\r\n\r\n var imageData = allocImage();\r\n copyFlags(imageData, texture);\r\n imageData.width = 0;\r\n imageData.height = 0;\r\n parseImage(imageData, image);\r\n imageData.width = imageData.width || ((texture.width >> level) - x);\r\n imageData.height = imageData.height || ((texture.height >> level) - y);\r\n\r\n check$1(\r\n texture.type === imageData.type &&\r\n texture.format === imageData.format &&\r\n texture.internalformat === imageData.internalformat,\r\n 'incompatible format for texture.subimage');\r\n check$1(\r\n x >= 0 && y >= 0 &&\r\n x + imageData.width <= texture.width &&\r\n y + imageData.height <= texture.height,\r\n 'texture.subimage write out of bounds');\r\n check$1(\r\n texture.mipmask & (1 << level),\r\n 'missing mipmap data');\r\n check$1(\r\n imageData.data || imageData.element || imageData.needsCopy,\r\n 'missing image data');\r\n\r\n tempBind(texture);\r\n setSubImage(imageData, GL_TEXTURE_2D$1, x, y, level);\r\n tempRestore();\r\n\r\n freeImage(imageData);\r\n\r\n return reglTexture2D\r\n }\r\n\r\n function resize (w_, h_) {\r\n var w = w_ | 0;\r\n var h = (h_ | 0) || w;\r\n if (w === texture.width && h === texture.height) {\r\n return reglTexture2D\r\n }\r\n\r\n reglTexture2D.width = texture.width = w;\r\n reglTexture2D.height = texture.height = h;\r\n\r\n tempBind(texture);\r\n\r\n var data;\r\n var channels = texture.channels;\r\n var type = texture.type;\r\n\r\n for (var i = 0; texture.mipmask >> i; ++i) {\r\n var _w = w >> i;\r\n var _h = h >> i;\r\n if (!_w || !_h) break\r\n data = pool.zero.allocType(type, _w * _h * channels);\r\n gl.texImage2D(\r\n GL_TEXTURE_2D$1,\r\n i,\r\n texture.format,\r\n _w,\r\n _h,\r\n 0,\r\n texture.format,\r\n texture.type,\r\n data);\r\n if (data) pool.zero.freeType(data);\r\n }\r\n tempRestore();\r\n\r\n // also, recompute the texture size.\r\n if (config.profile) {\r\n texture.stats.size = getTextureSize(\r\n texture.internalformat,\r\n texture.type,\r\n w,\r\n h,\r\n false,\r\n false);\r\n }\r\n\r\n return reglTexture2D\r\n }\r\n\r\n reglTexture2D(a, b);\r\n\r\n reglTexture2D.subimage = subimage;\r\n reglTexture2D.resize = resize;\r\n reglTexture2D._reglType = 'texture2d';\r\n reglTexture2D._texture = texture;\r\n if (config.profile) {\r\n reglTexture2D.stats = texture.stats;\r\n }\r\n reglTexture2D.destroy = function () {\r\n texture.decRef();\r\n };\r\n\r\n return reglTexture2D\r\n }\r\n\r\n function createTextureCube (a0, a1, a2, a3, a4, a5) {\r\n var texture = new REGLTexture(GL_TEXTURE_CUBE_MAP$1);\r\n textureSet[texture.id] = texture;\r\n stats.cubeCount++;\r\n\r\n var faces = new Array(6);\r\n\r\n function reglTextureCube (a0, a1, a2, a3, a4, a5) {\r\n var i;\r\n var texInfo = texture.texInfo;\r\n TexInfo.call(texInfo);\r\n for (i = 0; i < 6; ++i) {\r\n faces[i] = allocMipMap();\r\n }\r\n\r\n if (typeof a0 === 'number' || !a0) {\r\n var s = (a0 | 0) || 1;\r\n for (i = 0; i < 6; ++i) {\r\n parseMipMapFromShape(faces[i], s, s);\r\n }\r\n } else if (typeof a0 === 'object') {\r\n if (a1) {\r\n parseMipMapFromObject(faces[0], a0);\r\n parseMipMapFromObject(faces[1], a1);\r\n parseMipMapFromObject(faces[2], a2);\r\n parseMipMapFromObject(faces[3], a3);\r\n parseMipMapFromObject(faces[4], a4);\r\n parseMipMapFromObject(faces[5], a5);\r\n } else {\r\n parseTexInfo(texInfo, a0);\r\n parseFlags(texture, a0);\r\n if ('faces' in a0) {\r\n var face_input = a0.faces;\r\n check$1(Array.isArray(face_input) && face_input.length === 6,\r\n 'cube faces must be a length 6 array');\r\n for (i = 0; i < 6; ++i) {\r\n check$1(typeof face_input[i] === 'object' && !!face_input[i],\r\n 'invalid input for cube map face');\r\n copyFlags(faces[i], texture);\r\n parseMipMapFromObject(faces[i], face_input[i]);\r\n }\r\n } else {\r\n for (i = 0; i < 6; ++i) {\r\n parseMipMapFromObject(faces[i], a0);\r\n }\r\n }\r\n }\r\n } else {\r\n check$1.raise('invalid arguments to cube map');\r\n }\r\n\r\n copyFlags(texture, faces[0]);\r\n\r\n if (!limits.npotTextureCube) {\r\n check$1(isPow2$1(texture.width) && isPow2$1(texture.height), 'your browser does not support non power or two texture dimensions');\r\n }\r\n\r\n if (texInfo.genMipmaps) {\r\n texture.mipmask = (faces[0].width << 1) - 1;\r\n } else {\r\n texture.mipmask = faces[0].mipmask;\r\n }\r\n\r\n check$1.textureCube(texture, texInfo, faces, limits);\r\n texture.internalformat = faces[0].internalformat;\r\n\r\n reglTextureCube.width = faces[0].width;\r\n reglTextureCube.height = faces[0].height;\r\n\r\n tempBind(texture);\r\n for (i = 0; i < 6; ++i) {\r\n setMipMap(faces[i], GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 + i);\r\n }\r\n setTexInfo(texInfo, GL_TEXTURE_CUBE_MAP$1);\r\n tempRestore();\r\n\r\n if (config.profile) {\r\n texture.stats.size = getTextureSize(\r\n texture.internalformat,\r\n texture.type,\r\n reglTextureCube.width,\r\n reglTextureCube.height,\r\n texInfo.genMipmaps,\r\n true);\r\n }\r\n\r\n reglTextureCube.format = textureFormatsInvert[texture.internalformat];\r\n reglTextureCube.type = textureTypesInvert[texture.type];\r\n\r\n reglTextureCube.mag = magFiltersInvert[texInfo.magFilter];\r\n reglTextureCube.min = minFiltersInvert[texInfo.minFilter];\r\n\r\n reglTextureCube.wrapS = wrapModesInvert[texInfo.wrapS];\r\n reglTextureCube.wrapT = wrapModesInvert[texInfo.wrapT];\r\n\r\n for (i = 0; i < 6; ++i) {\r\n freeMipMap(faces[i]);\r\n }\r\n\r\n return reglTextureCube\r\n }\r\n\r\n function subimage (face, image, x_, y_, level_) {\r\n check$1(!!image, 'must specify image data');\r\n check$1(typeof face === 'number' && face === (face | 0) &&\r\n face >= 0 && face < 6, 'invalid face');\r\n\r\n var x = x_ | 0;\r\n var y = y_ | 0;\r\n var level = level_ | 0;\r\n\r\n var imageData = allocImage();\r\n copyFlags(imageData, texture);\r\n imageData.width = 0;\r\n imageData.height = 0;\r\n parseImage(imageData, image);\r\n imageData.width = imageData.width || ((texture.width >> level) - x);\r\n imageData.height = imageData.height || ((texture.height >> level) - y);\r\n\r\n check$1(\r\n texture.type === imageData.type &&\r\n texture.format === imageData.format &&\r\n texture.internalformat === imageData.internalformat,\r\n 'incompatible format for texture.subimage');\r\n check$1(\r\n x >= 0 && y >= 0 &&\r\n x + imageData.width <= texture.width &&\r\n y + imageData.height <= texture.height,\r\n 'texture.subimage write out of bounds');\r\n check$1(\r\n texture.mipmask & (1 << level),\r\n 'missing mipmap data');\r\n check$1(\r\n imageData.data || imageData.element || imageData.needsCopy,\r\n 'missing image data');\r\n\r\n tempBind(texture);\r\n setSubImage(imageData, GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 + face, x, y, level);\r\n tempRestore();\r\n\r\n freeImage(imageData);\r\n\r\n return reglTextureCube\r\n }\r\n\r\n function resize (radius_) {\r\n var radius = radius_ | 0;\r\n if (radius === texture.width) {\r\n return\r\n }\r\n\r\n reglTextureCube.width = texture.width = radius;\r\n reglTextureCube.height = texture.height = radius;\r\n\r\n tempBind(texture);\r\n for (var i = 0; i < 6; ++i) {\r\n for (var j = 0; texture.mipmask >> j; ++j) {\r\n gl.texImage2D(\r\n GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 + i,\r\n j,\r\n texture.format,\r\n radius >> j,\r\n radius >> j,\r\n 0,\r\n texture.format,\r\n texture.type,\r\n null);\r\n }\r\n }\r\n tempRestore();\r\n\r\n if (config.profile) {\r\n texture.stats.size = getTextureSize(\r\n texture.internalformat,\r\n texture.type,\r\n reglTextureCube.width,\r\n reglTextureCube.height,\r\n false,\r\n true);\r\n }\r\n\r\n return reglTextureCube\r\n }\r\n\r\n reglTextureCube(a0, a1, a2, a3, a4, a5);\r\n\r\n reglTextureCube.subimage = subimage;\r\n reglTextureCube.resize = resize;\r\n reglTextureCube._reglType = 'textureCube';\r\n reglTextureCube._texture = texture;\r\n if (config.profile) {\r\n reglTextureCube.stats = texture.stats;\r\n }\r\n reglTextureCube.destroy = function () {\r\n texture.decRef();\r\n };\r\n\r\n return reglTextureCube\r\n }\r\n\r\n // Called when regl is destroyed\r\n function destroyTextures () {\r\n for (var i = 0; i < numTexUnits; ++i) {\r\n gl.activeTexture(GL_TEXTURE0$1 + i);\r\n gl.bindTexture(GL_TEXTURE_2D$1, null);\r\n textureUnits[i] = null;\r\n }\r\n values(textureSet).forEach(destroy);\r\n\r\n stats.cubeCount = 0;\r\n stats.textureCount = 0;\r\n }\r\n\r\n if (config.profile) {\r\n stats.getTotalTextureSize = function () {\r\n var total = 0;\r\n Object.keys(textureSet).forEach(function (key) {\r\n total += textureSet[key].stats.size;\r\n });\r\n return total\r\n };\r\n }\r\n\r\n function restoreTextures () {\r\n for (var i = 0; i < numTexUnits; ++i) {\r\n var tex = textureUnits[i];\r\n if (tex) {\r\n tex.bindCount = 0;\r\n tex.unit = -1;\r\n textureUnits[i] = null;\r\n }\r\n }\r\n\r\n values(textureSet).forEach(function (texture) {\r\n texture.texture = gl.createTexture();\r\n gl.bindTexture(texture.target, texture.texture);\r\n for (var i = 0; i < 32; ++i) {\r\n if ((texture.mipmask & (1 << i)) === 0) {\r\n continue\r\n }\r\n if (texture.target === GL_TEXTURE_2D$1) {\r\n gl.texImage2D(GL_TEXTURE_2D$1,\r\n i,\r\n texture.internalformat,\r\n texture.width >> i,\r\n texture.height >> i,\r\n 0,\r\n texture.internalformat,\r\n texture.type,\r\n null);\r\n } else {\r\n for (var j = 0; j < 6; ++j) {\r\n gl.texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 + j,\r\n i,\r\n texture.internalformat,\r\n texture.width >> i,\r\n texture.height >> i,\r\n 0,\r\n texture.internalformat,\r\n texture.type,\r\n null);\r\n }\r\n }\r\n }\r\n setTexInfo(texture.texInfo, texture.target);\r\n });\r\n }\r\n\r\n return {\r\n create2D: createTexture2D,\r\n createCube: createTextureCube,\r\n clear: destroyTextures,\r\n getTexture: function (wrapper) {\r\n return null\r\n },\r\n restore: restoreTextures\r\n }\r\n}\n\nvar GL_RENDERBUFFER = 0x8D41;\r\n\r\nvar GL_RGBA4$1 = 0x8056;\r\nvar GL_RGB5_A1$1 = 0x8057;\r\nvar GL_RGB565$1 = 0x8D62;\r\nvar GL_DEPTH_COMPONENT16 = 0x81A5;\r\nvar GL_STENCIL_INDEX8 = 0x8D48;\r\nvar GL_DEPTH_STENCIL$1 = 0x84F9;\r\n\r\nvar GL_SRGB8_ALPHA8_EXT = 0x8C43;\r\n\r\nvar GL_RGBA32F_EXT = 0x8814;\r\n\r\nvar GL_RGBA16F_EXT = 0x881A;\r\nvar GL_RGB16F_EXT = 0x881B;\r\n\r\nvar FORMAT_SIZES = [];\r\n\r\nFORMAT_SIZES[GL_RGBA4$1] = 2;\r\nFORMAT_SIZES[GL_RGB5_A1$1] = 2;\r\nFORMAT_SIZES[GL_RGB565$1] = 2;\r\n\r\nFORMAT_SIZES[GL_DEPTH_COMPONENT16] = 2;\r\nFORMAT_SIZES[GL_STENCIL_INDEX8] = 1;\r\nFORMAT_SIZES[GL_DEPTH_STENCIL$1] = 4;\r\n\r\nFORMAT_SIZES[GL_SRGB8_ALPHA8_EXT] = 4;\r\nFORMAT_SIZES[GL_RGBA32F_EXT] = 16;\r\nFORMAT_SIZES[GL_RGBA16F_EXT] = 8;\r\nFORMAT_SIZES[GL_RGB16F_EXT] = 6;\r\n\r\nfunction getRenderbufferSize (format, width, height) {\r\n return FORMAT_SIZES[format] * width * height\r\n}\r\n\r\nvar wrapRenderbuffers = function (gl, extensions, limits, stats, config) {\r\n var formatTypes = {\r\n 'rgba4': GL_RGBA4$1,\r\n 'rgb565': GL_RGB565$1,\r\n 'rgb5 a1': GL_RGB5_A1$1,\r\n 'depth': GL_DEPTH_COMPONENT16,\r\n 'stencil': GL_STENCIL_INDEX8,\r\n 'depth stencil': GL_DEPTH_STENCIL$1\r\n };\r\n\r\n if (extensions.ext_srgb) {\r\n formatTypes['srgba'] = GL_SRGB8_ALPHA8_EXT;\r\n }\r\n\r\n if (extensions.ext_color_buffer_half_float) {\r\n formatTypes['rgba16f'] = GL_RGBA16F_EXT;\r\n formatTypes['rgb16f'] = GL_RGB16F_EXT;\r\n }\r\n\r\n if (extensions.webgl_color_buffer_float) {\r\n formatTypes['rgba32f'] = GL_RGBA32F_EXT;\r\n }\r\n\r\n var formatTypesInvert = [];\r\n Object.keys(formatTypes).forEach(function (key) {\r\n var val = formatTypes[key];\r\n formatTypesInvert[val] = key;\r\n });\r\n\r\n var renderbufferCount = 0;\r\n var renderbufferSet = {};\r\n\r\n function REGLRenderbuffer (renderbuffer) {\r\n this.id = renderbufferCount++;\r\n this.refCount = 1;\r\n\r\n this.renderbuffer = renderbuffer;\r\n\r\n this.format = GL_RGBA4$1;\r\n this.width = 0;\r\n this.height = 0;\r\n\r\n if (config.profile) {\r\n this.stats = {size: 0};\r\n }\r\n }\r\n\r\n REGLRenderbuffer.prototype.decRef = function () {\r\n if (--this.refCount <= 0) {\r\n destroy(this);\r\n }\r\n };\r\n\r\n function destroy (rb) {\r\n var handle = rb.renderbuffer;\r\n check$1(handle, 'must not double destroy renderbuffer');\r\n gl.bindRenderbuffer(GL_RENDERBUFFER, null);\r\n gl.deleteRenderbuffer(handle);\r\n rb.renderbuffer = null;\r\n rb.refCount = 0;\r\n delete renderbufferSet[rb.id];\r\n stats.renderbufferCount--;\r\n }\r\n\r\n function createRenderbuffer (a, b) {\r\n var renderbuffer = new REGLRenderbuffer(gl.createRenderbuffer());\r\n renderbufferSet[renderbuffer.id] = renderbuffer;\r\n stats.renderbufferCount++;\r\n\r\n function reglRenderbuffer (a, b) {\r\n var w = 0;\r\n var h = 0;\r\n var format = GL_RGBA4$1;\r\n\r\n if (typeof a === 'object' && a) {\r\n var options = a;\r\n if ('shape' in options) {\r\n var shape = options.shape;\r\n check$1(Array.isArray(shape) && shape.length >= 2,\r\n 'invalid renderbuffer shape');\r\n w = shape[0] | 0;\r\n h = shape[1] | 0;\r\n } else {\r\n if ('radius' in options) {\r\n w = h = options.radius | 0;\r\n }\r\n if ('width' in options) {\r\n w = options.width | 0;\r\n }\r\n if ('height' in options) {\r\n h = options.height | 0;\r\n }\r\n }\r\n if ('format' in options) {\r\n check$1.parameter(options.format, formatTypes,\r\n 'invalid renderbuffer format');\r\n format = formatTypes[options.format];\r\n }\r\n } else if (typeof a === 'number') {\r\n w = a | 0;\r\n if (typeof b === 'number') {\r\n h = b | 0;\r\n } else {\r\n h = w;\r\n }\r\n } else if (!a) {\r\n w = h = 1;\r\n } else {\r\n check$1.raise('invalid arguments to renderbuffer constructor');\r\n }\r\n\r\n // check shape\r\n check$1(\r\n w > 0 && h > 0 &&\r\n w <= limits.maxRenderbufferSize && h <= limits.maxRenderbufferSize,\r\n 'invalid renderbuffer size');\r\n\r\n if (w === renderbuffer.width &&\r\n h === renderbuffer.height &&\r\n format === renderbuffer.format) {\r\n return\r\n }\r\n\r\n reglRenderbuffer.width = renderbuffer.width = w;\r\n reglRenderbuffer.height = renderbuffer.height = h;\r\n renderbuffer.format = format;\r\n\r\n gl.bindRenderbuffer(GL_RENDERBUFFER, renderbuffer.renderbuffer);\r\n gl.renderbufferStorage(GL_RENDERBUFFER, format, w, h);\r\n\r\n check$1(\r\n gl.getError() === 0,\r\n 'invalid render buffer format');\r\n\r\n if (config.profile) {\r\n renderbuffer.stats.size = getRenderbufferSize(renderbuffer.format, renderbuffer.width, renderbuffer.height);\r\n }\r\n reglRenderbuffer.format = formatTypesInvert[renderbuffer.format];\r\n\r\n return reglRenderbuffer\r\n }\r\n\r\n function resize (w_, h_) {\r\n var w = w_ | 0;\r\n var h = (h_ | 0) || w;\r\n\r\n if (w === renderbuffer.width && h === renderbuffer.height) {\r\n return reglRenderbuffer\r\n }\r\n\r\n // check shape\r\n check$1(\r\n w > 0 && h > 0 &&\r\n w <= limits.maxRenderbufferSize && h <= limits.maxRenderbufferSize,\r\n 'invalid renderbuffer size');\r\n\r\n reglRenderbuffer.width = renderbuffer.width = w;\r\n reglRenderbuffer.height = renderbuffer.height = h;\r\n\r\n gl.bindRenderbuffer(GL_RENDERBUFFER, renderbuffer.renderbuffer);\r\n gl.renderbufferStorage(GL_RENDERBUFFER, renderbuffer.format, w, h);\r\n\r\n check$1(\r\n gl.getError() === 0,\r\n 'invalid render buffer format');\r\n\r\n // also, recompute size.\r\n if (config.profile) {\r\n renderbuffer.stats.size = getRenderbufferSize(\r\n renderbuffer.format, renderbuffer.width, renderbuffer.height);\r\n }\r\n\r\n return reglRenderbuffer\r\n }\r\n\r\n reglRenderbuffer(a, b);\r\n\r\n reglRenderbuffer.resize = resize;\r\n reglRenderbuffer._reglType = 'renderbuffer';\r\n reglRenderbuffer._renderbuffer = renderbuffer;\r\n if (config.profile) {\r\n reglRenderbuffer.stats = renderbuffer.stats;\r\n }\r\n reglRenderbuffer.destroy = function () {\r\n renderbuffer.decRef();\r\n };\r\n\r\n return reglRenderbuffer\r\n }\r\n\r\n if (config.profile) {\r\n stats.getTotalRenderbufferSize = function () {\r\n var total = 0;\r\n Object.keys(renderbufferSet).forEach(function (key) {\r\n total += renderbufferSet[key].stats.size;\r\n });\r\n return total\r\n };\r\n }\r\n\r\n function restoreRenderbuffers () {\r\n values(renderbufferSet).forEach(function (rb) {\r\n rb.renderbuffer = gl.createRenderbuffer();\r\n gl.bindRenderbuffer(GL_RENDERBUFFER, rb.renderbuffer);\r\n gl.renderbufferStorage(GL_RENDERBUFFER, rb.format, rb.width, rb.height);\r\n });\r\n gl.bindRenderbuffer(GL_RENDERBUFFER, null);\r\n }\r\n\r\n return {\r\n create: createRenderbuffer,\r\n clear: function () {\r\n values(renderbufferSet).forEach(destroy);\r\n },\r\n restore: restoreRenderbuffers\r\n }\r\n};\n\n// We store these constants so that the minifier can inline them\r\nvar GL_FRAMEBUFFER$1 = 0x8D40;\r\nvar GL_RENDERBUFFER$1 = 0x8D41;\r\n\r\nvar GL_TEXTURE_2D$2 = 0x0DE1;\r\nvar GL_TEXTURE_CUBE_MAP_POSITIVE_X$2 = 0x8515;\r\n\r\nvar GL_COLOR_ATTACHMENT0$1 = 0x8CE0;\r\nvar GL_DEPTH_ATTACHMENT = 0x8D00;\r\nvar GL_STENCIL_ATTACHMENT = 0x8D20;\r\nvar GL_DEPTH_STENCIL_ATTACHMENT = 0x821A;\r\n\r\nvar GL_FRAMEBUFFER_COMPLETE$1 = 0x8CD5;\r\nvar GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;\r\nvar GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;\r\nvar GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;\r\nvar GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD;\r\n\r\nvar GL_HALF_FLOAT_OES$2 = 0x8D61;\r\nvar GL_UNSIGNED_BYTE$6 = 0x1401;\r\nvar GL_FLOAT$5 = 0x1406;\r\n\r\nvar GL_RGB$1 = 0x1907;\r\nvar GL_RGBA$2 = 0x1908;\r\n\r\nvar GL_DEPTH_COMPONENT$1 = 0x1902;\r\n\r\nvar colorTextureFormatEnums = [\r\n GL_RGB$1,\r\n GL_RGBA$2\r\n];\r\n\r\n// for every texture format, store\r\n// the number of channels\r\nvar textureFormatChannels = [];\r\ntextureFormatChannels[GL_RGBA$2] = 4;\r\ntextureFormatChannels[GL_RGB$1] = 3;\r\n\r\n// for every texture type, store\r\n// the size in bytes.\r\nvar textureTypeSizes = [];\r\ntextureTypeSizes[GL_UNSIGNED_BYTE$6] = 1;\r\ntextureTypeSizes[GL_FLOAT$5] = 4;\r\ntextureTypeSizes[GL_HALF_FLOAT_OES$2] = 2;\r\n\r\nvar GL_RGBA4$2 = 0x8056;\r\nvar GL_RGB5_A1$2 = 0x8057;\r\nvar GL_RGB565$2 = 0x8D62;\r\nvar GL_DEPTH_COMPONENT16$1 = 0x81A5;\r\nvar GL_STENCIL_INDEX8$1 = 0x8D48;\r\nvar GL_DEPTH_STENCIL$2 = 0x84F9;\r\n\r\nvar GL_SRGB8_ALPHA8_EXT$1 = 0x8C43;\r\n\r\nvar GL_RGBA32F_EXT$1 = 0x8814;\r\n\r\nvar GL_RGBA16F_EXT$1 = 0x881A;\r\nvar GL_RGB16F_EXT$1 = 0x881B;\r\n\r\nvar colorRenderbufferFormatEnums = [\r\n GL_RGBA4$2,\r\n GL_RGB5_A1$2,\r\n GL_RGB565$2,\r\n GL_SRGB8_ALPHA8_EXT$1,\r\n GL_RGBA16F_EXT$1,\r\n GL_RGB16F_EXT$1,\r\n GL_RGBA32F_EXT$1\r\n];\r\n\r\nvar statusCode = {};\r\nstatusCode[GL_FRAMEBUFFER_COMPLETE$1] = 'complete';\r\nstatusCode[GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT] = 'incomplete attachment';\r\nstatusCode[GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS] = 'incomplete dimensions';\r\nstatusCode[GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT] = 'incomplete, missing attachment';\r\nstatusCode[GL_FRAMEBUFFER_UNSUPPORTED] = 'unsupported';\r\n\r\nfunction wrapFBOState (\r\n gl,\r\n extensions,\r\n limits,\r\n textureState,\r\n renderbufferState,\r\n stats) {\r\n var framebufferState = {\r\n cur: null,\r\n next: null,\r\n dirty: false,\r\n setFBO: null\r\n };\r\n\r\n var colorTextureFormats = ['rgba'];\r\n var colorRenderbufferFormats = ['rgba4', 'rgb565', 'rgb5 a1'];\r\n\r\n if (extensions.ext_srgb) {\r\n colorRenderbufferFormats.push('srgba');\r\n }\r\n\r\n if (extensions.ext_color_buffer_half_float) {\r\n colorRenderbufferFormats.push('rgba16f', 'rgb16f');\r\n }\r\n\r\n if (extensions.webgl_color_buffer_float) {\r\n colorRenderbufferFormats.push('rgba32f');\r\n }\r\n\r\n var colorTypes = ['uint8'];\r\n if (extensions.oes_texture_half_float) {\r\n colorTypes.push('half float', 'float16');\r\n }\r\n if (extensions.oes_texture_float) {\r\n colorTypes.push('float', 'float32');\r\n }\r\n\r\n function FramebufferAttachment (target, texture, renderbuffer) {\r\n this.target = target;\r\n this.texture = texture;\r\n this.renderbuffer = renderbuffer;\r\n\r\n var w = 0;\r\n var h = 0;\r\n if (texture) {\r\n w = texture.width;\r\n h = texture.height;\r\n } else if (renderbuffer) {\r\n w = renderbuffer.width;\r\n h = renderbuffer.height;\r\n }\r\n this.width = w;\r\n this.height = h;\r\n }\r\n\r\n function decRef (attachment) {\r\n if (attachment) {\r\n if (attachment.texture) {\r\n attachment.texture._texture.decRef();\r\n }\r\n if (attachment.renderbuffer) {\r\n attachment.renderbuffer._renderbuffer.decRef();\r\n }\r\n }\r\n }\r\n\r\n function incRefAndCheckShape (attachment, width, height) {\r\n if (!attachment) {\r\n return\r\n }\r\n if (attachment.texture) {\r\n var texture = attachment.texture._texture;\r\n var tw = Math.max(1, texture.width);\r\n var th = Math.max(1, texture.height);\r\n check$1(tw === width && th === height,\r\n 'inconsistent width/height for supplied texture');\r\n texture.refCount += 1;\r\n } else {\r\n var renderbuffer = attachment.renderbuffer._renderbuffer;\r\n check$1(\r\n renderbuffer.width === width && renderbuffer.height === height,\r\n 'inconsistent width/height for renderbuffer');\r\n renderbuffer.refCount += 1;\r\n }\r\n }\r\n\r\n function attach (location, attachment) {\r\n if (attachment) {\r\n if (attachment.texture) {\r\n gl.framebufferTexture2D(\r\n GL_FRAMEBUFFER$1,\r\n location,\r\n attachment.target,\r\n attachment.texture._texture.texture,\r\n 0);\r\n } else {\r\n gl.framebufferRenderbuffer(\r\n GL_FRAMEBUFFER$1,\r\n location,\r\n GL_RENDERBUFFER$1,\r\n attachment.renderbuffer._renderbuffer.renderbuffer);\r\n }\r\n }\r\n }\r\n\r\n function parseAttachment (attachment) {\r\n var target = GL_TEXTURE_2D$2;\r\n var texture = null;\r\n var renderbuffer = null;\r\n\r\n var data = attachment;\r\n if (typeof attachment === 'object') {\r\n data = attachment.data;\r\n if ('target' in attachment) {\r\n target = attachment.target | 0;\r\n }\r\n }\r\n\r\n check$1.type(data, 'function', 'invalid attachment data');\r\n\r\n var type = data._reglType;\r\n if (type === 'texture2d') {\r\n texture = data;\r\n check$1(target === GL_TEXTURE_2D$2);\r\n } else if (type === 'textureCube') {\r\n texture = data;\r\n check$1(\r\n target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X$2 &&\r\n target < GL_TEXTURE_CUBE_MAP_POSITIVE_X$2 + 6,\r\n 'invalid cube map target');\r\n } else if (type === 'renderbuffer') {\r\n renderbuffer = data;\r\n target = GL_RENDERBUFFER$1;\r\n } else {\r\n check$1.raise('invalid regl object for attachment');\r\n }\r\n\r\n return new FramebufferAttachment(target, texture, renderbuffer)\r\n }\r\n\r\n function allocAttachment (\r\n width,\r\n height,\r\n isTexture,\r\n format,\r\n type) {\r\n if (isTexture) {\r\n var texture = textureState.create2D({\r\n width: width,\r\n height: height,\r\n format: format,\r\n type: type\r\n });\r\n texture._texture.refCount = 0;\r\n return new FramebufferAttachment(GL_TEXTURE_2D$2, texture, null)\r\n } else {\r\n var rb = renderbufferState.create({\r\n width: width,\r\n height: height,\r\n format: format\r\n });\r\n rb._renderbuffer.refCount = 0;\r\n return new FramebufferAttachment(GL_RENDERBUFFER$1, null, rb)\r\n }\r\n }\r\n\r\n function unwrapAttachment (attachment) {\r\n return attachment && (attachment.texture || attachment.renderbuffer)\r\n }\r\n\r\n function resizeAttachment (attachment, w, h) {\r\n if (attachment) {\r\n if (attachment.texture) {\r\n attachment.texture.resize(w, h);\r\n } else if (attachment.renderbuffer) {\r\n attachment.renderbuffer.resize(w, h);\r\n }\r\n attachment.width = w;\r\n attachment.height = h;\r\n }\r\n }\r\n\r\n var framebufferCount = 0;\r\n var framebufferSet = {};\r\n\r\n function REGLFramebuffer () {\r\n this.id = framebufferCount++;\r\n framebufferSet[this.id] = this;\r\n\r\n this.framebuffer = gl.createFramebuffer();\r\n this.width = 0;\r\n this.height = 0;\r\n\r\n this.colorAttachments = [];\r\n this.depthAttachment = null;\r\n this.stencilAttachment = null;\r\n this.depthStencilAttachment = null;\r\n }\r\n\r\n function decFBORefs (framebuffer) {\r\n framebuffer.colorAttachments.forEach(decRef);\r\n decRef(framebuffer.depthAttachment);\r\n decRef(framebuffer.stencilAttachment);\r\n decRef(framebuffer.depthStencilAttachment);\r\n }\r\n\r\n function destroy (framebuffer) {\r\n var handle = framebuffer.framebuffer;\r\n check$1(handle, 'must not double destroy framebuffer');\r\n gl.deleteFramebuffer(handle);\r\n framebuffer.framebuffer = null;\r\n stats.framebufferCount--;\r\n delete framebufferSet[framebuffer.id];\r\n }\r\n\r\n function updateFramebuffer (framebuffer) {\r\n var i;\r\n\r\n gl.bindFramebuffer(GL_FRAMEBUFFER$1, framebuffer.framebuffer);\r\n var colorAttachments = framebuffer.colorAttachments;\r\n for (i = 0; i < colorAttachments.length; ++i) {\r\n attach(GL_COLOR_ATTACHMENT0$1 + i, colorAttachments[i]);\r\n }\r\n for (i = colorAttachments.length; i < limits.maxColorAttachments; ++i) {\r\n gl.framebufferTexture2D(\r\n GL_FRAMEBUFFER$1,\r\n GL_COLOR_ATTACHMENT0$1 + i,\r\n GL_TEXTURE_2D$2,\r\n null,\r\n 0);\r\n }\r\n\r\n gl.framebufferTexture2D(\r\n GL_FRAMEBUFFER$1,\r\n GL_DEPTH_STENCIL_ATTACHMENT,\r\n GL_TEXTURE_2D$2,\r\n null,\r\n 0);\r\n gl.framebufferTexture2D(\r\n GL_FRAMEBUFFER$1,\r\n GL_DEPTH_ATTACHMENT,\r\n GL_TEXTURE_2D$2,\r\n null,\r\n 0);\r\n gl.framebufferTexture2D(\r\n GL_FRAMEBUFFER$1,\r\n GL_STENCIL_ATTACHMENT,\r\n GL_TEXTURE_2D$2,\r\n null,\r\n 0);\r\n\r\n attach(GL_DEPTH_ATTACHMENT, framebuffer.depthAttachment);\r\n attach(GL_STENCIL_ATTACHMENT, framebuffer.stencilAttachment);\r\n attach(GL_DEPTH_STENCIL_ATTACHMENT, framebuffer.depthStencilAttachment);\r\n\r\n // Check status code\r\n var status = gl.checkFramebufferStatus(GL_FRAMEBUFFER$1);\r\n if (!gl.isContextLost() && status !== GL_FRAMEBUFFER_COMPLETE$1) {\r\n check$1.raise('framebuffer configuration not supported, status = ' +\r\n statusCode[status]);\r\n }\r\n\r\n gl.bindFramebuffer(GL_FRAMEBUFFER$1, framebufferState.next ? framebufferState.next.framebuffer : null);\r\n framebufferState.cur = framebufferState.next;\r\n\r\n // FIXME: Clear error code here. This is a work around for a bug in\r\n // headless-gl\r\n gl.getError();\r\n }\r\n\r\n function createFBO (a0, a1) {\r\n var framebuffer = new REGLFramebuffer();\r\n stats.framebufferCount++;\r\n\r\n function reglFramebuffer (a, b) {\r\n var i;\r\n\r\n check$1(framebufferState.next !== framebuffer,\r\n 'can not update framebuffer which is currently in use');\r\n\r\n var width = 0;\r\n var height = 0;\r\n\r\n var needsDepth = true;\r\n var needsStencil = true;\r\n\r\n var colorBuffer = null;\r\n var colorTexture = true;\r\n var colorFormat = 'rgba';\r\n var colorType = 'uint8';\r\n var colorCount = 1;\r\n\r\n var depthBuffer = null;\r\n var stencilBuffer = null;\r\n var depthStencilBuffer = null;\r\n var depthStencilTexture = false;\r\n\r\n if (typeof a === 'number') {\r\n width = a | 0;\r\n height = (b | 0) || width;\r\n } else if (!a) {\r\n width = height = 1;\r\n } else {\r\n check$1.type(a, 'object', 'invalid arguments for framebuffer');\r\n var options = a;\r\n\r\n if ('shape' in options) {\r\n var shape = options.shape;\r\n check$1(Array.isArray(shape) && shape.length >= 2,\r\n 'invalid shape for framebuffer');\r\n width = shape[0];\r\n height = shape[1];\r\n } else {\r\n if ('radius' in options) {\r\n width = height = options.radius;\r\n }\r\n if ('width' in options) {\r\n width = options.width;\r\n }\r\n if ('height' in options) {\r\n height = options.height;\r\n }\r\n }\r\n\r\n if ('color' in options ||\r\n 'colors' in options) {\r\n colorBuffer =\r\n options.color ||\r\n options.colors;\r\n if (Array.isArray(colorBuffer)) {\r\n check$1(\r\n colorBuffer.length === 1 || extensions.webgl_draw_buffers,\r\n 'multiple render targets not supported');\r\n }\r\n }\r\n\r\n if (!colorBuffer) {\r\n if ('colorCount' in options) {\r\n colorCount = options.colorCount | 0;\r\n check$1(colorCount > 0, 'invalid color buffer count');\r\n }\r\n\r\n if ('colorTexture' in options) {\r\n colorTexture = !!options.colorTexture;\r\n colorFormat = 'rgba4';\r\n }\r\n\r\n if ('colorType' in options) {\r\n colorType = options.colorType;\r\n if (!colorTexture) {\r\n if (colorType === 'half float' || colorType === 'float16') {\r\n check$1(extensions.ext_color_buffer_half_float,\r\n 'you must enable EXT_color_buffer_half_float to use 16-bit render buffers');\r\n colorFormat = 'rgba16f';\r\n } else if (colorType === 'float' || colorType === 'float32') {\r\n check$1(extensions.webgl_color_buffer_float,\r\n 'you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers');\r\n colorFormat = 'rgba32f';\r\n }\r\n } else {\r\n check$1(extensions.oes_texture_float ||\r\n !(colorType === 'float' || colorType === 'float32'),\r\n 'you must enable OES_texture_float in order to use floating point framebuffer objects');\r\n check$1(extensions.oes_texture_half_float ||\r\n !(colorType === 'half float' || colorType === 'float16'),\r\n 'you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects');\r\n }\r\n check$1.oneOf(colorType, colorTypes, 'invalid color type');\r\n }\r\n\r\n if ('colorFormat' in options) {\r\n colorFormat = options.colorFormat;\r\n if (colorTextureFormats.indexOf(colorFormat) >= 0) {\r\n colorTexture = true;\r\n } else if (colorRenderbufferFormats.indexOf(colorFormat) >= 0) {\r\n colorTexture = false;\r\n } else {\r\n if (colorTexture) {\r\n check$1.oneOf(\r\n options.colorFormat, colorTextureFormats,\r\n 'invalid color format for texture');\r\n } else {\r\n check$1.oneOf(\r\n options.colorFormat, colorRenderbufferFormats,\r\n 'invalid color format for renderbuffer');\r\n }\r\n }\r\n }\r\n }\r\n\r\n if ('depthTexture' in options || 'depthStencilTexture' in options) {\r\n depthStencilTexture = !!(options.depthTexture ||\r\n options.depthStencilTexture);\r\n check$1(!depthStencilTexture || extensions.webgl_depth_texture,\r\n 'webgl_depth_texture extension not supported');\r\n }\r\n\r\n if ('depth' in options) {\r\n if (typeof options.depth === 'boolean') {\r\n needsDepth = options.depth;\r\n } else {\r\n depthBuffer = options.depth;\r\n needsStencil = false;\r\n }\r\n }\r\n\r\n if ('stencil' in options) {\r\n if (typeof options.stencil === 'boolean') {\r\n needsStencil = options.stencil;\r\n } else {\r\n stencilBuffer = options.stencil;\r\n needsDepth = false;\r\n }\r\n }\r\n\r\n if ('depthStencil' in options) {\r\n if (typeof options.depthStencil === 'boolean') {\r\n needsDepth = needsStencil = options.depthStencil;\r\n } else {\r\n depthStencilBuffer = options.depthStencil;\r\n needsDepth = false;\r\n needsStencil = false;\r\n }\r\n }\r\n }\r\n\r\n // parse attachments\r\n var colorAttachments = null;\r\n var depthAttachment = null;\r\n var stencilAttachment = null;\r\n var depthStencilAttachment = null;\r\n\r\n // Set up color attachments\r\n if (Array.isArray(colorBuffer)) {\r\n colorAttachments = colorBuffer.map(parseAttachment);\r\n } else if (colorBuffer) {\r\n colorAttachments = [parseAttachment(colorBuffer)];\r\n } else {\r\n colorAttachments = new Array(colorCount);\r\n for (i = 0; i < colorCount; ++i) {\r\n colorAttachments[i] = allocAttachment(\r\n width,\r\n height,\r\n colorTexture,\r\n colorFormat,\r\n colorType);\r\n }\r\n }\r\n\r\n check$1(extensions.webgl_draw_buffers || colorAttachments.length <= 1,\r\n 'you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers.');\r\n check$1(colorAttachments.length <= limits.maxColorAttachments,\r\n 'too many color attachments, not supported');\r\n\r\n width = width || colorAttachments[0].width;\r\n height = height || colorAttachments[0].height;\r\n\r\n if (depthBuffer) {\r\n depthAttachment = parseAttachment(depthBuffer);\r\n } else if (needsDepth && !needsStencil) {\r\n depthAttachment = allocAttachment(\r\n width,\r\n height,\r\n depthStencilTexture,\r\n 'depth',\r\n 'uint32');\r\n }\r\n\r\n if (stencilBuffer) {\r\n stencilAttachment = parseAttachment(stencilBuffer);\r\n } else if (needsStencil && !needsDepth) {\r\n stencilAttachment = allocAttachment(\r\n width,\r\n height,\r\n false,\r\n 'stencil',\r\n 'uint8');\r\n }\r\n\r\n if (depthStencilBuffer) {\r\n depthStencilAttachment = parseAttachment(depthStencilBuffer);\r\n } else if (!depthBuffer && !stencilBuffer && needsStencil && needsDepth) {\r\n depthStencilAttachment = allocAttachment(\r\n width,\r\n height,\r\n depthStencilTexture,\r\n 'depth stencil',\r\n 'depth stencil');\r\n }\r\n\r\n check$1(\r\n (!!depthBuffer) + (!!stencilBuffer) + (!!depthStencilBuffer) <= 1,\r\n 'invalid framebuffer configuration, can specify exactly one depth/stencil attachment');\r\n\r\n var commonColorAttachmentSize = null;\r\n\r\n for (i = 0; i < colorAttachments.length; ++i) {\r\n incRefAndCheckShape(colorAttachments[i], width, height);\r\n check$1(!colorAttachments[i] ||\r\n (colorAttachments[i].texture &&\r\n colorTextureFormatEnums.indexOf(colorAttachments[i].texture._texture.format) >= 0) ||\r\n (colorAttachments[i].renderbuffer &&\r\n colorRenderbufferFormatEnums.indexOf(colorAttachments[i].renderbuffer._renderbuffer.format) >= 0),\r\n 'framebuffer color attachment ' + i + ' is invalid');\r\n\r\n if (colorAttachments[i] && colorAttachments[i].texture) {\r\n var colorAttachmentSize =\r\n textureFormatChannels[colorAttachments[i].texture._texture.format] *\r\n textureTypeSizes[colorAttachments[i].texture._texture.type];\r\n\r\n if (commonColorAttachmentSize === null) {\r\n commonColorAttachmentSize = colorAttachmentSize;\r\n } else {\r\n // We need to make sure that all color attachments have the same number of bitplanes\r\n // (that is, the same numer of bits per pixel)\r\n // This is required by the GLES2.0 standard. See the beginning of Chapter 4 in that document.\r\n check$1(commonColorAttachmentSize === colorAttachmentSize,\r\n 'all color attachments much have the same number of bits per pixel.');\r\n }\r\n }\r\n }\r\n incRefAndCheckShape(depthAttachment, width, height);\r\n check$1(!depthAttachment ||\r\n (depthAttachment.texture &&\r\n depthAttachment.texture._texture.format === GL_DEPTH_COMPONENT$1) ||\r\n (depthAttachment.renderbuffer &&\r\n depthAttachment.renderbuffer._renderbuffer.format === GL_DEPTH_COMPONENT16$1),\r\n 'invalid depth attachment for framebuffer object');\r\n incRefAndCheckShape(stencilAttachment, width, height);\r\n check$1(!stencilAttachment ||\r\n (stencilAttachment.renderbuffer &&\r\n stencilAttachment.renderbuffer._renderbuffer.format === GL_STENCIL_INDEX8$1),\r\n 'invalid stencil attachment for framebuffer object');\r\n incRefAndCheckShape(depthStencilAttachment, width, height);\r\n check$1(!depthStencilAttachment ||\r\n (depthStencilAttachment.texture &&\r\n depthStencilAttachment.texture._texture.format === GL_DEPTH_STENCIL$2) ||\r\n (depthStencilAttachment.renderbuffer &&\r\n depthStencilAttachment.renderbuffer._renderbuffer.format === GL_DEPTH_STENCIL$2),\r\n 'invalid depth-stencil attachment for framebuffer object');\r\n\r\n // decrement references\r\n decFBORefs(framebuffer);\r\n\r\n framebuffer.width = width;\r\n framebuffer.height = height;\r\n\r\n framebuffer.colorAttachments = colorAttachments;\r\n framebuffer.depthAttachment = depthAttachment;\r\n framebuffer.stencilAttachment = stencilAttachment;\r\n framebuffer.depthStencilAttachment = depthStencilAttachment;\r\n\r\n reglFramebuffer.color = colorAttachments.map(unwrapAttachment);\r\n reglFramebuffer.depth = unwrapAttachment(depthAttachment);\r\n reglFramebuffer.stencil = unwrapAttachment(stencilAttachment);\r\n reglFramebuffer.depthStencil = unwrapAttachment(depthStencilAttachment);\r\n\r\n reglFramebuffer.width = framebuffer.width;\r\n reglFramebuffer.height = framebuffer.height;\r\n\r\n updateFramebuffer(framebuffer);\r\n\r\n return reglFramebuffer\r\n }\r\n\r\n function resize (w_, h_) {\r\n check$1(framebufferState.next !== framebuffer,\r\n 'can not resize a framebuffer which is currently in use');\r\n\r\n var w = Math.max(w_ | 0, 1);\r\n var h = Math.max((h_ | 0) || w, 1);\r\n if (w === framebuffer.width && h === framebuffer.height) {\r\n return reglFramebuffer\r\n }\r\n\r\n // resize all buffers\r\n var colorAttachments = framebuffer.colorAttachments;\r\n for (var i = 0; i < colorAttachments.length; ++i) {\r\n resizeAttachment(colorAttachments[i], w, h);\r\n }\r\n resizeAttachment(framebuffer.depthAttachment, w, h);\r\n resizeAttachment(framebuffer.stencilAttachment, w, h);\r\n resizeAttachment(framebuffer.depthStencilAttachment, w, h);\r\n\r\n framebuffer.width = reglFramebuffer.width = w;\r\n framebuffer.height = reglFramebuffer.height = h;\r\n\r\n updateFramebuffer(framebuffer);\r\n\r\n return reglFramebuffer\r\n }\r\n\r\n reglFramebuffer(a0, a1);\r\n\r\n return extend(reglFramebuffer, {\r\n resize: resize,\r\n _reglType: 'framebuffer',\r\n _framebuffer: framebuffer,\r\n destroy: function () {\r\n destroy(framebuffer);\r\n decFBORefs(framebuffer);\r\n },\r\n use: function (block) {\r\n framebufferState.setFBO({\r\n framebuffer: reglFramebuffer\r\n }, block);\r\n }\r\n })\r\n }\r\n\r\n function createCubeFBO (options) {\r\n var faces = Array(6);\r\n\r\n function reglFramebufferCube (a) {\r\n var i;\r\n\r\n check$1(faces.indexOf(framebufferState.next) < 0,\r\n 'can not update framebuffer which is currently in use');\r\n\r\n var params = {\r\n color: null\r\n };\r\n\r\n var radius = 0;\r\n\r\n var colorBuffer = null;\r\n var colorFormat = 'rgba';\r\n var colorType = 'uint8';\r\n var colorCount = 1;\r\n\r\n if (typeof a === 'number') {\r\n radius = a | 0;\r\n } else if (!a) {\r\n radius = 1;\r\n } else {\r\n check$1.type(a, 'object', 'invalid arguments for framebuffer');\r\n var options = a;\r\n\r\n if ('shape' in options) {\r\n var shape = options.shape;\r\n check$1(\r\n Array.isArray(shape) && shape.length >= 2,\r\n 'invalid shape for framebuffer');\r\n check$1(\r\n shape[0] === shape[1],\r\n 'cube framebuffer must be square');\r\n radius = shape[0];\r\n } else {\r\n if ('radius' in options) {\r\n radius = options.radius | 0;\r\n }\r\n if ('width' in options) {\r\n radius = options.width | 0;\r\n if ('height' in options) {\r\n check$1(options.height === radius, 'must be square');\r\n }\r\n } else if ('height' in options) {\r\n radius = options.height | 0;\r\n }\r\n }\r\n\r\n if ('color' in options ||\r\n 'colors' in options) {\r\n colorBuffer =\r\n options.color ||\r\n options.colors;\r\n if (Array.isArray(colorBuffer)) {\r\n check$1(\r\n colorBuffer.length === 1 || extensions.webgl_draw_buffers,\r\n 'multiple render targets not supported');\r\n }\r\n }\r\n\r\n if (!colorBuffer) {\r\n if ('colorCount' in options) {\r\n colorCount = options.colorCount | 0;\r\n check$1(colorCount > 0, 'invalid color buffer count');\r\n }\r\n\r\n if ('colorType' in options) {\r\n check$1.oneOf(\r\n options.colorType, colorTypes,\r\n 'invalid color type');\r\n colorType = options.colorType;\r\n }\r\n\r\n if ('colorFormat' in options) {\r\n colorFormat = options.colorFormat;\r\n check$1.oneOf(\r\n options.colorFormat, colorTextureFormats,\r\n 'invalid color format for texture');\r\n }\r\n }\r\n\r\n if ('depth' in options) {\r\n params.depth = options.depth;\r\n }\r\n\r\n if ('stencil' in options) {\r\n params.stencil = options.stencil;\r\n }\r\n\r\n if ('depthStencil' in options) {\r\n params.depthStencil = options.depthStencil;\r\n }\r\n }\r\n\r\n var colorCubes;\r\n if (colorBuffer) {\r\n if (Array.isArray(colorBuffer)) {\r\n colorCubes = [];\r\n for (i = 0; i < colorBuffer.length; ++i) {\r\n colorCubes[i] = colorBuffer[i];\r\n }\r\n } else {\r\n colorCubes = [ colorBuffer ];\r\n }\r\n } else {\r\n colorCubes = Array(colorCount);\r\n var cubeMapParams = {\r\n radius: radius,\r\n format: colorFormat,\r\n type: colorType\r\n };\r\n for (i = 0; i < colorCount; ++i) {\r\n colorCubes[i] = textureState.createCube(cubeMapParams);\r\n }\r\n }\r\n\r\n // Check color cubes\r\n params.color = Array(colorCubes.length);\r\n for (i = 0; i < colorCubes.length; ++i) {\r\n var cube = colorCubes[i];\r\n check$1(\r\n typeof cube === 'function' && cube._reglType === 'textureCube',\r\n 'invalid cube map');\r\n radius = radius || cube.width;\r\n check$1(\r\n cube.width === radius && cube.height === radius,\r\n 'invalid cube map shape');\r\n params.color[i] = {\r\n target: GL_TEXTURE_CUBE_MAP_POSITIVE_X$2,\r\n data: colorCubes[i]\r\n };\r\n }\r\n\r\n for (i = 0; i < 6; ++i) {\r\n for (var j = 0; j < colorCubes.length; ++j) {\r\n params.color[j].target = GL_TEXTURE_CUBE_MAP_POSITIVE_X$2 + i;\r\n }\r\n // reuse depth-stencil attachments across all cube maps\r\n if (i > 0) {\r\n params.depth = faces[0].depth;\r\n params.stencil = faces[0].stencil;\r\n params.depthStencil = faces[0].depthStencil;\r\n }\r\n if (faces[i]) {\r\n (faces[i])(params);\r\n } else {\r\n faces[i] = createFBO(params);\r\n }\r\n }\r\n\r\n return extend(reglFramebufferCube, {\r\n width: radius,\r\n height: radius,\r\n color: colorCubes\r\n })\r\n }\r\n\r\n function resize (radius_) {\r\n var i;\r\n var radius = radius_ | 0;\r\n check$1(radius > 0 && radius <= limits.maxCubeMapSize,\r\n 'invalid radius for cube fbo');\r\n\r\n if (radius === reglFramebufferCube.width) {\r\n return reglFramebufferCube\r\n }\r\n\r\n var colors = reglFramebufferCube.color;\r\n for (i = 0; i < colors.length; ++i) {\r\n colors[i].resize(radius);\r\n }\r\n\r\n for (i = 0; i < 6; ++i) {\r\n faces[i].resize(radius);\r\n }\r\n\r\n reglFramebufferCube.width = reglFramebufferCube.height = radius;\r\n\r\n return reglFramebufferCube\r\n }\r\n\r\n reglFramebufferCube(options);\r\n\r\n return extend(reglFramebufferCube, {\r\n faces: faces,\r\n resize: resize,\r\n _reglType: 'framebufferCube',\r\n destroy: function () {\r\n faces.forEach(function (f) {\r\n f.destroy();\r\n });\r\n }\r\n })\r\n }\r\n\r\n function restoreFramebuffers () {\r\n framebufferState.cur = null;\r\n framebufferState.next = null;\r\n framebufferState.dirty = true;\r\n values(framebufferSet).forEach(function (fb) {\r\n fb.framebuffer = gl.createFramebuffer();\r\n updateFramebuffer(fb);\r\n });\r\n }\r\n\r\n return extend(framebufferState, {\r\n getFramebuffer: function (object) {\r\n if (typeof object === 'function' && object._reglType === 'framebuffer') {\r\n var fbo = object._framebuffer;\r\n if (fbo instanceof REGLFramebuffer) {\r\n return fbo\r\n }\r\n }\r\n return null\r\n },\r\n create: createFBO,\r\n createCube: createCubeFBO,\r\n clear: function () {\r\n values(framebufferSet).forEach(destroy);\r\n },\r\n restore: restoreFramebuffers\r\n })\r\n}\n\nvar GL_FLOAT$6 = 5126;\r\n\r\nfunction AttributeRecord () {\r\n this.state = 0;\r\n\r\n this.x = 0.0;\r\n this.y = 0.0;\r\n this.z = 0.0;\r\n this.w = 0.0;\r\n\r\n this.buffer = null;\r\n this.size = 0;\r\n this.normalized = false;\r\n this.type = GL_FLOAT$6;\r\n this.offset = 0;\r\n this.stride = 0;\r\n this.divisor = 0;\r\n}\r\n\r\nfunction wrapAttributeState (\r\n gl,\r\n extensions,\r\n limits,\r\n stringStore) {\r\n var NUM_ATTRIBUTES = limits.maxAttributes;\r\n var attributeBindings = new Array(NUM_ATTRIBUTES);\r\n for (var i = 0; i < NUM_ATTRIBUTES; ++i) {\r\n attributeBindings[i] = new AttributeRecord();\r\n }\r\n\r\n return {\r\n Record: AttributeRecord,\r\n scope: {},\r\n state: attributeBindings\r\n }\r\n}\n\nvar GL_FRAGMENT_SHADER = 35632;\r\nvar GL_VERTEX_SHADER = 35633;\r\n\r\nvar GL_ACTIVE_UNIFORMS = 0x8B86;\r\nvar GL_ACTIVE_ATTRIBUTES = 0x8B89;\r\n\r\nfunction wrapShaderState (gl, stringStore, stats, config) {\r\n // ===================================================\r\n // glsl compilation and linking\r\n // ===================================================\r\n var fragShaders = {};\r\n var vertShaders = {};\r\n\r\n function ActiveInfo (name, id, location, info) {\r\n this.name = name;\r\n this.id = id;\r\n this.location = location;\r\n this.info = info;\r\n }\r\n\r\n function insertActiveInfo (list, info) {\r\n for (var i = 0; i < list.length; ++i) {\r\n if (list[i].id === info.id) {\r\n list[i].location = info.location;\r\n return\r\n }\r\n }\r\n list.push(info);\r\n }\r\n\r\n function getShader (type, id, command) {\r\n var cache = type === GL_FRAGMENT_SHADER ? fragShaders : vertShaders;\r\n var shader = cache[id];\r\n\r\n if (!shader) {\r\n var source = stringStore.str(id);\r\n shader = gl.createShader(type);\r\n gl.shaderSource(shader, source);\r\n gl.compileShader(shader);\r\n check$1.shaderError(gl, shader, source, type, command);\r\n cache[id] = shader;\r\n }\r\n\r\n return shader\r\n }\r\n\r\n // ===================================================\r\n // program linking\r\n // ===================================================\r\n var programCache = {};\r\n var programList = [];\r\n\r\n var PROGRAM_COUNTER = 0;\r\n\r\n function REGLProgram (fragId, vertId) {\r\n this.id = PROGRAM_COUNTER++;\r\n this.fragId = fragId;\r\n this.vertId = vertId;\r\n this.program = null;\r\n this.uniforms = [];\r\n this.attributes = [];\r\n\r\n if (config.profile) {\r\n this.stats = {\r\n uniformsCount: 0,\r\n attributesCount: 0\r\n };\r\n }\r\n }\r\n\r\n function linkProgram (desc, command) {\r\n var i, info;\r\n\r\n // -------------------------------\r\n // compile & link\r\n // -------------------------------\r\n var fragShader = getShader(GL_FRAGMENT_SHADER, desc.fragId);\r\n var vertShader = getShader(GL_VERTEX_SHADER, desc.vertId);\r\n\r\n var program = desc.program = gl.createProgram();\r\n gl.attachShader(program, fragShader);\r\n gl.attachShader(program, vertShader);\r\n gl.linkProgram(program);\r\n check$1.linkError(\r\n gl,\r\n program,\r\n stringStore.str(desc.fragId),\r\n stringStore.str(desc.vertId),\r\n command);\r\n\r\n // -------------------------------\r\n // grab uniforms\r\n // -------------------------------\r\n var numUniforms = gl.getProgramParameter(program, GL_ACTIVE_UNIFORMS);\r\n if (config.profile) {\r\n desc.stats.uniformsCount = numUniforms;\r\n }\r\n var uniforms = desc.uniforms;\r\n for (i = 0; i < numUniforms; ++i) {\r\n info = gl.getActiveUniform(program, i);\r\n if (info) {\r\n if (info.size > 1) {\r\n for (var j = 0; j < info.size; ++j) {\r\n var name = info.name.replace('[0]', '[' + j + ']');\r\n insertActiveInfo(uniforms, new ActiveInfo(\r\n name,\r\n stringStore.id(name),\r\n gl.getUniformLocation(program, name),\r\n info));\r\n }\r\n } else {\r\n insertActiveInfo(uniforms, new ActiveInfo(\r\n info.name,\r\n stringStore.id(info.name),\r\n gl.getUniformLocation(program, info.name),\r\n info));\r\n }\r\n }\r\n }\r\n\r\n // -------------------------------\r\n // grab attributes\r\n // -------------------------------\r\n var numAttributes = gl.getProgramParameter(program, GL_ACTIVE_ATTRIBUTES);\r\n if (config.profile) {\r\n desc.stats.attributesCount = numAttributes;\r\n }\r\n\r\n var attributes = desc.attributes;\r\n for (i = 0; i < numAttributes; ++i) {\r\n info = gl.getActiveAttrib(program, i);\r\n if (info) {\r\n insertActiveInfo(attributes, new ActiveInfo(\r\n info.name,\r\n stringStore.id(info.name),\r\n gl.getAttribLocation(program, info.name),\r\n info));\r\n }\r\n }\r\n }\r\n\r\n if (config.profile) {\r\n stats.getMaxUniformsCount = function () {\r\n var m = 0;\r\n programList.forEach(function (desc) {\r\n if (desc.stats.uniformsCount > m) {\r\n m = desc.stats.uniformsCount;\r\n }\r\n });\r\n return m\r\n };\r\n\r\n stats.getMaxAttributesCount = function () {\r\n var m = 0;\r\n programList.forEach(function (desc) {\r\n if (desc.stats.attributesCount > m) {\r\n m = desc.stats.attributesCount;\r\n }\r\n });\r\n return m\r\n };\r\n }\r\n\r\n function restoreShaders () {\r\n fragShaders = {};\r\n vertShaders = {};\r\n for (var i = 0; i < programList.length; ++i) {\r\n linkProgram(programList[i]);\r\n }\r\n }\r\n\r\n return {\r\n clear: function () {\r\n var deleteShader = gl.deleteShader.bind(gl);\r\n values(fragShaders).forEach(deleteShader);\r\n fragShaders = {};\r\n values(vertShaders).forEach(deleteShader);\r\n vertShaders = {};\r\n\r\n programList.forEach(function (desc) {\r\n gl.deleteProgram(desc.program);\r\n });\r\n programList.length = 0;\r\n programCache = {};\r\n\r\n stats.shaderCount = 0;\r\n },\r\n\r\n program: function (vertId, fragId, command) {\r\n check$1.command(vertId >= 0, 'missing vertex shader', command);\r\n check$1.command(fragId >= 0, 'missing fragment shader', command);\r\n\r\n var cache = programCache[fragId];\r\n if (!cache) {\r\n cache = programCache[fragId] = {};\r\n }\r\n var program = cache[vertId];\r\n if (!program) {\r\n program = new REGLProgram(fragId, vertId);\r\n stats.shaderCount++;\r\n\r\n linkProgram(program, command);\r\n cache[vertId] = program;\r\n programList.push(program);\r\n }\r\n return program\r\n },\r\n\r\n restore: restoreShaders,\r\n\r\n shader: getShader,\r\n\r\n frag: -1,\r\n vert: -1\r\n }\r\n}\n\nvar GL_RGBA$3 = 6408;\r\nvar GL_UNSIGNED_BYTE$7 = 5121;\r\nvar GL_PACK_ALIGNMENT = 0x0D05;\r\nvar GL_FLOAT$7 = 0x1406; // 5126\r\n\r\nfunction wrapReadPixels (\r\n gl,\r\n framebufferState,\r\n reglPoll,\r\n context,\r\n glAttributes,\r\n extensions,\r\n limits) {\r\n function readPixelsImpl (input) {\r\n var type;\r\n if (framebufferState.next === null) {\r\n check$1(\r\n glAttributes.preserveDrawingBuffer,\r\n 'you must create a webgl context with \"preserveDrawingBuffer\":true in order to read pixels from the drawing buffer');\r\n type = GL_UNSIGNED_BYTE$7;\r\n } else {\r\n check$1(\r\n framebufferState.next.colorAttachments[0].texture !== null,\r\n 'You cannot read from a renderbuffer');\r\n type = framebufferState.next.colorAttachments[0].texture._texture.type;\r\n\r\n if (extensions.oes_texture_float) {\r\n check$1(\r\n type === GL_UNSIGNED_BYTE$7 || type === GL_FLOAT$7,\r\n 'Reading from a framebuffer is only allowed for the types \\'uint8\\' and \\'float\\'');\r\n\r\n if (type === GL_FLOAT$7) {\r\n check$1(limits.readFloat, 'Reading \\'float\\' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float');\r\n }\r\n } else {\r\n check$1(\r\n type === GL_UNSIGNED_BYTE$7,\r\n 'Reading from a framebuffer is only allowed for the type \\'uint8\\'');\r\n }\r\n }\r\n\r\n var x = 0;\r\n var y = 0;\r\n var width = context.framebufferWidth;\r\n var height = context.framebufferHeight;\r\n var data = null;\r\n\r\n if (isTypedArray(input)) {\r\n data = input;\r\n } else if (input) {\r\n check$1.type(input, 'object', 'invalid arguments to regl.read()');\r\n x = input.x | 0;\r\n y = input.y | 0;\r\n check$1(\r\n x >= 0 && x < context.framebufferWidth,\r\n 'invalid x offset for regl.read');\r\n check$1(\r\n y >= 0 && y < context.framebufferHeight,\r\n 'invalid y offset for regl.read');\r\n width = (input.width || (context.framebufferWidth - x)) | 0;\r\n height = (input.height || (context.framebufferHeight - y)) | 0;\r\n data = input.data || null;\r\n }\r\n\r\n // sanity check input.data\r\n if (data) {\r\n if (type === GL_UNSIGNED_BYTE$7) {\r\n check$1(\r\n data instanceof Uint8Array,\r\n 'buffer must be \\'Uint8Array\\' when reading from a framebuffer of type \\'uint8\\'');\r\n } else if (type === GL_FLOAT$7) {\r\n check$1(\r\n data instanceof Float32Array,\r\n 'buffer must be \\'Float32Array\\' when reading from a framebuffer of type \\'float\\'');\r\n }\r\n }\r\n\r\n check$1(\r\n width > 0 && width + x <= context.framebufferWidth,\r\n 'invalid width for read pixels');\r\n check$1(\r\n height > 0 && height + y <= context.framebufferHeight,\r\n 'invalid height for read pixels');\r\n\r\n // Update WebGL state\r\n reglPoll();\r\n\r\n // Compute size\r\n var size = width * height * 4;\r\n\r\n // Allocate data\r\n if (!data) {\r\n if (type === GL_UNSIGNED_BYTE$7) {\r\n data = new Uint8Array(size);\r\n } else if (type === GL_FLOAT$7) {\r\n data = data || new Float32Array(size);\r\n }\r\n }\r\n\r\n // Type check\r\n check$1.isTypedArray(data, 'data buffer for regl.read() must be a typedarray');\r\n check$1(data.byteLength >= size, 'data buffer for regl.read() too small');\r\n\r\n // Run read pixels\r\n gl.pixelStorei(GL_PACK_ALIGNMENT, 4);\r\n gl.readPixels(x, y, width, height, GL_RGBA$3,\r\n type,\r\n data);\r\n\r\n return data\r\n }\r\n\r\n function readPixelsFBO (options) {\r\n var result;\r\n framebufferState.setFBO({\r\n framebuffer: options.framebuffer\r\n }, function () {\r\n result = readPixelsImpl(options);\r\n });\r\n return result\r\n }\r\n\r\n function readPixels (options) {\r\n if (!options || !('framebuffer' in options)) {\r\n return readPixelsImpl(options)\r\n } else {\r\n return readPixelsFBO(options)\r\n }\r\n }\r\n\r\n return readPixels\r\n}\n\nfunction slice (x) {\r\n return Array.prototype.slice.call(x)\r\n}\r\n\r\nfunction join (x) {\r\n return slice(x).join('')\r\n}\r\n\r\nfunction createEnvironment () {\r\n // Unique variable id counter\r\n var varCounter = 0;\r\n\r\n // Linked values are passed from this scope into the generated code block\r\n // Calling link() passes a value into the generated scope and returns\r\n // the variable name which it is bound to\r\n var linkedNames = [];\r\n var linkedValues = [];\r\n function link (value) {\r\n for (var i = 0; i < linkedValues.length; ++i) {\r\n if (linkedValues[i] === value) {\r\n return linkedNames[i]\r\n }\r\n }\r\n\r\n var name = 'g' + (varCounter++);\r\n linkedNames.push(name);\r\n linkedValues.push(value);\r\n return name\r\n }\r\n\r\n // create a code block\r\n function block () {\r\n var code = [];\r\n function push () {\r\n code.push.apply(code, slice(arguments));\r\n }\r\n\r\n var vars = [];\r\n function def () {\r\n var name = 'v' + (varCounter++);\r\n vars.push(name);\r\n\r\n if (arguments.length > 0) {\r\n code.push(name, '=');\r\n code.push.apply(code, slice(arguments));\r\n code.push(';');\r\n }\r\n\r\n return name\r\n }\r\n\r\n return extend(push, {\r\n def: def,\r\n toString: function () {\r\n return join([\r\n (vars.length > 0 ? 'var ' + vars + ';' : ''),\r\n join(code)\r\n ])\r\n }\r\n })\r\n }\r\n\r\n function scope () {\r\n var entry = block();\r\n var exit = block();\r\n\r\n var entryToString = entry.toString;\r\n var exitToString = exit.toString;\r\n\r\n function save (object, prop) {\r\n exit(object, prop, '=', entry.def(object, prop), ';');\r\n }\r\n\r\n return extend(function () {\r\n entry.apply(entry, slice(arguments));\r\n }, {\r\n def: entry.def,\r\n entry: entry,\r\n exit: exit,\r\n save: save,\r\n set: function (object, prop, value) {\r\n save(object, prop);\r\n entry(object, prop, '=', value, ';');\r\n },\r\n toString: function () {\r\n return entryToString() + exitToString()\r\n }\r\n })\r\n }\r\n\r\n function conditional () {\r\n var pred = join(arguments);\r\n var thenBlock = scope();\r\n var elseBlock = scope();\r\n\r\n var thenToString = thenBlock.toString;\r\n var elseToString = elseBlock.toString;\r\n\r\n return extend(thenBlock, {\r\n then: function () {\r\n thenBlock.apply(thenBlock, slice(arguments));\r\n return this\r\n },\r\n else: function () {\r\n elseBlock.apply(elseBlock, slice(arguments));\r\n return this\r\n },\r\n toString: function () {\r\n var elseClause = elseToString();\r\n if (elseClause) {\r\n elseClause = 'else{' + elseClause + '}';\r\n }\r\n return join([\r\n 'if(', pred, '){',\r\n thenToString(),\r\n '}', elseClause\r\n ])\r\n }\r\n })\r\n }\r\n\r\n // procedure list\r\n var globalBlock = block();\r\n var procedures = {};\r\n function proc (name, count) {\r\n var args = [];\r\n function arg () {\r\n var name = 'a' + args.length;\r\n args.push(name);\r\n return name\r\n }\r\n\r\n count = count || 0;\r\n for (var i = 0; i < count; ++i) {\r\n arg();\r\n }\r\n\r\n var body = scope();\r\n var bodyToString = body.toString;\r\n\r\n var result = procedures[name] = extend(body, {\r\n arg: arg,\r\n toString: function () {\r\n return join([\r\n 'function(', args.join(), '){',\r\n bodyToString(),\r\n '}'\r\n ])\r\n }\r\n });\r\n\r\n return result\r\n }\r\n\r\n function compile () {\r\n var code = ['\"use strict\";',\r\n globalBlock,\r\n 'return {'];\r\n Object.keys(procedures).forEach(function (name) {\r\n code.push('\"', name, '\":', procedures[name].toString(), ',');\r\n });\r\n code.push('}');\r\n var src = join(code)\r\n .replace(/;/g, ';\\n')\r\n .replace(/}/g, '}\\n')\r\n .replace(/{/g, '{\\n');\r\n var proc = Function.apply(null, linkedNames.concat(src));\r\n return proc.apply(null, linkedValues)\r\n }\r\n\r\n return {\r\n global: globalBlock,\r\n link: link,\r\n block: block,\r\n proc: proc,\r\n scope: scope,\r\n cond: conditional,\r\n compile: compile\r\n }\r\n}\n\n// \"cute\" names for vector components\r\nvar CUTE_COMPONENTS = 'xyzw'.split('');\r\n\r\nvar GL_UNSIGNED_BYTE$8 = 5121;\r\n\r\nvar ATTRIB_STATE_POINTER = 1;\r\nvar ATTRIB_STATE_CONSTANT = 2;\r\n\r\nvar DYN_FUNC$1 = 0;\r\nvar DYN_PROP$1 = 1;\r\nvar DYN_CONTEXT$1 = 2;\r\nvar DYN_STATE$1 = 3;\r\nvar DYN_THUNK = 4;\r\n\r\nvar S_DITHER = 'dither';\r\nvar S_BLEND_ENABLE = 'blend.enable';\r\nvar S_BLEND_COLOR = 'blend.color';\r\nvar S_BLEND_EQUATION = 'blend.equation';\r\nvar S_BLEND_FUNC = 'blend.func';\r\nvar S_DEPTH_ENABLE = 'depth.enable';\r\nvar S_DEPTH_FUNC = 'depth.func';\r\nvar S_DEPTH_RANGE = 'depth.range';\r\nvar S_DEPTH_MASK = 'depth.mask';\r\nvar S_COLOR_MASK = 'colorMask';\r\nvar S_CULL_ENABLE = 'cull.enable';\r\nvar S_CULL_FACE = 'cull.face';\r\nvar S_FRONT_FACE = 'frontFace';\r\nvar S_LINE_WIDTH = 'lineWidth';\r\nvar S_POLYGON_OFFSET_ENABLE = 'polygonOffset.enable';\r\nvar S_POLYGON_OFFSET_OFFSET = 'polygonOffset.offset';\r\nvar S_SAMPLE_ALPHA = 'sample.alpha';\r\nvar S_SAMPLE_ENABLE = 'sample.enable';\r\nvar S_SAMPLE_COVERAGE = 'sample.coverage';\r\nvar S_STENCIL_ENABLE = 'stencil.enable';\r\nvar S_STENCIL_MASK = 'stencil.mask';\r\nvar S_STENCIL_FUNC = 'stencil.func';\r\nvar S_STENCIL_OPFRONT = 'stencil.opFront';\r\nvar S_STENCIL_OPBACK = 'stencil.opBack';\r\nvar S_SCISSOR_ENABLE = 'scissor.enable';\r\nvar S_SCISSOR_BOX = 'scissor.box';\r\nvar S_VIEWPORT = 'viewport';\r\n\r\nvar S_PROFILE = 'profile';\r\n\r\nvar S_FRAMEBUFFER = 'framebuffer';\r\nvar S_VERT = 'vert';\r\nvar S_FRAG = 'frag';\r\nvar S_ELEMENTS = 'elements';\r\nvar S_PRIMITIVE = 'primitive';\r\nvar S_COUNT = 'count';\r\nvar S_OFFSET = 'offset';\r\nvar S_INSTANCES = 'instances';\r\n\r\nvar SUFFIX_WIDTH = 'Width';\r\nvar SUFFIX_HEIGHT = 'Height';\r\n\r\nvar S_FRAMEBUFFER_WIDTH = S_FRAMEBUFFER + SUFFIX_WIDTH;\r\nvar S_FRAMEBUFFER_HEIGHT = S_FRAMEBUFFER + SUFFIX_HEIGHT;\r\nvar S_VIEWPORT_WIDTH = S_VIEWPORT + SUFFIX_WIDTH;\r\nvar S_VIEWPORT_HEIGHT = S_VIEWPORT + SUFFIX_HEIGHT;\r\nvar S_DRAWINGBUFFER = 'drawingBuffer';\r\nvar S_DRAWINGBUFFER_WIDTH = S_DRAWINGBUFFER + SUFFIX_WIDTH;\r\nvar S_DRAWINGBUFFER_HEIGHT = S_DRAWINGBUFFER + SUFFIX_HEIGHT;\r\n\r\nvar NESTED_OPTIONS = [\r\n S_BLEND_FUNC,\r\n S_BLEND_EQUATION,\r\n S_STENCIL_FUNC,\r\n S_STENCIL_OPFRONT,\r\n S_STENCIL_OPBACK,\r\n S_SAMPLE_COVERAGE,\r\n S_VIEWPORT,\r\n S_SCISSOR_BOX,\r\n S_POLYGON_OFFSET_OFFSET\r\n];\r\n\r\nvar GL_ARRAY_BUFFER$1 = 34962;\r\nvar GL_ELEMENT_ARRAY_BUFFER$1 = 34963;\r\n\r\nvar GL_FRAGMENT_SHADER$1 = 35632;\r\nvar GL_VERTEX_SHADER$1 = 35633;\r\n\r\nvar GL_TEXTURE_2D$3 = 0x0DE1;\r\nvar GL_TEXTURE_CUBE_MAP$2 = 0x8513;\r\n\r\nvar GL_CULL_FACE = 0x0B44;\r\nvar GL_BLEND = 0x0BE2;\r\nvar GL_DITHER = 0x0BD0;\r\nvar GL_STENCIL_TEST = 0x0B90;\r\nvar GL_DEPTH_TEST = 0x0B71;\r\nvar GL_SCISSOR_TEST = 0x0C11;\r\nvar GL_POLYGON_OFFSET_FILL = 0x8037;\r\nvar GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;\r\nvar GL_SAMPLE_COVERAGE = 0x80A0;\r\n\r\nvar GL_FLOAT$8 = 5126;\r\nvar GL_FLOAT_VEC2 = 35664;\r\nvar GL_FLOAT_VEC3 = 35665;\r\nvar GL_FLOAT_VEC4 = 35666;\r\nvar GL_INT$3 = 5124;\r\nvar GL_INT_VEC2 = 35667;\r\nvar GL_INT_VEC3 = 35668;\r\nvar GL_INT_VEC4 = 35669;\r\nvar GL_BOOL = 35670;\r\nvar GL_BOOL_VEC2 = 35671;\r\nvar GL_BOOL_VEC3 = 35672;\r\nvar GL_BOOL_VEC4 = 35673;\r\nvar GL_FLOAT_MAT2 = 35674;\r\nvar GL_FLOAT_MAT3 = 35675;\r\nvar GL_FLOAT_MAT4 = 35676;\r\nvar GL_SAMPLER_2D = 35678;\r\nvar GL_SAMPLER_CUBE = 35680;\r\n\r\nvar GL_TRIANGLES$1 = 4;\r\n\r\nvar GL_FRONT = 1028;\r\nvar GL_BACK = 1029;\r\nvar GL_CW = 0x0900;\r\nvar GL_CCW = 0x0901;\r\nvar GL_MIN_EXT = 0x8007;\r\nvar GL_MAX_EXT = 0x8008;\r\nvar GL_ALWAYS = 519;\r\nvar GL_KEEP = 7680;\r\nvar GL_ZERO = 0;\r\nvar GL_ONE = 1;\r\nvar GL_FUNC_ADD = 0x8006;\r\nvar GL_LESS = 513;\r\n\r\nvar GL_FRAMEBUFFER$2 = 0x8D40;\r\nvar GL_COLOR_ATTACHMENT0$2 = 0x8CE0;\r\n\r\nvar blendFuncs = {\r\n '0': 0,\r\n '1': 1,\r\n 'zero': 0,\r\n 'one': 1,\r\n 'src color': 768,\r\n 'one minus src color': 769,\r\n 'src alpha': 770,\r\n 'one minus src alpha': 771,\r\n 'dst color': 774,\r\n 'one minus dst color': 775,\r\n 'dst alpha': 772,\r\n 'one minus dst alpha': 773,\r\n 'constant color': 32769,\r\n 'one minus constant color': 32770,\r\n 'constant alpha': 32771,\r\n 'one minus constant alpha': 32772,\r\n 'src alpha saturate': 776\r\n};\r\n\r\n// There are invalid values for srcRGB and dstRGB. See:\r\n// https://www.khronos.org/registry/webgl/specs/1.0/#6.13\r\n// https://github.com/KhronosGroup/WebGL/blob/0d3201f5f7ec3c0060bc1f04077461541f1987b9/conformance-suites/1.0.3/conformance/misc/webgl-specific.html#L56\r\nvar invalidBlendCombinations = [\r\n 'constant color, constant alpha',\r\n 'one minus constant color, constant alpha',\r\n 'constant color, one minus constant alpha',\r\n 'one minus constant color, one minus constant alpha',\r\n 'constant alpha, constant color',\r\n 'constant alpha, one minus constant color',\r\n 'one minus constant alpha, constant color',\r\n 'one minus constant alpha, one minus constant color'\r\n];\r\n\r\nvar compareFuncs = {\r\n 'never': 512,\r\n 'less': 513,\r\n '<': 513,\r\n 'equal': 514,\r\n '=': 514,\r\n '==': 514,\r\n '===': 514,\r\n 'lequal': 515,\r\n '<=': 515,\r\n 'greater': 516,\r\n '>': 516,\r\n 'notequal': 517,\r\n '!=': 517,\r\n '!==': 517,\r\n 'gequal': 518,\r\n '>=': 518,\r\n 'always': 519\r\n};\r\n\r\nvar stencilOps = {\r\n '0': 0,\r\n 'zero': 0,\r\n 'keep': 7680,\r\n 'replace': 7681,\r\n 'increment': 7682,\r\n 'decrement': 7683,\r\n 'increment wrap': 34055,\r\n 'decrement wrap': 34056,\r\n 'invert': 5386\r\n};\r\n\r\nvar shaderType = {\r\n 'frag': GL_FRAGMENT_SHADER$1,\r\n 'vert': GL_VERTEX_SHADER$1\r\n};\r\n\r\nvar orientationType = {\r\n 'cw': GL_CW,\r\n 'ccw': GL_CCW\r\n};\r\n\r\nfunction isBufferArgs (x) {\r\n return Array.isArray(x) ||\r\n isTypedArray(x) ||\r\n isNDArrayLike(x)\r\n}\r\n\r\n// Make sure viewport is processed first\r\nfunction sortState (state) {\r\n return state.sort(function (a, b) {\r\n if (a === S_VIEWPORT) {\r\n return -1\r\n } else if (b === S_VIEWPORT) {\r\n return 1\r\n }\r\n return (a < b) ? -1 : 1\r\n })\r\n}\r\n\r\nfunction Declaration (thisDep, contextDep, propDep, append) {\r\n this.thisDep = thisDep;\r\n this.contextDep = contextDep;\r\n this.propDep = propDep;\r\n this.append = append;\r\n}\r\n\r\nfunction isStatic (decl) {\r\n return decl && !(decl.thisDep || decl.contextDep || decl.propDep)\r\n}\r\n\r\nfunction createStaticDecl (append) {\r\n return new Declaration(false, false, false, append)\r\n}\r\n\r\nfunction createDynamicDecl (dyn, append) {\r\n var type = dyn.type;\r\n if (type === DYN_FUNC$1) {\r\n var numArgs = dyn.data.length;\r\n return new Declaration(\r\n true,\r\n numArgs >= 1,\r\n numArgs >= 2,\r\n append)\r\n } else if (type === DYN_THUNK) {\r\n var data = dyn.data;\r\n return new Declaration(\r\n data.thisDep,\r\n data.contextDep,\r\n data.propDep,\r\n append)\r\n } else {\r\n return new Declaration(\r\n type === DYN_STATE$1,\r\n type === DYN_CONTEXT$1,\r\n type === DYN_PROP$1,\r\n append)\r\n }\r\n}\r\n\r\nvar SCOPE_DECL = new Declaration(false, false, false, function () {});\r\n\r\nfunction reglCore (\r\n gl,\r\n stringStore,\r\n extensions,\r\n limits,\r\n bufferState,\r\n elementState,\r\n textureState,\r\n framebufferState,\r\n uniformState,\r\n attributeState,\r\n shaderState,\r\n drawState,\r\n contextState,\r\n timer,\r\n config) {\r\n var AttributeRecord = attributeState.Record;\r\n\r\n var blendEquations = {\r\n 'add': 32774,\r\n 'subtract': 32778,\r\n 'reverse subtract': 32779\r\n };\r\n if (extensions.ext_blend_minmax) {\r\n blendEquations.min = GL_MIN_EXT;\r\n blendEquations.max = GL_MAX_EXT;\r\n }\r\n\r\n var extInstancing = extensions.angle_instanced_arrays;\r\n var extDrawBuffers = extensions.webgl_draw_buffers;\r\n\r\n // ===================================================\r\n // ===================================================\r\n // WEBGL STATE\r\n // ===================================================\r\n // ===================================================\r\n var currentState = {\r\n dirty: true,\r\n profile: config.profile\r\n };\r\n var nextState = {};\r\n var GL_STATE_NAMES = [];\r\n var GL_FLAGS = {};\r\n var GL_VARIABLES = {};\r\n\r\n function propName (name) {\r\n return name.replace('.', '_')\r\n }\r\n\r\n function stateFlag (sname, cap, init) {\r\n var name = propName(sname);\r\n GL_STATE_NAMES.push(sname);\r\n nextState[name] = currentState[name] = !!init;\r\n GL_FLAGS[name] = cap;\r\n }\r\n\r\n function stateVariable (sname, func, init) {\r\n var name = propName(sname);\r\n GL_STATE_NAMES.push(sname);\r\n if (Array.isArray(init)) {\r\n currentState[name] = init.slice();\r\n nextState[name] = init.slice();\r\n } else {\r\n currentState[name] = nextState[name] = init;\r\n }\r\n GL_VARIABLES[name] = func;\r\n }\r\n\r\n // Dithering\r\n stateFlag(S_DITHER, GL_DITHER);\r\n\r\n // Blending\r\n stateFlag(S_BLEND_ENABLE, GL_BLEND);\r\n stateVariable(S_BLEND_COLOR, 'blendColor', [0, 0, 0, 0]);\r\n stateVariable(S_BLEND_EQUATION, 'blendEquationSeparate',\r\n [GL_FUNC_ADD, GL_FUNC_ADD]);\r\n stateVariable(S_BLEND_FUNC, 'blendFuncSeparate',\r\n [GL_ONE, GL_ZERO, GL_ONE, GL_ZERO]);\r\n\r\n // Depth\r\n stateFlag(S_DEPTH_ENABLE, GL_DEPTH_TEST, true);\r\n stateVariable(S_DEPTH_FUNC, 'depthFunc', GL_LESS);\r\n stateVariable(S_DEPTH_RANGE, 'depthRange', [0, 1]);\r\n stateVariable(S_DEPTH_MASK, 'depthMask', true);\r\n\r\n // Color mask\r\n stateVariable(S_COLOR_MASK, S_COLOR_MASK, [true, true, true, true]);\r\n\r\n // Face culling\r\n stateFlag(S_CULL_ENABLE, GL_CULL_FACE);\r\n stateVariable(S_CULL_FACE, 'cullFace', GL_BACK);\r\n\r\n // Front face orientation\r\n stateVariable(S_FRONT_FACE, S_FRONT_FACE, GL_CCW);\r\n\r\n // Line width\r\n stateVariable(S_LINE_WIDTH, S_LINE_WIDTH, 1);\r\n\r\n // Polygon offset\r\n stateFlag(S_POLYGON_OFFSET_ENABLE, GL_POLYGON_OFFSET_FILL);\r\n stateVariable(S_POLYGON_OFFSET_OFFSET, 'polygonOffset', [0, 0]);\r\n\r\n // Sample coverage\r\n stateFlag(S_SAMPLE_ALPHA, GL_SAMPLE_ALPHA_TO_COVERAGE);\r\n stateFlag(S_SAMPLE_ENABLE, GL_SAMPLE_COVERAGE);\r\n stateVariable(S_SAMPLE_COVERAGE, 'sampleCoverage', [1, false]);\r\n\r\n // Stencil\r\n stateFlag(S_STENCIL_ENABLE, GL_STENCIL_TEST);\r\n stateVariable(S_STENCIL_MASK, 'stencilMask', -1);\r\n stateVariable(S_STENCIL_FUNC, 'stencilFunc', [GL_ALWAYS, 0, -1]);\r\n stateVariable(S_STENCIL_OPFRONT, 'stencilOpSeparate',\r\n [GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP]);\r\n stateVariable(S_STENCIL_OPBACK, 'stencilOpSeparate',\r\n [GL_BACK, GL_KEEP, GL_KEEP, GL_KEEP]);\r\n\r\n // Scissor\r\n stateFlag(S_SCISSOR_ENABLE, GL_SCISSOR_TEST);\r\n stateVariable(S_SCISSOR_BOX, 'scissor',\r\n [0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight]);\r\n\r\n // Viewport\r\n stateVariable(S_VIEWPORT, S_VIEWPORT,\r\n [0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight]);\r\n\r\n // ===================================================\r\n // ===================================================\r\n // ENVIRONMENT\r\n // ===================================================\r\n // ===================================================\r\n var sharedState = {\r\n gl: gl,\r\n context: contextState,\r\n strings: stringStore,\r\n next: nextState,\r\n current: currentState,\r\n draw: drawState,\r\n elements: elementState,\r\n buffer: bufferState,\r\n shader: shaderState,\r\n attributes: attributeState.state,\r\n uniforms: uniformState,\r\n framebuffer: framebufferState,\r\n extensions: extensions,\r\n\r\n timer: timer,\r\n isBufferArgs: isBufferArgs\r\n };\r\n\r\n var sharedConstants = {\r\n primTypes: primTypes,\r\n compareFuncs: compareFuncs,\r\n blendFuncs: blendFuncs,\r\n blendEquations: blendEquations,\r\n stencilOps: stencilOps,\r\n glTypes: glTypes,\r\n orientationType: orientationType\r\n };\r\n\r\n check$1.optional(function () {\r\n sharedState.isArrayLike = isArrayLike;\r\n });\r\n\r\n if (extDrawBuffers) {\r\n sharedConstants.backBuffer = [GL_BACK];\r\n sharedConstants.drawBuffer = loop(limits.maxDrawbuffers, function (i) {\r\n if (i === 0) {\r\n return [0]\r\n }\r\n return loop(i, function (j) {\r\n return GL_COLOR_ATTACHMENT0$2 + j\r\n })\r\n });\r\n }\r\n\r\n var drawCallCounter = 0;\r\n function createREGLEnvironment () {\r\n var env = createEnvironment();\r\n var link = env.link;\r\n var global = env.global;\r\n env.id = drawCallCounter++;\r\n\r\n env.batchId = '0';\r\n\r\n // link shared state\r\n var SHARED = link(sharedState);\r\n var shared = env.shared = {\r\n props: 'a0'\r\n };\r\n Object.keys(sharedState).forEach(function (prop) {\r\n shared[prop] = global.def(SHARED, '.', prop);\r\n });\r\n\r\n // Inject runtime assertion stuff for debug builds\r\n check$1.optional(function () {\r\n env.CHECK = link(check$1);\r\n env.commandStr = check$1.guessCommand();\r\n env.command = link(env.commandStr);\r\n env.assert = function (block, pred, message) {\r\n block(\r\n 'if(!(', pred, '))',\r\n this.CHECK, '.commandRaise(', link(message), ',', this.command, ');');\r\n };\r\n\r\n sharedConstants.invalidBlendCombinations = invalidBlendCombinations;\r\n });\r\n\r\n // Copy GL state variables over\r\n var nextVars = env.next = {};\r\n var currentVars = env.current = {};\r\n Object.keys(GL_VARIABLES).forEach(function (variable) {\r\n if (Array.isArray(currentState[variable])) {\r\n nextVars[variable] = global.def(shared.next, '.', variable);\r\n currentVars[variable] = global.def(shared.current, '.', variable);\r\n }\r\n });\r\n\r\n // Initialize shared constants\r\n var constants = env.constants = {};\r\n Object.keys(sharedConstants).forEach(function (name) {\r\n constants[name] = global.def(JSON.stringify(sharedConstants[name]));\r\n });\r\n\r\n // Helper function for calling a block\r\n env.invoke = function (block, x) {\r\n switch (x.type) {\r\n case DYN_FUNC$1:\r\n var argList = [\r\n 'this',\r\n shared.context,\r\n shared.props,\r\n env.batchId\r\n ];\r\n return block.def(\r\n link(x.data), '.call(',\r\n argList.slice(0, Math.max(x.data.length + 1, 4)),\r\n ')')\r\n case DYN_PROP$1:\r\n return block.def(shared.props, x.data)\r\n case DYN_CONTEXT$1:\r\n return block.def(shared.context, x.data)\r\n case DYN_STATE$1:\r\n return block.def('this', x.data)\r\n case DYN_THUNK:\r\n x.data.append(env, block);\r\n return x.data.ref\r\n }\r\n };\r\n\r\n env.attribCache = {};\r\n\r\n var scopeAttribs = {};\r\n env.scopeAttrib = function (name) {\r\n var id = stringStore.id(name);\r\n if (id in scopeAttribs) {\r\n return scopeAttribs[id]\r\n }\r\n var binding = attributeState.scope[id];\r\n if (!binding) {\r\n binding = attributeState.scope[id] = new AttributeRecord();\r\n }\r\n var result = scopeAttribs[id] = link(binding);\r\n return result\r\n };\r\n\r\n return env\r\n }\r\n\r\n // ===================================================\r\n // ===================================================\r\n // PARSING\r\n // ===================================================\r\n // ===================================================\r\n function parseProfile (options) {\r\n var staticOptions = options.static;\r\n var dynamicOptions = options.dynamic;\r\n\r\n var profileEnable;\r\n if (S_PROFILE in staticOptions) {\r\n var value = !!staticOptions[S_PROFILE];\r\n profileEnable = createStaticDecl(function (env, scope) {\r\n return value\r\n });\r\n profileEnable.enable = value;\r\n } else if (S_PROFILE in dynamicOptions) {\r\n var dyn = dynamicOptions[S_PROFILE];\r\n profileEnable = createDynamicDecl(dyn, function (env, scope) {\r\n return env.invoke(scope, dyn)\r\n });\r\n }\r\n\r\n return profileEnable\r\n }\r\n\r\n function parseFramebuffer (options, env) {\r\n var staticOptions = options.static;\r\n var dynamicOptions = options.dynamic;\r\n\r\n if (S_FRAMEBUFFER in staticOptions) {\r\n var framebuffer = staticOptions[S_FRAMEBUFFER];\r\n if (framebuffer) {\r\n framebuffer = framebufferState.getFramebuffer(framebuffer);\r\n check$1.command(framebuffer, 'invalid framebuffer object');\r\n return createStaticDecl(function (env, block) {\r\n var FRAMEBUFFER = env.link(framebuffer);\r\n var shared = env.shared;\r\n block.set(\r\n shared.framebuffer,\r\n '.next',\r\n FRAMEBUFFER);\r\n var CONTEXT = shared.context;\r\n block.set(\r\n CONTEXT,\r\n '.' + S_FRAMEBUFFER_WIDTH,\r\n FRAMEBUFFER + '.width');\r\n block.set(\r\n CONTEXT,\r\n '.' + S_FRAMEBUFFER_HEIGHT,\r\n FRAMEBUFFER + '.height');\r\n return FRAMEBUFFER\r\n })\r\n } else {\r\n return createStaticDecl(function (env, scope) {\r\n var shared = env.shared;\r\n scope.set(\r\n shared.framebuffer,\r\n '.next',\r\n 'null');\r\n var CONTEXT = shared.context;\r\n scope.set(\r\n CONTEXT,\r\n '.' + S_FRAMEBUFFER_WIDTH,\r\n CONTEXT + '.' + S_DRAWINGBUFFER_WIDTH);\r\n scope.set(\r\n CONTEXT,\r\n '.' + S_FRAMEBUFFER_HEIGHT,\r\n CONTEXT + '.' + S_DRAWINGBUFFER_HEIGHT);\r\n return 'null'\r\n })\r\n }\r\n } else if (S_FRAMEBUFFER in dynamicOptions) {\r\n var dyn = dynamicOptions[S_FRAMEBUFFER];\r\n return createDynamicDecl(dyn, function (env, scope) {\r\n var FRAMEBUFFER_FUNC = env.invoke(scope, dyn);\r\n var shared = env.shared;\r\n var FRAMEBUFFER_STATE = shared.framebuffer;\r\n var FRAMEBUFFER = scope.def(\r\n FRAMEBUFFER_STATE, '.getFramebuffer(', FRAMEBUFFER_FUNC, ')');\r\n\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n '!' + FRAMEBUFFER_FUNC + '||' + FRAMEBUFFER,\r\n 'invalid framebuffer object');\r\n });\r\n\r\n scope.set(\r\n FRAMEBUFFER_STATE,\r\n '.next',\r\n FRAMEBUFFER);\r\n var CONTEXT = shared.context;\r\n scope.set(\r\n CONTEXT,\r\n '.' + S_FRAMEBUFFER_WIDTH,\r\n FRAMEBUFFER + '?' + FRAMEBUFFER + '.width:' +\r\n CONTEXT + '.' + S_DRAWINGBUFFER_WIDTH);\r\n scope.set(\r\n CONTEXT,\r\n '.' + S_FRAMEBUFFER_HEIGHT,\r\n FRAMEBUFFER +\r\n '?' + FRAMEBUFFER + '.height:' +\r\n CONTEXT + '.' + S_DRAWINGBUFFER_HEIGHT);\r\n return FRAMEBUFFER\r\n })\r\n } else {\r\n return null\r\n }\r\n }\r\n\r\n function parseViewportScissor (options, framebuffer, env) {\r\n var staticOptions = options.static;\r\n var dynamicOptions = options.dynamic;\r\n\r\n function parseBox (param) {\r\n if (param in staticOptions) {\r\n var box = staticOptions[param];\r\n check$1.commandType(box, 'object', 'invalid ' + param, env.commandStr);\r\n\r\n var isStatic = true;\r\n var x = box.x | 0;\r\n var y = box.y | 0;\r\n var w, h;\r\n if ('width' in box) {\r\n w = box.width | 0;\r\n check$1.command(w >= 0, 'invalid ' + param, env.commandStr);\r\n } else {\r\n isStatic = false;\r\n }\r\n if ('height' in box) {\r\n h = box.height | 0;\r\n check$1.command(h >= 0, 'invalid ' + param, env.commandStr);\r\n } else {\r\n isStatic = false;\r\n }\r\n\r\n return new Declaration(\r\n !isStatic && framebuffer && framebuffer.thisDep,\r\n !isStatic && framebuffer && framebuffer.contextDep,\r\n !isStatic && framebuffer && framebuffer.propDep,\r\n function (env, scope) {\r\n var CONTEXT = env.shared.context;\r\n var BOX_W = w;\r\n if (!('width' in box)) {\r\n BOX_W = scope.def(CONTEXT, '.', S_FRAMEBUFFER_WIDTH, '-', x);\r\n }\r\n var BOX_H = h;\r\n if (!('height' in box)) {\r\n BOX_H = scope.def(CONTEXT, '.', S_FRAMEBUFFER_HEIGHT, '-', y);\r\n }\r\n return [x, y, BOX_W, BOX_H]\r\n })\r\n } else if (param in dynamicOptions) {\r\n var dynBox = dynamicOptions[param];\r\n var result = createDynamicDecl(dynBox, function (env, scope) {\r\n var BOX = env.invoke(scope, dynBox);\r\n\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n BOX + '&&typeof ' + BOX + '===\"object\"',\r\n 'invalid ' + param);\r\n });\r\n\r\n var CONTEXT = env.shared.context;\r\n var BOX_X = scope.def(BOX, '.x|0');\r\n var BOX_Y = scope.def(BOX, '.y|0');\r\n var BOX_W = scope.def(\r\n '\"width\" in ', BOX, '?', BOX, '.width|0:',\r\n '(', CONTEXT, '.', S_FRAMEBUFFER_WIDTH, '-', BOX_X, ')');\r\n var BOX_H = scope.def(\r\n '\"height\" in ', BOX, '?', BOX, '.height|0:',\r\n '(', CONTEXT, '.', S_FRAMEBUFFER_HEIGHT, '-', BOX_Y, ')');\r\n\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n BOX_W + '>=0&&' +\r\n BOX_H + '>=0',\r\n 'invalid ' + param);\r\n });\r\n\r\n return [BOX_X, BOX_Y, BOX_W, BOX_H]\r\n });\r\n if (framebuffer) {\r\n result.thisDep = result.thisDep || framebuffer.thisDep;\r\n result.contextDep = result.contextDep || framebuffer.contextDep;\r\n result.propDep = result.propDep || framebuffer.propDep;\r\n }\r\n return result\r\n } else if (framebuffer) {\r\n return new Declaration(\r\n framebuffer.thisDep,\r\n framebuffer.contextDep,\r\n framebuffer.propDep,\r\n function (env, scope) {\r\n var CONTEXT = env.shared.context;\r\n return [\r\n 0, 0,\r\n scope.def(CONTEXT, '.', S_FRAMEBUFFER_WIDTH),\r\n scope.def(CONTEXT, '.', S_FRAMEBUFFER_HEIGHT)]\r\n })\r\n } else {\r\n return null\r\n }\r\n }\r\n\r\n var viewport = parseBox(S_VIEWPORT);\r\n\r\n if (viewport) {\r\n var prevViewport = viewport;\r\n viewport = new Declaration(\r\n viewport.thisDep,\r\n viewport.contextDep,\r\n viewport.propDep,\r\n function (env, scope) {\r\n var VIEWPORT = prevViewport.append(env, scope);\r\n var CONTEXT = env.shared.context;\r\n scope.set(\r\n CONTEXT,\r\n '.' + S_VIEWPORT_WIDTH,\r\n VIEWPORT[2]);\r\n scope.set(\r\n CONTEXT,\r\n '.' + S_VIEWPORT_HEIGHT,\r\n VIEWPORT[3]);\r\n return VIEWPORT\r\n });\r\n }\r\n\r\n return {\r\n viewport: viewport,\r\n scissor_box: parseBox(S_SCISSOR_BOX)\r\n }\r\n }\r\n\r\n function parseProgram (options) {\r\n var staticOptions = options.static;\r\n var dynamicOptions = options.dynamic;\r\n\r\n function parseShader (name) {\r\n if (name in staticOptions) {\r\n var id = stringStore.id(staticOptions[name]);\r\n check$1.optional(function () {\r\n shaderState.shader(shaderType[name], id, check$1.guessCommand());\r\n });\r\n var result = createStaticDecl(function () {\r\n return id\r\n });\r\n result.id = id;\r\n return result\r\n } else if (name in dynamicOptions) {\r\n var dyn = dynamicOptions[name];\r\n return createDynamicDecl(dyn, function (env, scope) {\r\n var str = env.invoke(scope, dyn);\r\n var id = scope.def(env.shared.strings, '.id(', str, ')');\r\n check$1.optional(function () {\r\n scope(\r\n env.shared.shader, '.shader(',\r\n shaderType[name], ',',\r\n id, ',',\r\n env.command, ');');\r\n });\r\n return id\r\n })\r\n }\r\n return null\r\n }\r\n\r\n var frag = parseShader(S_FRAG);\r\n var vert = parseShader(S_VERT);\r\n\r\n var program = null;\r\n var progVar;\r\n if (isStatic(frag) && isStatic(vert)) {\r\n program = shaderState.program(vert.id, frag.id);\r\n progVar = createStaticDecl(function (env, scope) {\r\n return env.link(program)\r\n });\r\n } else {\r\n progVar = new Declaration(\r\n (frag && frag.thisDep) || (vert && vert.thisDep),\r\n (frag && frag.contextDep) || (vert && vert.contextDep),\r\n (frag && frag.propDep) || (vert && vert.propDep),\r\n function (env, scope) {\r\n var SHADER_STATE = env.shared.shader;\r\n var fragId;\r\n if (frag) {\r\n fragId = frag.append(env, scope);\r\n } else {\r\n fragId = scope.def(SHADER_STATE, '.', S_FRAG);\r\n }\r\n var vertId;\r\n if (vert) {\r\n vertId = vert.append(env, scope);\r\n } else {\r\n vertId = scope.def(SHADER_STATE, '.', S_VERT);\r\n }\r\n var progDef = SHADER_STATE + '.program(' + vertId + ',' + fragId;\r\n check$1.optional(function () {\r\n progDef += ',' + env.command;\r\n });\r\n return scope.def(progDef + ')')\r\n });\r\n }\r\n\r\n return {\r\n frag: frag,\r\n vert: vert,\r\n progVar: progVar,\r\n program: program\r\n }\r\n }\r\n\r\n function parseDraw (options, env) {\r\n var staticOptions = options.static;\r\n var dynamicOptions = options.dynamic;\r\n\r\n function parseElements () {\r\n if (S_ELEMENTS in staticOptions) {\r\n var elements = staticOptions[S_ELEMENTS];\r\n if (isBufferArgs(elements)) {\r\n elements = elementState.getElements(elementState.create(elements, true));\r\n } else if (elements) {\r\n elements = elementState.getElements(elements);\r\n check$1.command(elements, 'invalid elements', env.commandStr);\r\n }\r\n var result = createStaticDecl(function (env, scope) {\r\n if (elements) {\r\n var result = env.link(elements);\r\n env.ELEMENTS = result;\r\n return result\r\n }\r\n env.ELEMENTS = null;\r\n return null\r\n });\r\n result.value = elements;\r\n return result\r\n } else if (S_ELEMENTS in dynamicOptions) {\r\n var dyn = dynamicOptions[S_ELEMENTS];\r\n return createDynamicDecl(dyn, function (env, scope) {\r\n var shared = env.shared;\r\n\r\n var IS_BUFFER_ARGS = shared.isBufferArgs;\r\n var ELEMENT_STATE = shared.elements;\r\n\r\n var elementDefn = env.invoke(scope, dyn);\r\n var elements = scope.def('null');\r\n var elementStream = scope.def(IS_BUFFER_ARGS, '(', elementDefn, ')');\r\n\r\n var ifte = env.cond(elementStream)\r\n .then(elements, '=', ELEMENT_STATE, '.createStream(', elementDefn, ');')\r\n .else(elements, '=', ELEMENT_STATE, '.getElements(', elementDefn, ');');\r\n\r\n check$1.optional(function () {\r\n env.assert(ifte.else,\r\n '!' + elementDefn + '||' + elements,\r\n 'invalid elements');\r\n });\r\n\r\n scope.entry(ifte);\r\n scope.exit(\r\n env.cond(elementStream)\r\n .then(ELEMENT_STATE, '.destroyStream(', elements, ');'));\r\n\r\n env.ELEMENTS = elements;\r\n\r\n return elements\r\n })\r\n }\r\n\r\n return null\r\n }\r\n\r\n var elements = parseElements();\r\n\r\n function parsePrimitive () {\r\n if (S_PRIMITIVE in staticOptions) {\r\n var primitive = staticOptions[S_PRIMITIVE];\r\n check$1.commandParameter(primitive, primTypes, 'invalid primitve', env.commandStr);\r\n return createStaticDecl(function (env, scope) {\r\n return primTypes[primitive]\r\n })\r\n } else if (S_PRIMITIVE in dynamicOptions) {\r\n var dynPrimitive = dynamicOptions[S_PRIMITIVE];\r\n return createDynamicDecl(dynPrimitive, function (env, scope) {\r\n var PRIM_TYPES = env.constants.primTypes;\r\n var prim = env.invoke(scope, dynPrimitive);\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n prim + ' in ' + PRIM_TYPES,\r\n 'invalid primitive, must be one of ' + Object.keys(primTypes));\r\n });\r\n return scope.def(PRIM_TYPES, '[', prim, ']')\r\n })\r\n } else if (elements) {\r\n if (isStatic(elements)) {\r\n if (elements.value) {\r\n return createStaticDecl(function (env, scope) {\r\n return scope.def(env.ELEMENTS, '.primType')\r\n })\r\n } else {\r\n return createStaticDecl(function () {\r\n return GL_TRIANGLES$1\r\n })\r\n }\r\n } else {\r\n return new Declaration(\r\n elements.thisDep,\r\n elements.contextDep,\r\n elements.propDep,\r\n function (env, scope) {\r\n var elements = env.ELEMENTS;\r\n return scope.def(elements, '?', elements, '.primType:', GL_TRIANGLES$1)\r\n })\r\n }\r\n }\r\n return null\r\n }\r\n\r\n function parseParam (param, isOffset) {\r\n if (param in staticOptions) {\r\n var value = staticOptions[param] | 0;\r\n check$1.command(!isOffset || value >= 0, 'invalid ' + param, env.commandStr);\r\n return createStaticDecl(function (env, scope) {\r\n if (isOffset) {\r\n env.OFFSET = value;\r\n }\r\n return value\r\n })\r\n } else if (param in dynamicOptions) {\r\n var dynValue = dynamicOptions[param];\r\n return createDynamicDecl(dynValue, function (env, scope) {\r\n var result = env.invoke(scope, dynValue);\r\n if (isOffset) {\r\n env.OFFSET = result;\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n result + '>=0',\r\n 'invalid ' + param);\r\n });\r\n }\r\n return result\r\n })\r\n } else if (isOffset && elements) {\r\n return createStaticDecl(function (env, scope) {\r\n env.OFFSET = '0';\r\n return 0\r\n })\r\n }\r\n return null\r\n }\r\n\r\n var OFFSET = parseParam(S_OFFSET, true);\r\n\r\n function parseVertCount () {\r\n if (S_COUNT in staticOptions) {\r\n var count = staticOptions[S_COUNT] | 0;\r\n check$1.command(\r\n typeof count === 'number' && count >= 0, 'invalid vertex count', env.commandStr);\r\n return createStaticDecl(function () {\r\n return count\r\n })\r\n } else if (S_COUNT in dynamicOptions) {\r\n var dynCount = dynamicOptions[S_COUNT];\r\n return createDynamicDecl(dynCount, function (env, scope) {\r\n var result = env.invoke(scope, dynCount);\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n 'typeof ' + result + '===\"number\"&&' +\r\n result + '>=0&&' +\r\n result + '===(' + result + '|0)',\r\n 'invalid vertex count');\r\n });\r\n return result\r\n })\r\n } else if (elements) {\r\n if (isStatic(elements)) {\r\n if (elements) {\r\n if (OFFSET) {\r\n return new Declaration(\r\n OFFSET.thisDep,\r\n OFFSET.contextDep,\r\n OFFSET.propDep,\r\n function (env, scope) {\r\n var result = scope.def(\r\n env.ELEMENTS, '.vertCount-', env.OFFSET);\r\n\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n result + '>=0',\r\n 'invalid vertex offset/element buffer too small');\r\n });\r\n\r\n return result\r\n })\r\n } else {\r\n return createStaticDecl(function (env, scope) {\r\n return scope.def(env.ELEMENTS, '.vertCount')\r\n })\r\n }\r\n } else {\r\n var result = createStaticDecl(function () {\r\n return -1\r\n });\r\n check$1.optional(function () {\r\n result.MISSING = true;\r\n });\r\n return result\r\n }\r\n } else {\r\n var variable = new Declaration(\r\n elements.thisDep || OFFSET.thisDep,\r\n elements.contextDep || OFFSET.contextDep,\r\n elements.propDep || OFFSET.propDep,\r\n function (env, scope) {\r\n var elements = env.ELEMENTS;\r\n if (env.OFFSET) {\r\n return scope.def(elements, '?', elements, '.vertCount-',\r\n env.OFFSET, ':-1')\r\n }\r\n return scope.def(elements, '?', elements, '.vertCount:-1')\r\n });\r\n check$1.optional(function () {\r\n variable.DYNAMIC = true;\r\n });\r\n return variable\r\n }\r\n }\r\n return null\r\n }\r\n\r\n return {\r\n elements: elements,\r\n primitive: parsePrimitive(),\r\n count: parseVertCount(),\r\n instances: parseParam(S_INSTANCES, false),\r\n offset: OFFSET\r\n }\r\n }\r\n\r\n function parseGLState (options, env) {\r\n var staticOptions = options.static;\r\n var dynamicOptions = options.dynamic;\r\n\r\n var STATE = {};\r\n\r\n GL_STATE_NAMES.forEach(function (prop) {\r\n var param = propName(prop);\r\n\r\n function parseParam (parseStatic, parseDynamic) {\r\n if (prop in staticOptions) {\r\n var value = parseStatic(staticOptions[prop]);\r\n STATE[param] = createStaticDecl(function () {\r\n return value\r\n });\r\n } else if (prop in dynamicOptions) {\r\n var dyn = dynamicOptions[prop];\r\n STATE[param] = createDynamicDecl(dyn, function (env, scope) {\r\n return parseDynamic(env, scope, env.invoke(scope, dyn))\r\n });\r\n }\r\n }\r\n\r\n switch (prop) {\r\n case S_CULL_ENABLE:\r\n case S_BLEND_ENABLE:\r\n case S_DITHER:\r\n case S_STENCIL_ENABLE:\r\n case S_DEPTH_ENABLE:\r\n case S_SCISSOR_ENABLE:\r\n case S_POLYGON_OFFSET_ENABLE:\r\n case S_SAMPLE_ALPHA:\r\n case S_SAMPLE_ENABLE:\r\n case S_DEPTH_MASK:\r\n return parseParam(\r\n function (value) {\r\n check$1.commandType(value, 'boolean', prop, env.commandStr);\r\n return value\r\n },\r\n function (env, scope, value) {\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n 'typeof ' + value + '===\"boolean\"',\r\n 'invalid flag ' + prop, env.commandStr);\r\n });\r\n return value\r\n })\r\n\r\n case S_DEPTH_FUNC:\r\n return parseParam(\r\n function (value) {\r\n check$1.commandParameter(value, compareFuncs, 'invalid ' + prop, env.commandStr);\r\n return compareFuncs[value]\r\n },\r\n function (env, scope, value) {\r\n var COMPARE_FUNCS = env.constants.compareFuncs;\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n value + ' in ' + COMPARE_FUNCS,\r\n 'invalid ' + prop + ', must be one of ' + Object.keys(compareFuncs));\r\n });\r\n return scope.def(COMPARE_FUNCS, '[', value, ']')\r\n })\r\n\r\n case S_DEPTH_RANGE:\r\n return parseParam(\r\n function (value) {\r\n check$1.command(\r\n isArrayLike(value) &&\r\n value.length === 2 &&\r\n typeof value[0] === 'number' &&\r\n typeof value[1] === 'number' &&\r\n value[0] <= value[1],\r\n 'depth range is 2d array',\r\n env.commandStr);\r\n return value\r\n },\r\n function (env, scope, value) {\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n env.shared.isArrayLike + '(' + value + ')&&' +\r\n value + '.length===2&&' +\r\n 'typeof ' + value + '[0]===\"number\"&&' +\r\n 'typeof ' + value + '[1]===\"number\"&&' +\r\n value + '[0]<=' + value + '[1]',\r\n 'depth range must be a 2d array');\r\n });\r\n\r\n var Z_NEAR = scope.def('+', value, '[0]');\r\n var Z_FAR = scope.def('+', value, '[1]');\r\n return [Z_NEAR, Z_FAR]\r\n })\r\n\r\n case S_BLEND_FUNC:\r\n return parseParam(\r\n function (value) {\r\n check$1.commandType(value, 'object', 'blend.func', env.commandStr);\r\n var srcRGB = ('srcRGB' in value ? value.srcRGB : value.src);\r\n var srcAlpha = ('srcAlpha' in value ? value.srcAlpha : value.src);\r\n var dstRGB = ('dstRGB' in value ? value.dstRGB : value.dst);\r\n var dstAlpha = ('dstAlpha' in value ? value.dstAlpha : value.dst);\r\n check$1.commandParameter(srcRGB, blendFuncs, param + '.srcRGB', env.commandStr);\r\n check$1.commandParameter(srcAlpha, blendFuncs, param + '.srcAlpha', env.commandStr);\r\n check$1.commandParameter(dstRGB, blendFuncs, param + '.dstRGB', env.commandStr);\r\n check$1.commandParameter(dstAlpha, blendFuncs, param + '.dstAlpha', env.commandStr);\r\n\r\n check$1.command(\r\n (invalidBlendCombinations.indexOf(srcRGB + ', ' + dstRGB) === -1),\r\n 'unallowed blending combination (srcRGB, dstRGB) = (' + srcRGB + ', ' + dstRGB + ')', env.commandStr);\r\n\r\n return [\r\n blendFuncs[srcRGB],\r\n blendFuncs[dstRGB],\r\n blendFuncs[srcAlpha],\r\n blendFuncs[dstAlpha]\r\n ]\r\n },\r\n function (env, scope, value) {\r\n var BLEND_FUNCS = env.constants.blendFuncs;\r\n\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n value + '&&typeof ' + value + '===\"object\"',\r\n 'invalid blend func, must be an object');\r\n });\r\n\r\n function read (prefix, suffix) {\r\n var func = scope.def(\r\n '\"', prefix, suffix, '\" in ', value,\r\n '?', value, '.', prefix, suffix,\r\n ':', value, '.', prefix);\r\n\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n func + ' in ' + BLEND_FUNCS,\r\n 'invalid ' + prop + '.' + prefix + suffix + ', must be one of ' + Object.keys(blendFuncs));\r\n });\r\n\r\n return func\r\n }\r\n\r\n var srcRGB = read('src', 'RGB');\r\n var dstRGB = read('dst', 'RGB');\r\n\r\n check$1.optional(function () {\r\n var INVALID_BLEND_COMBINATIONS = env.constants.invalidBlendCombinations;\r\n\r\n env.assert(scope,\r\n INVALID_BLEND_COMBINATIONS +\r\n '.indexOf(' + srcRGB + '+\", \"+' + dstRGB + ') === -1 ',\r\n 'unallowed blending combination for (srcRGB, dstRGB)'\r\n );\r\n });\r\n\r\n var SRC_RGB = scope.def(BLEND_FUNCS, '[', srcRGB, ']');\r\n var SRC_ALPHA = scope.def(BLEND_FUNCS, '[', read('src', 'Alpha'), ']');\r\n var DST_RGB = scope.def(BLEND_FUNCS, '[', dstRGB, ']');\r\n var DST_ALPHA = scope.def(BLEND_FUNCS, '[', read('dst', 'Alpha'), ']');\r\n\r\n return [SRC_RGB, DST_RGB, SRC_ALPHA, DST_ALPHA]\r\n })\r\n\r\n case S_BLEND_EQUATION:\r\n return parseParam(\r\n function (value) {\r\n if (typeof value === 'string') {\r\n check$1.commandParameter(value, blendEquations, 'invalid ' + prop, env.commandStr);\r\n return [\r\n blendEquations[value],\r\n blendEquations[value]\r\n ]\r\n } else if (typeof value === 'object') {\r\n check$1.commandParameter(\r\n value.rgb, blendEquations, prop + '.rgb', env.commandStr);\r\n check$1.commandParameter(\r\n value.alpha, blendEquations, prop + '.alpha', env.commandStr);\r\n return [\r\n blendEquations[value.rgb],\r\n blendEquations[value.alpha]\r\n ]\r\n } else {\r\n check$1.commandRaise('invalid blend.equation', env.commandStr);\r\n }\r\n },\r\n function (env, scope, value) {\r\n var BLEND_EQUATIONS = env.constants.blendEquations;\r\n\r\n var RGB = scope.def();\r\n var ALPHA = scope.def();\r\n\r\n var ifte = env.cond('typeof ', value, '===\"string\"');\r\n\r\n check$1.optional(function () {\r\n function checkProp (block, name, value) {\r\n env.assert(block,\r\n value + ' in ' + BLEND_EQUATIONS,\r\n 'invalid ' + name + ', must be one of ' + Object.keys(blendEquations));\r\n }\r\n checkProp(ifte.then, prop, value);\r\n\r\n env.assert(ifte.else,\r\n value + '&&typeof ' + value + '===\"object\"',\r\n 'invalid ' + prop);\r\n checkProp(ifte.else, prop + '.rgb', value + '.rgb');\r\n checkProp(ifte.else, prop + '.alpha', value + '.alpha');\r\n });\r\n\r\n ifte.then(\r\n RGB, '=', ALPHA, '=', BLEND_EQUATIONS, '[', value, '];');\r\n ifte.else(\r\n RGB, '=', BLEND_EQUATIONS, '[', value, '.rgb];',\r\n ALPHA, '=', BLEND_EQUATIONS, '[', value, '.alpha];');\r\n\r\n scope(ifte);\r\n\r\n return [RGB, ALPHA]\r\n })\r\n\r\n case S_BLEND_COLOR:\r\n return parseParam(\r\n function (value) {\r\n check$1.command(\r\n isArrayLike(value) &&\r\n value.length === 4,\r\n 'blend.color must be a 4d array', env.commandStr);\r\n return loop(4, function (i) {\r\n return +value[i]\r\n })\r\n },\r\n function (env, scope, value) {\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n env.shared.isArrayLike + '(' + value + ')&&' +\r\n value + '.length===4',\r\n 'blend.color must be a 4d array');\r\n });\r\n return loop(4, function (i) {\r\n return scope.def('+', value, '[', i, ']')\r\n })\r\n })\r\n\r\n case S_STENCIL_MASK:\r\n return parseParam(\r\n function (value) {\r\n check$1.commandType(value, 'number', param, env.commandStr);\r\n return value | 0\r\n },\r\n function (env, scope, value) {\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n 'typeof ' + value + '===\"number\"',\r\n 'invalid stencil.mask');\r\n });\r\n return scope.def(value, '|0')\r\n })\r\n\r\n case S_STENCIL_FUNC:\r\n return parseParam(\r\n function (value) {\r\n check$1.commandType(value, 'object', param, env.commandStr);\r\n var cmp = value.cmp || 'keep';\r\n var ref = value.ref || 0;\r\n var mask = 'mask' in value ? value.mask : -1;\r\n check$1.commandParameter(cmp, compareFuncs, prop + '.cmp', env.commandStr);\r\n check$1.commandType(ref, 'number', prop + '.ref', env.commandStr);\r\n check$1.commandType(mask, 'number', prop + '.mask', env.commandStr);\r\n return [\r\n compareFuncs[cmp],\r\n ref,\r\n mask\r\n ]\r\n },\r\n function (env, scope, value) {\r\n var COMPARE_FUNCS = env.constants.compareFuncs;\r\n check$1.optional(function () {\r\n function assert () {\r\n env.assert(scope,\r\n Array.prototype.join.call(arguments, ''),\r\n 'invalid stencil.func');\r\n }\r\n assert(value + '&&typeof ', value, '===\"object\"');\r\n assert('!(\"cmp\" in ', value, ')||(',\r\n value, '.cmp in ', COMPARE_FUNCS, ')');\r\n });\r\n var cmp = scope.def(\r\n '\"cmp\" in ', value,\r\n '?', COMPARE_FUNCS, '[', value, '.cmp]',\r\n ':', GL_KEEP);\r\n var ref = scope.def(value, '.ref|0');\r\n var mask = scope.def(\r\n '\"mask\" in ', value,\r\n '?', value, '.mask|0:-1');\r\n return [cmp, ref, mask]\r\n })\r\n\r\n case S_STENCIL_OPFRONT:\r\n case S_STENCIL_OPBACK:\r\n return parseParam(\r\n function (value) {\r\n check$1.commandType(value, 'object', param, env.commandStr);\r\n var fail = value.fail || 'keep';\r\n var zfail = value.zfail || 'keep';\r\n var zpass = value.zpass || 'keep';\r\n check$1.commandParameter(fail, stencilOps, prop + '.fail', env.commandStr);\r\n check$1.commandParameter(zfail, stencilOps, prop + '.zfail', env.commandStr);\r\n check$1.commandParameter(zpass, stencilOps, prop + '.zpass', env.commandStr);\r\n return [\r\n prop === S_STENCIL_OPBACK ? GL_BACK : GL_FRONT,\r\n stencilOps[fail],\r\n stencilOps[zfail],\r\n stencilOps[zpass]\r\n ]\r\n },\r\n function (env, scope, value) {\r\n var STENCIL_OPS = env.constants.stencilOps;\r\n\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n value + '&&typeof ' + value + '===\"object\"',\r\n 'invalid ' + prop);\r\n });\r\n\r\n function read (name) {\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n '!(\"' + name + '\" in ' + value + ')||' +\r\n '(' + value + '.' + name + ' in ' + STENCIL_OPS + ')',\r\n 'invalid ' + prop + '.' + name + ', must be one of ' + Object.keys(stencilOps));\r\n });\r\n\r\n return scope.def(\r\n '\"', name, '\" in ', value,\r\n '?', STENCIL_OPS, '[', value, '.', name, ']:',\r\n GL_KEEP)\r\n }\r\n\r\n return [\r\n prop === S_STENCIL_OPBACK ? GL_BACK : GL_FRONT,\r\n read('fail'),\r\n read('zfail'),\r\n read('zpass')\r\n ]\r\n })\r\n\r\n case S_POLYGON_OFFSET_OFFSET:\r\n return parseParam(\r\n function (value) {\r\n check$1.commandType(value, 'object', param, env.commandStr);\r\n var factor = value.factor | 0;\r\n var units = value.units | 0;\r\n check$1.commandType(factor, 'number', param + '.factor', env.commandStr);\r\n check$1.commandType(units, 'number', param + '.units', env.commandStr);\r\n return [factor, units]\r\n },\r\n function (env, scope, value) {\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n value + '&&typeof ' + value + '===\"object\"',\r\n 'invalid ' + prop);\r\n });\r\n\r\n var FACTOR = scope.def(value, '.factor|0');\r\n var UNITS = scope.def(value, '.units|0');\r\n\r\n return [FACTOR, UNITS]\r\n })\r\n\r\n case S_CULL_FACE:\r\n return parseParam(\r\n function (value) {\r\n var face = 0;\r\n if (value === 'front') {\r\n face = GL_FRONT;\r\n } else if (value === 'back') {\r\n face = GL_BACK;\r\n }\r\n check$1.command(!!face, param, env.commandStr);\r\n return face\r\n },\r\n function (env, scope, value) {\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n value + '===\"front\"||' +\r\n value + '===\"back\"',\r\n 'invalid cull.face');\r\n });\r\n return scope.def(value, '===\"front\"?', GL_FRONT, ':', GL_BACK)\r\n })\r\n\r\n case S_LINE_WIDTH:\r\n return parseParam(\r\n function (value) {\r\n check$1.command(\r\n typeof value === 'number' &&\r\n value >= limits.lineWidthDims[0] &&\r\n value <= limits.lineWidthDims[1],\r\n 'invalid line width, must be a positive number between ' +\r\n limits.lineWidthDims[0] + ' and ' + limits.lineWidthDims[1], env.commandStr);\r\n return value\r\n },\r\n function (env, scope, value) {\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n 'typeof ' + value + '===\"number\"&&' +\r\n value + '>=' + limits.lineWidthDims[0] + '&&' +\r\n value + '<=' + limits.lineWidthDims[1],\r\n 'invalid line width');\r\n });\r\n\r\n return value\r\n })\r\n\r\n case S_FRONT_FACE:\r\n return parseParam(\r\n function (value) {\r\n check$1.commandParameter(value, orientationType, param, env.commandStr);\r\n return orientationType[value]\r\n },\r\n function (env, scope, value) {\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n value + '===\"cw\"||' +\r\n value + '===\"ccw\"',\r\n 'invalid frontFace, must be one of cw,ccw');\r\n });\r\n return scope.def(value + '===\"cw\"?' + GL_CW + ':' + GL_CCW)\r\n })\r\n\r\n case S_COLOR_MASK:\r\n return parseParam(\r\n function (value) {\r\n check$1.command(\r\n isArrayLike(value) && value.length === 4,\r\n 'color.mask must be length 4 array', env.commandStr);\r\n return value.map(function (v) { return !!v })\r\n },\r\n function (env, scope, value) {\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n env.shared.isArrayLike + '(' + value + ')&&' +\r\n value + '.length===4',\r\n 'invalid color.mask');\r\n });\r\n return loop(4, function (i) {\r\n return '!!' + value + '[' + i + ']'\r\n })\r\n })\r\n\r\n case S_SAMPLE_COVERAGE:\r\n return parseParam(\r\n function (value) {\r\n check$1.command(typeof value === 'object' && value, param, env.commandStr);\r\n var sampleValue = 'value' in value ? value.value : 1;\r\n var sampleInvert = !!value.invert;\r\n check$1.command(\r\n typeof sampleValue === 'number' &&\r\n sampleValue >= 0 && sampleValue <= 1,\r\n 'sample.coverage.value must be a number between 0 and 1', env.commandStr);\r\n return [sampleValue, sampleInvert]\r\n },\r\n function (env, scope, value) {\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n value + '&&typeof ' + value + '===\"object\"',\r\n 'invalid sample.coverage');\r\n });\r\n var VALUE = scope.def(\r\n '\"value\" in ', value, '?+', value, '.value:1');\r\n var INVERT = scope.def('!!', value, '.invert');\r\n return [VALUE, INVERT]\r\n })\r\n }\r\n });\r\n\r\n return STATE\r\n }\r\n\r\n function parseUniforms (uniforms, env) {\r\n var staticUniforms = uniforms.static;\r\n var dynamicUniforms = uniforms.dynamic;\r\n\r\n var UNIFORMS = {};\r\n\r\n Object.keys(staticUniforms).forEach(function (name) {\r\n var value = staticUniforms[name];\r\n var result;\r\n if (typeof value === 'number' ||\r\n typeof value === 'boolean') {\r\n result = createStaticDecl(function () {\r\n return value\r\n });\r\n } else if (typeof value === 'function') {\r\n var reglType = value._reglType;\r\n if (reglType === 'texture2d' ||\r\n reglType === 'textureCube') {\r\n result = createStaticDecl(function (env) {\r\n return env.link(value)\r\n });\r\n } else if (reglType === 'framebuffer' ||\r\n reglType === 'framebufferCube') {\r\n check$1.command(value.color.length > 0,\r\n 'missing color attachment for framebuffer sent to uniform \"' + name + '\"', env.commandStr);\r\n result = createStaticDecl(function (env) {\r\n return env.link(value.color[0])\r\n });\r\n } else {\r\n check$1.commandRaise('invalid data for uniform \"' + name + '\"', env.commandStr);\r\n }\r\n } else if (isArrayLike(value)) {\r\n result = createStaticDecl(function (env) {\r\n var ITEM = env.global.def('[',\r\n loop(value.length, function (i) {\r\n check$1.command(\r\n typeof value[i] === 'number' ||\r\n typeof value[i] === 'boolean',\r\n 'invalid uniform ' + name, env.commandStr);\r\n return value[i]\r\n }), ']');\r\n return ITEM\r\n });\r\n } else {\r\n check$1.commandRaise('invalid or missing data for uniform \"' + name + '\"', env.commandStr);\r\n }\r\n result.value = value;\r\n UNIFORMS[name] = result;\r\n });\r\n\r\n Object.keys(dynamicUniforms).forEach(function (key) {\r\n var dyn = dynamicUniforms[key];\r\n UNIFORMS[key] = createDynamicDecl(dyn, function (env, scope) {\r\n return env.invoke(scope, dyn)\r\n });\r\n });\r\n\r\n return UNIFORMS\r\n }\r\n\r\n function parseAttributes (attributes, env) {\r\n var staticAttributes = attributes.static;\r\n var dynamicAttributes = attributes.dynamic;\r\n\r\n var attributeDefs = {};\r\n\r\n Object.keys(staticAttributes).forEach(function (attribute) {\r\n var value = staticAttributes[attribute];\r\n var id = stringStore.id(attribute);\r\n\r\n var record = new AttributeRecord();\r\n if (isBufferArgs(value)) {\r\n record.state = ATTRIB_STATE_POINTER;\r\n record.buffer = bufferState.getBuffer(\r\n bufferState.create(value, GL_ARRAY_BUFFER$1, false, true));\r\n record.type = 0;\r\n } else {\r\n var buffer = bufferState.getBuffer(value);\r\n if (buffer) {\r\n record.state = ATTRIB_STATE_POINTER;\r\n record.buffer = buffer;\r\n record.type = 0;\r\n } else {\r\n check$1.command(typeof value === 'object' && value,\r\n 'invalid data for attribute ' + attribute, env.commandStr);\r\n if ('constant' in value) {\r\n var constant = value.constant;\r\n record.buffer = 'null';\r\n record.state = ATTRIB_STATE_CONSTANT;\r\n if (typeof constant === 'number') {\r\n record.x = constant;\r\n } else {\r\n check$1.command(\r\n isArrayLike(constant) &&\r\n constant.length > 0 &&\r\n constant.length <= 4,\r\n 'invalid constant for attribute ' + attribute, env.commandStr);\r\n CUTE_COMPONENTS.forEach(function (c, i) {\r\n if (i < constant.length) {\r\n record[c] = constant[i];\r\n }\r\n });\r\n }\r\n } else {\r\n if (isBufferArgs(value.buffer)) {\r\n buffer = bufferState.getBuffer(\r\n bufferState.create(value.buffer, GL_ARRAY_BUFFER$1, false, true));\r\n } else {\r\n buffer = bufferState.getBuffer(value.buffer);\r\n }\r\n check$1.command(!!buffer, 'missing buffer for attribute \"' + attribute + '\"', env.commandStr);\r\n\r\n var offset = value.offset | 0;\r\n check$1.command(offset >= 0,\r\n 'invalid offset for attribute \"' + attribute + '\"', env.commandStr);\r\n\r\n var stride = value.stride | 0;\r\n check$1.command(stride >= 0 && stride < 256,\r\n 'invalid stride for attribute \"' + attribute + '\", must be integer betweeen [0, 255]', env.commandStr);\r\n\r\n var size = value.size | 0;\r\n check$1.command(!('size' in value) || (size > 0 && size <= 4),\r\n 'invalid size for attribute \"' + attribute + '\", must be 1,2,3,4', env.commandStr);\r\n\r\n var normalized = !!value.normalized;\r\n\r\n var type = 0;\r\n if ('type' in value) {\r\n check$1.commandParameter(\r\n value.type, glTypes,\r\n 'invalid type for attribute ' + attribute, env.commandStr);\r\n type = glTypes[value.type];\r\n }\r\n\r\n var divisor = value.divisor | 0;\r\n if ('divisor' in value) {\r\n check$1.command(divisor === 0 || extInstancing,\r\n 'cannot specify divisor for attribute \"' + attribute + '\", instancing not supported', env.commandStr);\r\n check$1.command(divisor >= 0,\r\n 'invalid divisor for attribute \"' + attribute + '\"', env.commandStr);\r\n }\r\n\r\n check$1.optional(function () {\r\n var command = env.commandStr;\r\n\r\n var VALID_KEYS = [\r\n 'buffer',\r\n 'offset',\r\n 'divisor',\r\n 'normalized',\r\n 'type',\r\n 'size',\r\n 'stride'\r\n ];\r\n\r\n Object.keys(value).forEach(function (prop) {\r\n check$1.command(\r\n VALID_KEYS.indexOf(prop) >= 0,\r\n 'unknown parameter \"' + prop + '\" for attribute pointer \"' + attribute + '\" (valid parameters are ' + VALID_KEYS + ')',\r\n command);\r\n });\r\n });\r\n\r\n record.buffer = buffer;\r\n record.state = ATTRIB_STATE_POINTER;\r\n record.size = size;\r\n record.normalized = normalized;\r\n record.type = type || buffer.dtype;\r\n record.offset = offset;\r\n record.stride = stride;\r\n record.divisor = divisor;\r\n }\r\n }\r\n }\r\n\r\n attributeDefs[attribute] = createStaticDecl(function (env, scope) {\r\n var cache = env.attribCache;\r\n if (id in cache) {\r\n return cache[id]\r\n }\r\n var result = {\r\n isStream: false\r\n };\r\n Object.keys(record).forEach(function (key) {\r\n result[key] = record[key];\r\n });\r\n if (record.buffer) {\r\n result.buffer = env.link(record.buffer);\r\n result.type = result.type || (result.buffer + '.dtype');\r\n }\r\n cache[id] = result;\r\n return result\r\n });\r\n });\r\n\r\n Object.keys(dynamicAttributes).forEach(function (attribute) {\r\n var dyn = dynamicAttributes[attribute];\r\n\r\n function appendAttributeCode (env, block) {\r\n var VALUE = env.invoke(block, dyn);\r\n\r\n var shared = env.shared;\r\n\r\n var IS_BUFFER_ARGS = shared.isBufferArgs;\r\n var BUFFER_STATE = shared.buffer;\r\n\r\n // Perform validation on attribute\r\n check$1.optional(function () {\r\n env.assert(block,\r\n VALUE + '&&(typeof ' + VALUE + '===\"object\"||typeof ' +\r\n VALUE + '===\"function\")&&(' +\r\n IS_BUFFER_ARGS + '(' + VALUE + ')||' +\r\n BUFFER_STATE + '.getBuffer(' + VALUE + ')||' +\r\n BUFFER_STATE + '.getBuffer(' + VALUE + '.buffer)||' +\r\n IS_BUFFER_ARGS + '(' + VALUE + '.buffer)||' +\r\n '(\"constant\" in ' + VALUE +\r\n '&&(typeof ' + VALUE + '.constant===\"number\"||' +\r\n shared.isArrayLike + '(' + VALUE + '.constant))))',\r\n 'invalid dynamic attribute \"' + attribute + '\"');\r\n });\r\n\r\n // allocate names for result\r\n var result = {\r\n isStream: block.def(false)\r\n };\r\n var defaultRecord = new AttributeRecord();\r\n defaultRecord.state = ATTRIB_STATE_POINTER;\r\n Object.keys(defaultRecord).forEach(function (key) {\r\n result[key] = block.def('' + defaultRecord[key]);\r\n });\r\n\r\n var BUFFER = result.buffer;\r\n var TYPE = result.type;\r\n block(\r\n 'if(', IS_BUFFER_ARGS, '(', VALUE, ')){',\r\n result.isStream, '=true;',\r\n BUFFER, '=', BUFFER_STATE, '.createStream(', GL_ARRAY_BUFFER$1, ',', VALUE, ');',\r\n TYPE, '=', BUFFER, '.dtype;',\r\n '}else{',\r\n BUFFER, '=', BUFFER_STATE, '.getBuffer(', VALUE, ');',\r\n 'if(', BUFFER, '){',\r\n TYPE, '=', BUFFER, '.dtype;',\r\n '}else if(\"constant\" in ', VALUE, '){',\r\n result.state, '=', ATTRIB_STATE_CONSTANT, ';',\r\n 'if(typeof ' + VALUE + '.constant === \"number\"){',\r\n result[CUTE_COMPONENTS[0]], '=', VALUE, '.constant;',\r\n CUTE_COMPONENTS.slice(1).map(function (n) {\r\n return result[n]\r\n }).join('='), '=0;',\r\n '}else{',\r\n CUTE_COMPONENTS.map(function (name, i) {\r\n return (\r\n result[name] + '=' + VALUE + '.constant.length>' + i +\r\n '?' + VALUE + '.constant[' + i + ']:0;'\r\n )\r\n }).join(''),\r\n '}}else{',\r\n 'if(', IS_BUFFER_ARGS, '(', VALUE, '.buffer)){',\r\n BUFFER, '=', BUFFER_STATE, '.createStream(', GL_ARRAY_BUFFER$1, ',', VALUE, '.buffer);',\r\n '}else{',\r\n BUFFER, '=', BUFFER_STATE, '.getBuffer(', VALUE, '.buffer);',\r\n '}',\r\n TYPE, '=\"type\" in ', VALUE, '?',\r\n shared.glTypes, '[', VALUE, '.type]:', BUFFER, '.dtype;',\r\n result.normalized, '=!!', VALUE, '.normalized;');\r\n function emitReadRecord (name) {\r\n block(result[name], '=', VALUE, '.', name, '|0;');\r\n }\r\n emitReadRecord('size');\r\n emitReadRecord('offset');\r\n emitReadRecord('stride');\r\n emitReadRecord('divisor');\r\n\r\n block('}}');\r\n\r\n block.exit(\r\n 'if(', result.isStream, '){',\r\n BUFFER_STATE, '.destroyStream(', BUFFER, ');',\r\n '}');\r\n\r\n return result\r\n }\r\n\r\n attributeDefs[attribute] = createDynamicDecl(dyn, appendAttributeCode);\r\n });\r\n\r\n return attributeDefs\r\n }\r\n\r\n function parseContext (context) {\r\n var staticContext = context.static;\r\n var dynamicContext = context.dynamic;\r\n var result = {};\r\n\r\n Object.keys(staticContext).forEach(function (name) {\r\n var value = staticContext[name];\r\n result[name] = createStaticDecl(function (env, scope) {\r\n if (typeof value === 'number' || typeof value === 'boolean') {\r\n return '' + value\r\n } else {\r\n return env.link(value)\r\n }\r\n });\r\n });\r\n\r\n Object.keys(dynamicContext).forEach(function (name) {\r\n var dyn = dynamicContext[name];\r\n result[name] = createDynamicDecl(dyn, function (env, scope) {\r\n return env.invoke(scope, dyn)\r\n });\r\n });\r\n\r\n return result\r\n }\r\n\r\n function parseArguments (options, attributes, uniforms, context, env) {\r\n var staticOptions = options.static;\r\n var dynamicOptions = options.dynamic;\r\n\r\n check$1.optional(function () {\r\n var KEY_NAMES = [\r\n S_FRAMEBUFFER,\r\n S_VERT,\r\n S_FRAG,\r\n S_ELEMENTS,\r\n S_PRIMITIVE,\r\n S_OFFSET,\r\n S_COUNT,\r\n S_INSTANCES,\r\n S_PROFILE\r\n ].concat(GL_STATE_NAMES);\r\n\r\n function checkKeys (dict) {\r\n Object.keys(dict).forEach(function (key) {\r\n check$1.command(\r\n KEY_NAMES.indexOf(key) >= 0,\r\n 'unknown parameter \"' + key + '\"',\r\n env.commandStr);\r\n });\r\n }\r\n\r\n checkKeys(staticOptions);\r\n checkKeys(dynamicOptions);\r\n });\r\n\r\n var framebuffer = parseFramebuffer(options, env);\r\n var viewportAndScissor = parseViewportScissor(options, framebuffer, env);\r\n var draw = parseDraw(options, env);\r\n var state = parseGLState(options, env);\r\n var shader = parseProgram(options, env);\r\n\r\n function copyBox (name) {\r\n var defn = viewportAndScissor[name];\r\n if (defn) {\r\n state[name] = defn;\r\n }\r\n }\r\n copyBox(S_VIEWPORT);\r\n copyBox(propName(S_SCISSOR_BOX));\r\n\r\n var dirty = Object.keys(state).length > 0;\r\n\r\n var result = {\r\n framebuffer: framebuffer,\r\n draw: draw,\r\n shader: shader,\r\n state: state,\r\n dirty: dirty\r\n };\r\n\r\n result.profile = parseProfile(options, env);\r\n result.uniforms = parseUniforms(uniforms, env);\r\n result.attributes = parseAttributes(attributes, env);\r\n result.context = parseContext(context, env);\r\n return result\r\n }\r\n\r\n // ===================================================\r\n // ===================================================\r\n // COMMON UPDATE FUNCTIONS\r\n // ===================================================\r\n // ===================================================\r\n function emitContext (env, scope, context) {\r\n var shared = env.shared;\r\n var CONTEXT = shared.context;\r\n\r\n var contextEnter = env.scope();\r\n\r\n Object.keys(context).forEach(function (name) {\r\n scope.save(CONTEXT, '.' + name);\r\n var defn = context[name];\r\n contextEnter(CONTEXT, '.', name, '=', defn.append(env, scope), ';');\r\n });\r\n\r\n scope(contextEnter);\r\n }\r\n\r\n // ===================================================\r\n // ===================================================\r\n // COMMON DRAWING FUNCTIONS\r\n // ===================================================\r\n // ===================================================\r\n function emitPollFramebuffer (env, scope, framebuffer, skipCheck) {\r\n var shared = env.shared;\r\n\r\n var GL = shared.gl;\r\n var FRAMEBUFFER_STATE = shared.framebuffer;\r\n var EXT_DRAW_BUFFERS;\r\n if (extDrawBuffers) {\r\n EXT_DRAW_BUFFERS = scope.def(shared.extensions, '.webgl_draw_buffers');\r\n }\r\n\r\n var constants = env.constants;\r\n\r\n var DRAW_BUFFERS = constants.drawBuffer;\r\n var BACK_BUFFER = constants.backBuffer;\r\n\r\n var NEXT;\r\n if (framebuffer) {\r\n NEXT = framebuffer.append(env, scope);\r\n } else {\r\n NEXT = scope.def(FRAMEBUFFER_STATE, '.next');\r\n }\r\n\r\n if (!skipCheck) {\r\n scope('if(', NEXT, '!==', FRAMEBUFFER_STATE, '.cur){');\r\n }\r\n scope(\r\n 'if(', NEXT, '){',\r\n GL, '.bindFramebuffer(', GL_FRAMEBUFFER$2, ',', NEXT, '.framebuffer);');\r\n if (extDrawBuffers) {\r\n scope(EXT_DRAW_BUFFERS, '.drawBuffersWEBGL(',\r\n DRAW_BUFFERS, '[', NEXT, '.colorAttachments.length]);');\r\n }\r\n scope('}else{',\r\n GL, '.bindFramebuffer(', GL_FRAMEBUFFER$2, ',null);');\r\n if (extDrawBuffers) {\r\n scope(EXT_DRAW_BUFFERS, '.drawBuffersWEBGL(', BACK_BUFFER, ');');\r\n }\r\n scope(\r\n '}',\r\n FRAMEBUFFER_STATE, '.cur=', NEXT, ';');\r\n if (!skipCheck) {\r\n scope('}');\r\n }\r\n }\r\n\r\n function emitPollState (env, scope, args) {\r\n var shared = env.shared;\r\n\r\n var GL = shared.gl;\r\n\r\n var CURRENT_VARS = env.current;\r\n var NEXT_VARS = env.next;\r\n var CURRENT_STATE = shared.current;\r\n var NEXT_STATE = shared.next;\r\n\r\n var block = env.cond(CURRENT_STATE, '.dirty');\r\n\r\n GL_STATE_NAMES.forEach(function (prop) {\r\n var param = propName(prop);\r\n if (param in args.state) {\r\n return\r\n }\r\n\r\n var NEXT, CURRENT;\r\n if (param in NEXT_VARS) {\r\n NEXT = NEXT_VARS[param];\r\n CURRENT = CURRENT_VARS[param];\r\n var parts = loop(currentState[param].length, function (i) {\r\n return block.def(NEXT, '[', i, ']')\r\n });\r\n block(env.cond(parts.map(function (p, i) {\r\n return p + '!==' + CURRENT + '[' + i + ']'\r\n }).join('||'))\r\n .then(\r\n GL, '.', GL_VARIABLES[param], '(', parts, ');',\r\n parts.map(function (p, i) {\r\n return CURRENT + '[' + i + ']=' + p\r\n }).join(';'), ';'));\r\n } else {\r\n NEXT = block.def(NEXT_STATE, '.', param);\r\n var ifte = env.cond(NEXT, '!==', CURRENT_STATE, '.', param);\r\n block(ifte);\r\n if (param in GL_FLAGS) {\r\n ifte(\r\n env.cond(NEXT)\r\n .then(GL, '.enable(', GL_FLAGS[param], ');')\r\n .else(GL, '.disable(', GL_FLAGS[param], ');'),\r\n CURRENT_STATE, '.', param, '=', NEXT, ';');\r\n } else {\r\n ifte(\r\n GL, '.', GL_VARIABLES[param], '(', NEXT, ');',\r\n CURRENT_STATE, '.', param, '=', NEXT, ';');\r\n }\r\n }\r\n });\r\n if (Object.keys(args.state).length === 0) {\r\n block(CURRENT_STATE, '.dirty=false;');\r\n }\r\n scope(block);\r\n }\r\n\r\n function emitSetOptions (env, scope, options, filter) {\r\n var shared = env.shared;\r\n var CURRENT_VARS = env.current;\r\n var CURRENT_STATE = shared.current;\r\n var GL = shared.gl;\r\n sortState(Object.keys(options)).forEach(function (param) {\r\n var defn = options[param];\r\n if (filter && !filter(defn)) {\r\n return\r\n }\r\n var variable = defn.append(env, scope);\r\n if (GL_FLAGS[param]) {\r\n var flag = GL_FLAGS[param];\r\n if (isStatic(defn)) {\r\n if (variable) {\r\n scope(GL, '.enable(', flag, ');');\r\n } else {\r\n scope(GL, '.disable(', flag, ');');\r\n }\r\n } else {\r\n scope(env.cond(variable)\r\n .then(GL, '.enable(', flag, ');')\r\n .else(GL, '.disable(', flag, ');'));\r\n }\r\n scope(CURRENT_STATE, '.', param, '=', variable, ';');\r\n } else if (isArrayLike(variable)) {\r\n var CURRENT = CURRENT_VARS[param];\r\n scope(\r\n GL, '.', GL_VARIABLES[param], '(', variable, ');',\r\n variable.map(function (v, i) {\r\n return CURRENT + '[' + i + ']=' + v\r\n }).join(';'), ';');\r\n } else {\r\n scope(\r\n GL, '.', GL_VARIABLES[param], '(', variable, ');',\r\n CURRENT_STATE, '.', param, '=', variable, ';');\r\n }\r\n });\r\n }\r\n\r\n function injectExtensions (env, scope) {\r\n if (extInstancing) {\r\n env.instancing = scope.def(\r\n env.shared.extensions, '.angle_instanced_arrays');\r\n }\r\n }\r\n\r\n function emitProfile (env, scope, args, useScope, incrementCounter) {\r\n var shared = env.shared;\r\n var STATS = env.stats;\r\n var CURRENT_STATE = shared.current;\r\n var TIMER = shared.timer;\r\n var profileArg = args.profile;\r\n\r\n function perfCounter () {\r\n if (typeof performance === 'undefined') {\r\n return 'Date.now()'\r\n } else {\r\n return 'performance.now()'\r\n }\r\n }\r\n\r\n var CPU_START, QUERY_COUNTER;\r\n function emitProfileStart (block) {\r\n CPU_START = scope.def();\r\n block(CPU_START, '=', perfCounter(), ';');\r\n if (typeof incrementCounter === 'string') {\r\n block(STATS, '.count+=', incrementCounter, ';');\r\n } else {\r\n block(STATS, '.count++;');\r\n }\r\n if (timer) {\r\n if (useScope) {\r\n QUERY_COUNTER = scope.def();\r\n block(QUERY_COUNTER, '=', TIMER, '.getNumPendingQueries();');\r\n } else {\r\n block(TIMER, '.beginQuery(', STATS, ');');\r\n }\r\n }\r\n }\r\n\r\n function emitProfileEnd (block) {\r\n block(STATS, '.cpuTime+=', perfCounter(), '-', CPU_START, ';');\r\n if (timer) {\r\n if (useScope) {\r\n block(TIMER, '.pushScopeStats(',\r\n QUERY_COUNTER, ',',\r\n TIMER, '.getNumPendingQueries(),',\r\n STATS, ');');\r\n } else {\r\n block(TIMER, '.endQuery();');\r\n }\r\n }\r\n }\r\n\r\n function scopeProfile (value) {\r\n var prev = scope.def(CURRENT_STATE, '.profile');\r\n scope(CURRENT_STATE, '.profile=', value, ';');\r\n scope.exit(CURRENT_STATE, '.profile=', prev, ';');\r\n }\r\n\r\n var USE_PROFILE;\r\n if (profileArg) {\r\n if (isStatic(profileArg)) {\r\n if (profileArg.enable) {\r\n emitProfileStart(scope);\r\n emitProfileEnd(scope.exit);\r\n scopeProfile('true');\r\n } else {\r\n scopeProfile('false');\r\n }\r\n return\r\n }\r\n USE_PROFILE = profileArg.append(env, scope);\r\n scopeProfile(USE_PROFILE);\r\n } else {\r\n USE_PROFILE = scope.def(CURRENT_STATE, '.profile');\r\n }\r\n\r\n var start = env.block();\r\n emitProfileStart(start);\r\n scope('if(', USE_PROFILE, '){', start, '}');\r\n var end = env.block();\r\n emitProfileEnd(end);\r\n scope.exit('if(', USE_PROFILE, '){', end, '}');\r\n }\r\n\r\n function emitAttributes (env, scope, args, attributes, filter) {\r\n var shared = env.shared;\r\n\r\n function typeLength (x) {\r\n switch (x) {\r\n case GL_FLOAT_VEC2:\r\n case GL_INT_VEC2:\r\n case GL_BOOL_VEC2:\r\n return 2\r\n case GL_FLOAT_VEC3:\r\n case GL_INT_VEC3:\r\n case GL_BOOL_VEC3:\r\n return 3\r\n case GL_FLOAT_VEC4:\r\n case GL_INT_VEC4:\r\n case GL_BOOL_VEC4:\r\n return 4\r\n default:\r\n return 1\r\n }\r\n }\r\n\r\n function emitBindAttribute (ATTRIBUTE, size, record) {\r\n var GL = shared.gl;\r\n\r\n var LOCATION = scope.def(ATTRIBUTE, '.location');\r\n var BINDING = scope.def(shared.attributes, '[', LOCATION, ']');\r\n\r\n var STATE = record.state;\r\n var BUFFER = record.buffer;\r\n var CONST_COMPONENTS = [\r\n record.x,\r\n record.y,\r\n record.z,\r\n record.w\r\n ];\r\n\r\n var COMMON_KEYS = [\r\n 'buffer',\r\n 'normalized',\r\n 'offset',\r\n 'stride'\r\n ];\r\n\r\n function emitBuffer () {\r\n scope(\r\n 'if(!', BINDING, '.buffer){',\r\n GL, '.enableVertexAttribArray(', LOCATION, ');}');\r\n\r\n var TYPE = record.type;\r\n var SIZE;\r\n if (!record.size) {\r\n SIZE = size;\r\n } else {\r\n SIZE = scope.def(record.size, '||', size);\r\n }\r\n\r\n scope('if(',\r\n BINDING, '.type!==', TYPE, '||',\r\n BINDING, '.size!==', SIZE, '||',\r\n COMMON_KEYS.map(function (key) {\r\n return BINDING + '.' + key + '!==' + record[key]\r\n }).join('||'),\r\n '){',\r\n GL, '.bindBuffer(', GL_ARRAY_BUFFER$1, ',', BUFFER, '.buffer);',\r\n GL, '.vertexAttribPointer(', [\r\n LOCATION,\r\n SIZE,\r\n TYPE,\r\n record.normalized,\r\n record.stride,\r\n record.offset\r\n ], ');',\r\n BINDING, '.type=', TYPE, ';',\r\n BINDING, '.size=', SIZE, ';',\r\n COMMON_KEYS.map(function (key) {\r\n return BINDING + '.' + key + '=' + record[key] + ';'\r\n }).join(''),\r\n '}');\r\n\r\n if (extInstancing) {\r\n var DIVISOR = record.divisor;\r\n scope(\r\n 'if(', BINDING, '.divisor!==', DIVISOR, '){',\r\n env.instancing, '.vertexAttribDivisorANGLE(', [LOCATION, DIVISOR], ');',\r\n BINDING, '.divisor=', DIVISOR, ';}');\r\n }\r\n }\r\n\r\n function emitConstant () {\r\n scope(\r\n 'if(', BINDING, '.buffer){',\r\n GL, '.disableVertexAttribArray(', LOCATION, ');',\r\n '}if(', CUTE_COMPONENTS.map(function (c, i) {\r\n return BINDING + '.' + c + '!==' + CONST_COMPONENTS[i]\r\n }).join('||'), '){',\r\n GL, '.vertexAttrib4f(', LOCATION, ',', CONST_COMPONENTS, ');',\r\n CUTE_COMPONENTS.map(function (c, i) {\r\n return BINDING + '.' + c + '=' + CONST_COMPONENTS[i] + ';'\r\n }).join(''),\r\n '}');\r\n }\r\n\r\n if (STATE === ATTRIB_STATE_POINTER) {\r\n emitBuffer();\r\n } else if (STATE === ATTRIB_STATE_CONSTANT) {\r\n emitConstant();\r\n } else {\r\n scope('if(', STATE, '===', ATTRIB_STATE_POINTER, '){');\r\n emitBuffer();\r\n scope('}else{');\r\n emitConstant();\r\n scope('}');\r\n }\r\n }\r\n\r\n attributes.forEach(function (attribute) {\r\n var name = attribute.name;\r\n var arg = args.attributes[name];\r\n var record;\r\n if (arg) {\r\n if (!filter(arg)) {\r\n return\r\n }\r\n record = arg.append(env, scope);\r\n } else {\r\n if (!filter(SCOPE_DECL)) {\r\n return\r\n }\r\n var scopeAttrib = env.scopeAttrib(name);\r\n check$1.optional(function () {\r\n env.assert(scope,\r\n scopeAttrib + '.state',\r\n 'missing attribute ' + name);\r\n });\r\n record = {};\r\n Object.keys(new AttributeRecord()).forEach(function (key) {\r\n record[key] = scope.def(scopeAttrib, '.', key);\r\n });\r\n }\r\n emitBindAttribute(\r\n env.link(attribute), typeLength(attribute.info.type), record);\r\n });\r\n }\r\n\r\n function emitUniforms (env, scope, args, uniforms, filter) {\r\n var shared = env.shared;\r\n var GL = shared.gl;\r\n\r\n var infix;\r\n for (var i = 0; i < uniforms.length; ++i) {\r\n var uniform = uniforms[i];\r\n var name = uniform.name;\r\n var type = uniform.info.type;\r\n var arg = args.uniforms[name];\r\n var UNIFORM = env.link(uniform);\r\n var LOCATION = UNIFORM + '.location';\r\n\r\n var VALUE;\r\n if (arg) {\r\n if (!filter(arg)) {\r\n continue\r\n }\r\n if (isStatic(arg)) {\r\n var value = arg.value;\r\n check$1.command(\r\n value !== null && typeof value !== 'undefined',\r\n 'missing uniform \"' + name + '\"', env.commandStr);\r\n if (type === GL_SAMPLER_2D || type === GL_SAMPLER_CUBE) {\r\n check$1.command(\r\n typeof value === 'function' &&\r\n ((type === GL_SAMPLER_2D &&\r\n (value._reglType === 'texture2d' ||\r\n value._reglType === 'framebuffer')) ||\r\n (type === GL_SAMPLER_CUBE &&\r\n (value._reglType === 'textureCube' ||\r\n value._reglType === 'framebufferCube'))),\r\n 'invalid texture for uniform ' + name, env.commandStr);\r\n var TEX_VALUE = env.link(value._texture || value.color[0]._texture);\r\n scope(GL, '.uniform1i(', LOCATION, ',', TEX_VALUE + '.bind());');\r\n scope.exit(TEX_VALUE, '.unbind();');\r\n } else if (\r\n type === GL_FLOAT_MAT2 ||\r\n type === GL_FLOAT_MAT3 ||\r\n type === GL_FLOAT_MAT4) {\r\n check$1.optional(function () {\r\n check$1.command(isArrayLike(value),\r\n 'invalid matrix for uniform ' + name, env.commandStr);\r\n check$1.command(\r\n (type === GL_FLOAT_MAT2 && value.length === 4) ||\r\n (type === GL_FLOAT_MAT3 && value.length === 9) ||\r\n (type === GL_FLOAT_MAT4 && value.length === 16),\r\n 'invalid length for matrix uniform ' + name, env.commandStr);\r\n });\r\n var MAT_VALUE = env.global.def('new Float32Array([' +\r\n Array.prototype.slice.call(value) + '])');\r\n var dim = 2;\r\n if (type === GL_FLOAT_MAT3) {\r\n dim = 3;\r\n } else if (type === GL_FLOAT_MAT4) {\r\n dim = 4;\r\n }\r\n scope(\r\n GL, '.uniformMatrix', dim, 'fv(',\r\n LOCATION, ',false,', MAT_VALUE, ');');\r\n } else {\r\n switch (type) {\r\n case GL_FLOAT$8:\r\n check$1.commandType(value, 'number', 'uniform ' + name, env.commandStr);\r\n infix = '1f';\r\n break\r\n case GL_FLOAT_VEC2:\r\n check$1.command(\r\n isArrayLike(value) && value.length === 2,\r\n 'uniform ' + name, env.commandStr);\r\n infix = '2f';\r\n break\r\n case GL_FLOAT_VEC3:\r\n check$1.command(\r\n isArrayLike(value) && value.length === 3,\r\n 'uniform ' + name, env.commandStr);\r\n infix = '3f';\r\n break\r\n case GL_FLOAT_VEC4:\r\n check$1.command(\r\n isArrayLike(value) && value.length === 4,\r\n 'uniform ' + name, env.commandStr);\r\n infix = '4f';\r\n break\r\n case GL_BOOL:\r\n check$1.commandType(value, 'boolean', 'uniform ' + name, env.commandStr);\r\n infix = '1i';\r\n break\r\n case GL_INT$3:\r\n check$1.commandType(value, 'number', 'uniform ' + name, env.commandStr);\r\n infix = '1i';\r\n break\r\n case GL_BOOL_VEC2:\r\n check$1.command(\r\n isArrayLike(value) && value.length === 2,\r\n 'uniform ' + name, env.commandStr);\r\n infix = '2i';\r\n break\r\n case GL_INT_VEC2:\r\n check$1.command(\r\n isArrayLike(value) && value.length === 2,\r\n 'uniform ' + name, env.commandStr);\r\n infix = '2i';\r\n break\r\n case GL_BOOL_VEC3:\r\n check$1.command(\r\n isArrayLike(value) && value.length === 3,\r\n 'uniform ' + name, env.commandStr);\r\n infix = '3i';\r\n break\r\n case GL_INT_VEC3:\r\n check$1.command(\r\n isArrayLike(value) && value.length === 3,\r\n 'uniform ' + name, env.commandStr);\r\n infix = '3i';\r\n break\r\n case GL_BOOL_VEC4:\r\n check$1.command(\r\n isArrayLike(value) && value.length === 4,\r\n 'uniform ' + name, env.commandStr);\r\n infix = '4i';\r\n break\r\n case GL_INT_VEC4:\r\n check$1.command(\r\n isArrayLike(value) && value.length === 4,\r\n 'uniform ' + name, env.commandStr);\r\n infix = '4i';\r\n break\r\n }\r\n scope(GL, '.uniform', infix, '(', LOCATION, ',',\r\n isArrayLike(value) ? Array.prototype.slice.call(value) : value,\r\n ');');\r\n }\r\n continue\r\n } else {\r\n VALUE = arg.append(env, scope);\r\n }\r\n } else {\r\n if (!filter(SCOPE_DECL)) {\r\n continue\r\n }\r\n VALUE = scope.def(shared.uniforms, '[', stringStore.id(name), ']');\r\n }\r\n\r\n if (type === GL_SAMPLER_2D) {\r\n scope(\r\n 'if(', VALUE, '&&', VALUE, '._reglType===\"framebuffer\"){',\r\n VALUE, '=', VALUE, '.color[0];',\r\n '}');\r\n } else if (type === GL_SAMPLER_CUBE) {\r\n scope(\r\n 'if(', VALUE, '&&', VALUE, '._reglType===\"framebufferCube\"){',\r\n VALUE, '=', VALUE, '.color[0];',\r\n '}');\r\n }\r\n\r\n // perform type validation\r\n check$1.optional(function () {\r\n function check (pred, message) {\r\n env.assert(scope, pred,\r\n 'bad data or missing for uniform \"' + name + '\". ' + message);\r\n }\r\n\r\n function checkType (type) {\r\n check(\r\n 'typeof ' + VALUE + '===\"' + type + '\"',\r\n 'invalid type, expected ' + type);\r\n }\r\n\r\n function checkVector (n, type) {\r\n check(\r\n shared.isArrayLike + '(' + VALUE + ')&&' + VALUE + '.length===' + n,\r\n 'invalid vector, should have length ' + n, env.commandStr);\r\n }\r\n\r\n function checkTexture (target) {\r\n check(\r\n 'typeof ' + VALUE + '===\"function\"&&' +\r\n VALUE + '._reglType===\"texture' +\r\n (target === GL_TEXTURE_2D$3 ? '2d' : 'Cube') + '\"',\r\n 'invalid texture type', env.commandStr);\r\n }\r\n\r\n switch (type) {\r\n case GL_INT$3:\r\n checkType('number');\r\n break\r\n case GL_INT_VEC2:\r\n checkVector(2, 'number');\r\n break\r\n case GL_INT_VEC3:\r\n checkVector(3, 'number');\r\n break\r\n case GL_INT_VEC4:\r\n checkVector(4, 'number');\r\n break\r\n case GL_FLOAT$8:\r\n checkType('number');\r\n break\r\n case GL_FLOAT_VEC2:\r\n checkVector(2, 'number');\r\n break\r\n case GL_FLOAT_VEC3:\r\n checkVector(3, 'number');\r\n break\r\n case GL_FLOAT_VEC4:\r\n checkVector(4, 'number');\r\n break\r\n case GL_BOOL:\r\n checkType('boolean');\r\n break\r\n case GL_BOOL_VEC2:\r\n checkVector(2, 'boolean');\r\n break\r\n case GL_BOOL_VEC3:\r\n checkVector(3, 'boolean');\r\n break\r\n case GL_BOOL_VEC4:\r\n checkVector(4, 'boolean');\r\n break\r\n case GL_FLOAT_MAT2:\r\n checkVector(4, 'number');\r\n break\r\n case GL_FLOAT_MAT3:\r\n checkVector(9, 'number');\r\n break\r\n case GL_FLOAT_MAT4:\r\n checkVector(16, 'number');\r\n break\r\n case GL_SAMPLER_2D:\r\n checkTexture(GL_TEXTURE_2D$3);\r\n break\r\n case GL_SAMPLER_CUBE:\r\n checkTexture(GL_TEXTURE_CUBE_MAP$2);\r\n break\r\n }\r\n });\r\n\r\n var unroll = 1;\r\n switch (type) {\r\n case GL_SAMPLER_2D:\r\n case GL_SAMPLER_CUBE:\r\n var TEX = scope.def(VALUE, '._texture');\r\n scope(GL, '.uniform1i(', LOCATION, ',', TEX, '.bind());');\r\n scope.exit(TEX, '.unbind();');\r\n continue\r\n\r\n case GL_INT$3:\r\n case GL_BOOL:\r\n infix = '1i';\r\n break\r\n\r\n case GL_INT_VEC2:\r\n case GL_BOOL_VEC2:\r\n infix = '2i';\r\n unroll = 2;\r\n break\r\n\r\n case GL_INT_VEC3:\r\n case GL_BOOL_VEC3:\r\n infix = '3i';\r\n unroll = 3;\r\n break\r\n\r\n case GL_INT_VEC4:\r\n case GL_BOOL_VEC4:\r\n infix = '4i';\r\n unroll = 4;\r\n break\r\n\r\n case GL_FLOAT$8:\r\n infix = '1f';\r\n break\r\n\r\n case GL_FLOAT_VEC2:\r\n infix = '2f';\r\n unroll = 2;\r\n break\r\n\r\n case GL_FLOAT_VEC3:\r\n infix = '3f';\r\n unroll = 3;\r\n break\r\n\r\n case GL_FLOAT_VEC4:\r\n infix = '4f';\r\n unroll = 4;\r\n break\r\n\r\n case GL_FLOAT_MAT2:\r\n infix = 'Matrix2fv';\r\n break\r\n\r\n case GL_FLOAT_MAT3:\r\n infix = 'Matrix3fv';\r\n break\r\n\r\n case GL_FLOAT_MAT4:\r\n infix = 'Matrix4fv';\r\n break\r\n }\r\n\r\n scope(GL, '.uniform', infix, '(', LOCATION, ',');\r\n if (infix.charAt(0) === 'M') {\r\n var matSize = Math.pow(type - GL_FLOAT_MAT2 + 2, 2);\r\n var STORAGE = env.global.def('new Float32Array(', matSize, ')');\r\n scope(\r\n 'false,(Array.isArray(', VALUE, ')||', VALUE, ' instanceof Float32Array)?', VALUE, ':(',\r\n loop(matSize, function (i) {\r\n return STORAGE + '[' + i + ']=' + VALUE + '[' + i + ']'\r\n }), ',', STORAGE, ')');\r\n } else if (unroll > 1) {\r\n scope(loop(unroll, function (i) {\r\n return VALUE + '[' + i + ']'\r\n }));\r\n } else {\r\n scope(VALUE);\r\n }\r\n scope(');');\r\n }\r\n }\r\n\r\n function emitDraw (env, outer, inner, args) {\r\n var shared = env.shared;\r\n var GL = shared.gl;\r\n var DRAW_STATE = shared.draw;\r\n\r\n var drawOptions = args.draw;\r\n\r\n function emitElements () {\r\n var defn = drawOptions.elements;\r\n var ELEMENTS;\r\n var scope = outer;\r\n if (defn) {\r\n if ((defn.contextDep && args.contextDynamic) || defn.propDep) {\r\n scope = inner;\r\n }\r\n ELEMENTS = defn.append(env, scope);\r\n } else {\r\n ELEMENTS = scope.def(DRAW_STATE, '.', S_ELEMENTS);\r\n }\r\n if (ELEMENTS) {\r\n scope(\r\n 'if(' + ELEMENTS + ')' +\r\n GL + '.bindBuffer(' + GL_ELEMENT_ARRAY_BUFFER$1 + ',' + ELEMENTS + '.buffer.buffer);');\r\n }\r\n return ELEMENTS\r\n }\r\n\r\n function emitCount () {\r\n var defn = drawOptions.count;\r\n var COUNT;\r\n var scope = outer;\r\n if (defn) {\r\n if ((defn.contextDep && args.contextDynamic) || defn.propDep) {\r\n scope = inner;\r\n }\r\n COUNT = defn.append(env, scope);\r\n check$1.optional(function () {\r\n if (defn.MISSING) {\r\n env.assert(outer, 'false', 'missing vertex count');\r\n }\r\n if (defn.DYNAMIC) {\r\n env.assert(scope, COUNT + '>=0', 'missing vertex count');\r\n }\r\n });\r\n } else {\r\n COUNT = scope.def(DRAW_STATE, '.', S_COUNT);\r\n check$1.optional(function () {\r\n env.assert(scope, COUNT + '>=0', 'missing vertex count');\r\n });\r\n }\r\n return COUNT\r\n }\r\n\r\n var ELEMENTS = emitElements();\r\n function emitValue (name) {\r\n var defn = drawOptions[name];\r\n if (defn) {\r\n if ((defn.contextDep && args.contextDynamic) || defn.propDep) {\r\n return defn.append(env, inner)\r\n } else {\r\n return defn.append(env, outer)\r\n }\r\n } else {\r\n return outer.def(DRAW_STATE, '.', name)\r\n }\r\n }\r\n\r\n var PRIMITIVE = emitValue(S_PRIMITIVE);\r\n var OFFSET = emitValue(S_OFFSET);\r\n\r\n var COUNT = emitCount();\r\n if (typeof COUNT === 'number') {\r\n if (COUNT === 0) {\r\n return\r\n }\r\n } else {\r\n inner('if(', COUNT, '){');\r\n inner.exit('}');\r\n }\r\n\r\n var INSTANCES, EXT_INSTANCING;\r\n if (extInstancing) {\r\n INSTANCES = emitValue(S_INSTANCES);\r\n EXT_INSTANCING = env.instancing;\r\n }\r\n\r\n var ELEMENT_TYPE = ELEMENTS + '.type';\r\n\r\n var elementsStatic = drawOptions.elements && isStatic(drawOptions.elements);\r\n\r\n function emitInstancing () {\r\n function drawElements () {\r\n inner(EXT_INSTANCING, '.drawElementsInstancedANGLE(', [\r\n PRIMITIVE,\r\n COUNT,\r\n ELEMENT_TYPE,\r\n OFFSET + '<<((' + ELEMENT_TYPE + '-' + GL_UNSIGNED_BYTE$8 + ')>>1)',\r\n INSTANCES\r\n ], ');');\r\n }\r\n\r\n function drawArrays () {\r\n inner(EXT_INSTANCING, '.drawArraysInstancedANGLE(',\r\n [PRIMITIVE, OFFSET, COUNT, INSTANCES], ');');\r\n }\r\n\r\n if (ELEMENTS) {\r\n if (!elementsStatic) {\r\n inner('if(', ELEMENTS, '){');\r\n drawElements();\r\n inner('}else{');\r\n drawArrays();\r\n inner('}');\r\n } else {\r\n drawElements();\r\n }\r\n } else {\r\n drawArrays();\r\n }\r\n }\r\n\r\n function emitRegular () {\r\n function drawElements () {\r\n inner(GL + '.drawElements(' + [\r\n PRIMITIVE,\r\n COUNT,\r\n ELEMENT_TYPE,\r\n OFFSET + '<<((' + ELEMENT_TYPE + '-' + GL_UNSIGNED_BYTE$8 + ')>>1)'\r\n ] + ');');\r\n }\r\n\r\n function drawArrays () {\r\n inner(GL + '.drawArrays(' + [PRIMITIVE, OFFSET, COUNT] + ');');\r\n }\r\n\r\n if (ELEMENTS) {\r\n if (!elementsStatic) {\r\n inner('if(', ELEMENTS, '){');\r\n drawElements();\r\n inner('}else{');\r\n drawArrays();\r\n inner('}');\r\n } else {\r\n drawElements();\r\n }\r\n } else {\r\n drawArrays();\r\n }\r\n }\r\n\r\n if (extInstancing && (typeof INSTANCES !== 'number' || INSTANCES >= 0)) {\r\n if (typeof INSTANCES === 'string') {\r\n inner('if(', INSTANCES, '>0){');\r\n emitInstancing();\r\n inner('}else if(', INSTANCES, '<0){');\r\n emitRegular();\r\n inner('}');\r\n } else {\r\n emitInstancing();\r\n }\r\n } else {\r\n emitRegular();\r\n }\r\n }\r\n\r\n function createBody (emitBody, parentEnv, args, program, count) {\r\n var env = createREGLEnvironment();\r\n var scope = env.proc('body', count);\r\n check$1.optional(function () {\r\n env.commandStr = parentEnv.commandStr;\r\n env.command = env.link(parentEnv.commandStr);\r\n });\r\n if (extInstancing) {\r\n env.instancing = scope.def(\r\n env.shared.extensions, '.angle_instanced_arrays');\r\n }\r\n emitBody(env, scope, args, program);\r\n return env.compile().body\r\n }\r\n\r\n // ===================================================\r\n // ===================================================\r\n // DRAW PROC\r\n // ===================================================\r\n // ===================================================\r\n function emitDrawBody (env, draw, args, program) {\r\n injectExtensions(env, draw);\r\n emitAttributes(env, draw, args, program.attributes, function () {\r\n return true\r\n });\r\n emitUniforms(env, draw, args, program.uniforms, function () {\r\n return true\r\n });\r\n emitDraw(env, draw, draw, args);\r\n }\r\n\r\n function emitDrawProc (env, args) {\r\n var draw = env.proc('draw', 1);\r\n\r\n injectExtensions(env, draw);\r\n\r\n emitContext(env, draw, args.context);\r\n emitPollFramebuffer(env, draw, args.framebuffer);\r\n\r\n emitPollState(env, draw, args);\r\n emitSetOptions(env, draw, args.state);\r\n\r\n emitProfile(env, draw, args, false, true);\r\n\r\n var program = args.shader.progVar.append(env, draw);\r\n draw(env.shared.gl, '.useProgram(', program, '.program);');\r\n\r\n if (args.shader.program) {\r\n emitDrawBody(env, draw, args, args.shader.program);\r\n } else {\r\n var drawCache = env.global.def('{}');\r\n var PROG_ID = draw.def(program, '.id');\r\n var CACHED_PROC = draw.def(drawCache, '[', PROG_ID, ']');\r\n draw(\r\n env.cond(CACHED_PROC)\r\n .then(CACHED_PROC, '.call(this,a0);')\r\n .else(\r\n CACHED_PROC, '=', drawCache, '[', PROG_ID, ']=',\r\n env.link(function (program) {\r\n return createBody(emitDrawBody, env, args, program, 1)\r\n }), '(', program, ');',\r\n CACHED_PROC, '.call(this,a0);'));\r\n }\r\n\r\n if (Object.keys(args.state).length > 0) {\r\n draw(env.shared.current, '.dirty=true;');\r\n }\r\n }\r\n\r\n // ===================================================\r\n // ===================================================\r\n // BATCH PROC\r\n // ===================================================\r\n // ===================================================\r\n\r\n function emitBatchDynamicShaderBody (env, scope, args, program) {\r\n env.batchId = 'a1';\r\n\r\n injectExtensions(env, scope);\r\n\r\n function all () {\r\n return true\r\n }\r\n\r\n emitAttributes(env, scope, args, program.attributes, all);\r\n emitUniforms(env, scope, args, program.uniforms, all);\r\n emitDraw(env, scope, scope, args);\r\n }\r\n\r\n function emitBatchBody (env, scope, args, program) {\r\n injectExtensions(env, scope);\r\n\r\n var contextDynamic = args.contextDep;\r\n\r\n var BATCH_ID = scope.def();\r\n var PROP_LIST = 'a0';\r\n var NUM_PROPS = 'a1';\r\n var PROPS = scope.def();\r\n env.shared.props = PROPS;\r\n env.batchId = BATCH_ID;\r\n\r\n var outer = env.scope();\r\n var inner = env.scope();\r\n\r\n scope(\r\n outer.entry,\r\n 'for(', BATCH_ID, '=0;', BATCH_ID, '<', NUM_PROPS, ';++', BATCH_ID, '){',\r\n PROPS, '=', PROP_LIST, '[', BATCH_ID, '];',\r\n inner,\r\n '}',\r\n outer.exit);\r\n\r\n function isInnerDefn (defn) {\r\n return ((defn.contextDep && contextDynamic) || defn.propDep)\r\n }\r\n\r\n function isOuterDefn (defn) {\r\n return !isInnerDefn(defn)\r\n }\r\n\r\n if (args.needsContext) {\r\n emitContext(env, inner, args.context);\r\n }\r\n if (args.needsFramebuffer) {\r\n emitPollFramebuffer(env, inner, args.framebuffer);\r\n }\r\n emitSetOptions(env, inner, args.state, isInnerDefn);\r\n\r\n if (args.profile && isInnerDefn(args.profile)) {\r\n emitProfile(env, inner, args, false, true);\r\n }\r\n\r\n if (!program) {\r\n var progCache = env.global.def('{}');\r\n var PROGRAM = args.shader.progVar.append(env, inner);\r\n var PROG_ID = inner.def(PROGRAM, '.id');\r\n var CACHED_PROC = inner.def(progCache, '[', PROG_ID, ']');\r\n inner(\r\n env.shared.gl, '.useProgram(', PROGRAM, '.program);',\r\n 'if(!', CACHED_PROC, '){',\r\n CACHED_PROC, '=', progCache, '[', PROG_ID, ']=',\r\n env.link(function (program) {\r\n return createBody(\r\n emitBatchDynamicShaderBody, env, args, program, 2)\r\n }), '(', PROGRAM, ');}',\r\n CACHED_PROC, '.call(this,a0[', BATCH_ID, '],', BATCH_ID, ');');\r\n } else {\r\n emitAttributes(env, outer, args, program.attributes, isOuterDefn);\r\n emitAttributes(env, inner, args, program.attributes, isInnerDefn);\r\n emitUniforms(env, outer, args, program.uniforms, isOuterDefn);\r\n emitUniforms(env, inner, args, program.uniforms, isInnerDefn);\r\n emitDraw(env, outer, inner, args);\r\n }\r\n }\r\n\r\n function emitBatchProc (env, args) {\r\n var batch = env.proc('batch', 2);\r\n env.batchId = '0';\r\n\r\n injectExtensions(env, batch);\r\n\r\n // Check if any context variables depend on props\r\n var contextDynamic = false;\r\n var needsContext = true;\r\n Object.keys(args.context).forEach(function (name) {\r\n contextDynamic = contextDynamic || args.context[name].propDep;\r\n });\r\n if (!contextDynamic) {\r\n emitContext(env, batch, args.context);\r\n needsContext = false;\r\n }\r\n\r\n // framebuffer state affects framebufferWidth/height context vars\r\n var framebuffer = args.framebuffer;\r\n var needsFramebuffer = false;\r\n if (framebuffer) {\r\n if (framebuffer.propDep) {\r\n contextDynamic = needsFramebuffer = true;\r\n } else if (framebuffer.contextDep && contextDynamic) {\r\n needsFramebuffer = true;\r\n }\r\n if (!needsFramebuffer) {\r\n emitPollFramebuffer(env, batch, framebuffer);\r\n }\r\n } else {\r\n emitPollFramebuffer(env, batch, null);\r\n }\r\n\r\n // viewport is weird because it can affect context vars\r\n if (args.state.viewport && args.state.viewport.propDep) {\r\n contextDynamic = true;\r\n }\r\n\r\n function isInnerDefn (defn) {\r\n return (defn.contextDep && contextDynamic) || defn.propDep\r\n }\r\n\r\n // set webgl options\r\n emitPollState(env, batch, args);\r\n emitSetOptions(env, batch, args.state, function (defn) {\r\n return !isInnerDefn(defn)\r\n });\r\n\r\n if (!args.profile || !isInnerDefn(args.profile)) {\r\n emitProfile(env, batch, args, false, 'a1');\r\n }\r\n\r\n // Save these values to args so that the batch body routine can use them\r\n args.contextDep = contextDynamic;\r\n args.needsContext = needsContext;\r\n args.needsFramebuffer = needsFramebuffer;\r\n\r\n // determine if shader is dynamic\r\n var progDefn = args.shader.progVar;\r\n if ((progDefn.contextDep && contextDynamic) || progDefn.propDep) {\r\n emitBatchBody(\r\n env,\r\n batch,\r\n args,\r\n null);\r\n } else {\r\n var PROGRAM = progDefn.append(env, batch);\r\n batch(env.shared.gl, '.useProgram(', PROGRAM, '.program);');\r\n if (args.shader.program) {\r\n emitBatchBody(\r\n env,\r\n batch,\r\n args,\r\n args.shader.program);\r\n } else {\r\n var batchCache = env.global.def('{}');\r\n var PROG_ID = batch.def(PROGRAM, '.id');\r\n var CACHED_PROC = batch.def(batchCache, '[', PROG_ID, ']');\r\n batch(\r\n env.cond(CACHED_PROC)\r\n .then(CACHED_PROC, '.call(this,a0,a1);')\r\n .else(\r\n CACHED_PROC, '=', batchCache, '[', PROG_ID, ']=',\r\n env.link(function (program) {\r\n return createBody(emitBatchBody, env, args, program, 2)\r\n }), '(', PROGRAM, ');',\r\n CACHED_PROC, '.call(this,a0,a1);'));\r\n }\r\n }\r\n\r\n if (Object.keys(args.state).length > 0) {\r\n batch(env.shared.current, '.dirty=true;');\r\n }\r\n }\r\n\r\n // ===================================================\r\n // ===================================================\r\n // SCOPE COMMAND\r\n // ===================================================\r\n // ===================================================\r\n function emitScopeProc (env, args) {\r\n var scope = env.proc('scope', 3);\r\n env.batchId = 'a2';\r\n\r\n var shared = env.shared;\r\n var CURRENT_STATE = shared.current;\r\n\r\n emitContext(env, scope, args.context);\r\n\r\n if (args.framebuffer) {\r\n args.framebuffer.append(env, scope);\r\n }\r\n\r\n sortState(Object.keys(args.state)).forEach(function (name) {\r\n var defn = args.state[name];\r\n var value = defn.append(env, scope);\r\n if (isArrayLike(value)) {\r\n value.forEach(function (v, i) {\r\n scope.set(env.next[name], '[' + i + ']', v);\r\n });\r\n } else {\r\n scope.set(shared.next, '.' + name, value);\r\n }\r\n });\r\n\r\n emitProfile(env, scope, args, true, true)\r\n\r\n ;[S_ELEMENTS, S_OFFSET, S_COUNT, S_INSTANCES, S_PRIMITIVE].forEach(\r\n function (opt) {\r\n var variable = args.draw[opt];\r\n if (!variable) {\r\n return\r\n }\r\n scope.set(shared.draw, '.' + opt, '' + variable.append(env, scope));\r\n });\r\n\r\n Object.keys(args.uniforms).forEach(function (opt) {\r\n scope.set(\r\n shared.uniforms,\r\n '[' + stringStore.id(opt) + ']',\r\n args.uniforms[opt].append(env, scope));\r\n });\r\n\r\n Object.keys(args.attributes).forEach(function (name) {\r\n var record = args.attributes[name].append(env, scope);\r\n var scopeAttrib = env.scopeAttrib(name);\r\n Object.keys(new AttributeRecord()).forEach(function (prop) {\r\n scope.set(scopeAttrib, '.' + prop, record[prop]);\r\n });\r\n });\r\n\r\n function saveShader (name) {\r\n var shader = args.shader[name];\r\n if (shader) {\r\n scope.set(shared.shader, '.' + name, shader.append(env, scope));\r\n }\r\n }\r\n saveShader(S_VERT);\r\n saveShader(S_FRAG);\r\n\r\n if (Object.keys(args.state).length > 0) {\r\n scope(CURRENT_STATE, '.dirty=true;');\r\n scope.exit(CURRENT_STATE, '.dirty=true;');\r\n }\r\n\r\n scope('a1(', env.shared.context, ',a0,', env.batchId, ');');\r\n }\r\n\r\n function isDynamicObject (object) {\r\n if (typeof object !== 'object' || isArrayLike(object)) {\r\n return\r\n }\r\n var props = Object.keys(object);\r\n for (var i = 0; i < props.length; ++i) {\r\n if (dynamic.isDynamic(object[props[i]])) {\r\n return true\r\n }\r\n }\r\n return false\r\n }\r\n\r\n function splatObject (env, options, name) {\r\n var object = options.static[name];\r\n if (!object || !isDynamicObject(object)) {\r\n return\r\n }\r\n\r\n var globals = env.global;\r\n var keys = Object.keys(object);\r\n var thisDep = false;\r\n var contextDep = false;\r\n var propDep = false;\r\n var objectRef = env.global.def('{}');\r\n keys.forEach(function (key) {\r\n var value = object[key];\r\n if (dynamic.isDynamic(value)) {\r\n if (typeof value === 'function') {\r\n value = object[key] = dynamic.unbox(value);\r\n }\r\n var deps = createDynamicDecl(value, null);\r\n thisDep = thisDep || deps.thisDep;\r\n propDep = propDep || deps.propDep;\r\n contextDep = contextDep || deps.contextDep;\r\n } else {\r\n globals(objectRef, '.', key, '=');\r\n switch (typeof value) {\r\n case 'number':\r\n globals(value);\r\n break\r\n case 'string':\r\n globals('\"', value, '\"');\r\n break\r\n case 'object':\r\n if (Array.isArray(value)) {\r\n globals('[', value.join(), ']');\r\n }\r\n break\r\n default:\r\n globals(env.link(value));\r\n break\r\n }\r\n globals(';');\r\n }\r\n });\r\n\r\n function appendBlock (env, block) {\r\n keys.forEach(function (key) {\r\n var value = object[key];\r\n if (!dynamic.isDynamic(value)) {\r\n return\r\n }\r\n var ref = env.invoke(block, value);\r\n block(objectRef, '.', key, '=', ref, ';');\r\n });\r\n }\r\n\r\n options.dynamic[name] = new dynamic.DynamicVariable(DYN_THUNK, {\r\n thisDep: thisDep,\r\n contextDep: contextDep,\r\n propDep: propDep,\r\n ref: objectRef,\r\n append: appendBlock\r\n });\r\n delete options.static[name];\r\n }\r\n\r\n // ===========================================================================\r\n // ===========================================================================\r\n // MAIN DRAW COMMAND\r\n // ===========================================================================\r\n // ===========================================================================\r\n function compileCommand (options, attributes, uniforms, context, stats) {\r\n var env = createREGLEnvironment();\r\n\r\n // link stats, so that we can easily access it in the program.\r\n env.stats = env.link(stats);\r\n\r\n // splat options and attributes to allow for dynamic nested properties\r\n Object.keys(attributes.static).forEach(function (key) {\r\n splatObject(env, attributes, key);\r\n });\r\n NESTED_OPTIONS.forEach(function (name) {\r\n splatObject(env, options, name);\r\n });\r\n\r\n var args = parseArguments(options, attributes, uniforms, context, env);\r\n\r\n emitDrawProc(env, args);\r\n emitScopeProc(env, args);\r\n emitBatchProc(env, args);\r\n\r\n return env.compile()\r\n }\r\n\r\n // ===========================================================================\r\n // ===========================================================================\r\n // POLL / REFRESH\r\n // ===========================================================================\r\n // ===========================================================================\r\n return {\r\n next: nextState,\r\n current: currentState,\r\n procs: (function () {\r\n var env = createREGLEnvironment();\r\n var poll = env.proc('poll');\r\n var refresh = env.proc('refresh');\r\n var common = env.block();\r\n poll(common);\r\n refresh(common);\r\n\r\n var shared = env.shared;\r\n var GL = shared.gl;\r\n var NEXT_STATE = shared.next;\r\n var CURRENT_STATE = shared.current;\r\n\r\n common(CURRENT_STATE, '.dirty=false;');\r\n\r\n emitPollFramebuffer(env, poll);\r\n emitPollFramebuffer(env, refresh, null, true);\r\n\r\n // Refresh updates all attribute state changes\r\n var INSTANCING;\r\n if (extInstancing) {\r\n INSTANCING = env.link(extInstancing);\r\n }\r\n for (var i = 0; i < limits.maxAttributes; ++i) {\r\n var BINDING = refresh.def(shared.attributes, '[', i, ']');\r\n var ifte = env.cond(BINDING, '.buffer');\r\n ifte.then(\r\n GL, '.enableVertexAttribArray(', i, ');',\r\n GL, '.bindBuffer(',\r\n GL_ARRAY_BUFFER$1, ',',\r\n BINDING, '.buffer.buffer);',\r\n GL, '.vertexAttribPointer(',\r\n i, ',',\r\n BINDING, '.size,',\r\n BINDING, '.type,',\r\n BINDING, '.normalized,',\r\n BINDING, '.stride,',\r\n BINDING, '.offset);'\r\n ).else(\r\n GL, '.disableVertexAttribArray(', i, ');',\r\n GL, '.vertexAttrib4f(',\r\n i, ',',\r\n BINDING, '.x,',\r\n BINDING, '.y,',\r\n BINDING, '.z,',\r\n BINDING, '.w);',\r\n BINDING, '.buffer=null;');\r\n refresh(ifte);\r\n if (extInstancing) {\r\n refresh(\r\n INSTANCING, '.vertexAttribDivisorANGLE(',\r\n i, ',',\r\n BINDING, '.divisor);');\r\n }\r\n }\r\n\r\n Object.keys(GL_FLAGS).forEach(function (flag) {\r\n var cap = GL_FLAGS[flag];\r\n var NEXT = common.def(NEXT_STATE, '.', flag);\r\n var block = env.block();\r\n block('if(', NEXT, '){',\r\n GL, '.enable(', cap, ')}else{',\r\n GL, '.disable(', cap, ')}',\r\n CURRENT_STATE, '.', flag, '=', NEXT, ';');\r\n refresh(block);\r\n poll(\r\n 'if(', NEXT, '!==', CURRENT_STATE, '.', flag, '){',\r\n block,\r\n '}');\r\n });\r\n\r\n Object.keys(GL_VARIABLES).forEach(function (name) {\r\n var func = GL_VARIABLES[name];\r\n var init = currentState[name];\r\n var NEXT, CURRENT;\r\n var block = env.block();\r\n block(GL, '.', func, '(');\r\n if (isArrayLike(init)) {\r\n var n = init.length;\r\n NEXT = env.global.def(NEXT_STATE, '.', name);\r\n CURRENT = env.global.def(CURRENT_STATE, '.', name);\r\n block(\r\n loop(n, function (i) {\r\n return NEXT + '[' + i + ']'\r\n }), ');',\r\n loop(n, function (i) {\r\n return CURRENT + '[' + i + ']=' + NEXT + '[' + i + '];'\r\n }).join(''));\r\n poll(\r\n 'if(', loop(n, function (i) {\r\n return NEXT + '[' + i + ']!==' + CURRENT + '[' + i + ']'\r\n }).join('||'), '){',\r\n block,\r\n '}');\r\n } else {\r\n NEXT = common.def(NEXT_STATE, '.', name);\r\n CURRENT = common.def(CURRENT_STATE, '.', name);\r\n block(\r\n NEXT, ');',\r\n CURRENT_STATE, '.', name, '=', NEXT, ';');\r\n poll(\r\n 'if(', NEXT, '!==', CURRENT, '){',\r\n block,\r\n '}');\r\n }\r\n refresh(block);\r\n });\r\n\r\n return env.compile()\r\n })(),\r\n compile: compileCommand\r\n }\r\n}\n\nfunction stats () {\r\n return {\r\n bufferCount: 0,\r\n elementsCount: 0,\r\n framebufferCount: 0,\r\n shaderCount: 0,\r\n textureCount: 0,\r\n cubeCount: 0,\r\n renderbufferCount: 0,\r\n maxTextureUnits: 0\r\n }\r\n}\n\nvar GL_QUERY_RESULT_EXT = 0x8866;\r\nvar GL_QUERY_RESULT_AVAILABLE_EXT = 0x8867;\r\nvar GL_TIME_ELAPSED_EXT = 0x88BF;\r\n\r\nvar createTimer = function (gl, extensions) {\r\n if (!extensions.ext_disjoint_timer_query) {\r\n return null\r\n }\r\n\r\n // QUERY POOL BEGIN\r\n var queryPool = [];\r\n function allocQuery () {\r\n return queryPool.pop() || extensions.ext_disjoint_timer_query.createQueryEXT()\r\n }\r\n function freeQuery (query) {\r\n queryPool.push(query);\r\n }\r\n // QUERY POOL END\r\n\r\n var pendingQueries = [];\r\n function beginQuery (stats) {\r\n var query = allocQuery();\r\n extensions.ext_disjoint_timer_query.beginQueryEXT(GL_TIME_ELAPSED_EXT, query);\r\n pendingQueries.push(query);\r\n pushScopeStats(pendingQueries.length - 1, pendingQueries.length, stats);\r\n }\r\n\r\n function endQuery () {\r\n extensions.ext_disjoint_timer_query.endQueryEXT(GL_TIME_ELAPSED_EXT);\r\n }\r\n\r\n //\r\n // Pending stats pool.\r\n //\r\n function PendingStats () {\r\n this.startQueryIndex = -1;\r\n this.endQueryIndex = -1;\r\n this.sum = 0;\r\n this.stats = null;\r\n }\r\n var pendingStatsPool = [];\r\n function allocPendingStats () {\r\n return pendingStatsPool.pop() || new PendingStats()\r\n }\r\n function freePendingStats (pendingStats) {\r\n pendingStatsPool.push(pendingStats);\r\n }\r\n // Pending stats pool end\r\n\r\n var pendingStats = [];\r\n function pushScopeStats (start, end, stats) {\r\n var ps = allocPendingStats();\r\n ps.startQueryIndex = start;\r\n ps.endQueryIndex = end;\r\n ps.sum = 0;\r\n ps.stats = stats;\r\n pendingStats.push(ps);\r\n }\r\n\r\n // we should call this at the beginning of the frame,\r\n // in order to update gpuTime\r\n var timeSum = [];\r\n var queryPtr = [];\r\n function update () {\r\n var ptr, i;\r\n\r\n var n = pendingQueries.length;\r\n if (n === 0) {\r\n return\r\n }\r\n\r\n // Reserve space\r\n queryPtr.length = Math.max(queryPtr.length, n + 1);\r\n timeSum.length = Math.max(timeSum.length, n + 1);\r\n timeSum[0] = 0;\r\n queryPtr[0] = 0;\r\n\r\n // Update all pending timer queries\r\n var queryTime = 0;\r\n ptr = 0;\r\n for (i = 0; i < pendingQueries.length; ++i) {\r\n var query = pendingQueries[i];\r\n if (extensions.ext_disjoint_timer_query.getQueryObjectEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT)) {\r\n queryTime += extensions.ext_disjoint_timer_query.getQueryObjectEXT(query, GL_QUERY_RESULT_EXT);\r\n freeQuery(query);\r\n } else {\r\n pendingQueries[ptr++] = query;\r\n }\r\n timeSum[i + 1] = queryTime;\r\n queryPtr[i + 1] = ptr;\r\n }\r\n pendingQueries.length = ptr;\r\n\r\n // Update all pending stat queries\r\n ptr = 0;\r\n for (i = 0; i < pendingStats.length; ++i) {\r\n var stats = pendingStats[i];\r\n var start = stats.startQueryIndex;\r\n var end = stats.endQueryIndex;\r\n stats.sum += timeSum[end] - timeSum[start];\r\n var startPtr = queryPtr[start];\r\n var endPtr = queryPtr[end];\r\n if (endPtr === startPtr) {\r\n stats.stats.gpuTime += stats.sum / 1e6;\r\n freePendingStats(stats);\r\n } else {\r\n stats.startQueryIndex = startPtr;\r\n stats.endQueryIndex = endPtr;\r\n pendingStats[ptr++] = stats;\r\n }\r\n }\r\n pendingStats.length = ptr;\r\n }\r\n\r\n return {\r\n beginQuery: beginQuery,\r\n endQuery: endQuery,\r\n pushScopeStats: pushScopeStats,\r\n update: update,\r\n getNumPendingQueries: function () {\r\n return pendingQueries.length\r\n },\r\n clear: function () {\r\n queryPool.push.apply(queryPool, pendingQueries);\r\n for (var i = 0; i < queryPool.length; i++) {\r\n extensions.ext_disjoint_timer_query.deleteQueryEXT(queryPool[i]);\r\n }\r\n pendingQueries.length = 0;\r\n queryPool.length = 0;\r\n },\r\n restore: function () {\r\n pendingQueries.length = 0;\r\n queryPool.length = 0;\r\n }\r\n }\r\n};\n\nvar GL_COLOR_BUFFER_BIT = 16384;\r\nvar GL_DEPTH_BUFFER_BIT = 256;\r\nvar GL_STENCIL_BUFFER_BIT = 1024;\r\n\r\nvar GL_ARRAY_BUFFER = 34962;\r\n\r\nvar CONTEXT_LOST_EVENT = 'webglcontextlost';\r\nvar CONTEXT_RESTORED_EVENT = 'webglcontextrestored';\r\n\r\nvar DYN_PROP = 1;\r\nvar DYN_CONTEXT = 2;\r\nvar DYN_STATE = 3;\r\n\r\nfunction find (haystack, needle) {\r\n for (var i = 0; i < haystack.length; ++i) {\r\n if (haystack[i] === needle) {\r\n return i\r\n }\r\n }\r\n return -1\r\n}\r\n\r\nfunction wrapREGL (args) {\r\n var config = parseArgs(args);\r\n if (!config) {\r\n return null\r\n }\r\n\r\n var gl = config.gl;\r\n var glAttributes = gl.getContextAttributes();\r\n var contextLost = gl.isContextLost();\r\n\r\n var extensionState = createExtensionCache(gl, config);\r\n if (!extensionState) {\r\n return null\r\n }\r\n\r\n var stringStore = createStringStore();\r\n var stats$$1 = stats();\r\n var extensions = extensionState.extensions;\r\n var timer = createTimer(gl, extensions);\r\n\r\n var START_TIME = clock();\r\n var WIDTH = gl.drawingBufferWidth;\r\n var HEIGHT = gl.drawingBufferHeight;\r\n\r\n var contextState = {\r\n tick: 0,\r\n time: 0,\r\n viewportWidth: WIDTH,\r\n viewportHeight: HEIGHT,\r\n framebufferWidth: WIDTH,\r\n framebufferHeight: HEIGHT,\r\n drawingBufferWidth: WIDTH,\r\n drawingBufferHeight: HEIGHT,\r\n pixelRatio: config.pixelRatio\r\n };\r\n var uniformState = {};\r\n var drawState = {\r\n elements: null,\r\n primitive: 4, // GL_TRIANGLES\r\n count: -1,\r\n offset: 0,\r\n instances: -1\r\n };\r\n\r\n var limits = wrapLimits(gl, extensions);\r\n var attributeState = wrapAttributeState(\r\n gl,\r\n extensions,\r\n limits,\r\n stringStore);\r\n var bufferState = wrapBufferState(\r\n gl,\r\n stats$$1,\r\n config,\r\n attributeState);\r\n var elementState = wrapElementsState(gl, extensions, bufferState, stats$$1);\r\n var shaderState = wrapShaderState(gl, stringStore, stats$$1, config);\r\n var textureState = createTextureSet(\r\n gl,\r\n extensions,\r\n limits,\r\n function () { core.procs.poll(); },\r\n contextState,\r\n stats$$1,\r\n config);\r\n var renderbufferState = wrapRenderbuffers(gl, extensions, limits, stats$$1, config);\r\n var framebufferState = wrapFBOState(\r\n gl,\r\n extensions,\r\n limits,\r\n textureState,\r\n renderbufferState,\r\n stats$$1);\r\n var core = reglCore(\r\n gl,\r\n stringStore,\r\n extensions,\r\n limits,\r\n bufferState,\r\n elementState,\r\n textureState,\r\n framebufferState,\r\n uniformState,\r\n attributeState,\r\n shaderState,\r\n drawState,\r\n contextState,\r\n timer,\r\n config);\r\n var readPixels = wrapReadPixels(\r\n gl,\r\n framebufferState,\r\n core.procs.poll,\r\n contextState,\r\n glAttributes, extensions, limits);\r\n\r\n var nextState = core.next;\r\n var canvas = gl.canvas;\r\n\r\n var rafCallbacks = [];\r\n var lossCallbacks = [];\r\n var restoreCallbacks = [];\r\n var destroyCallbacks = [config.onDestroy];\r\n\r\n var activeRAF = null;\r\n function handleRAF () {\r\n if (rafCallbacks.length === 0) {\r\n if (timer) {\r\n timer.update();\r\n }\r\n activeRAF = null;\r\n return\r\n }\r\n\r\n // schedule next animation frame\r\n activeRAF = raf.next(handleRAF);\r\n\r\n // poll for changes\r\n poll();\r\n\r\n // fire a callback for all pending rafs\r\n for (var i = rafCallbacks.length - 1; i >= 0; --i) {\r\n var cb = rafCallbacks[i];\r\n if (cb) {\r\n cb(contextState, null, 0);\r\n }\r\n }\r\n\r\n // flush all pending webgl calls\r\n gl.flush();\r\n\r\n // poll GPU timers *after* gl.flush so we don't delay command dispatch\r\n if (timer) {\r\n timer.update();\r\n }\r\n }\r\n\r\n function startRAF () {\r\n if (!activeRAF && rafCallbacks.length > 0) {\r\n activeRAF = raf.next(handleRAF);\r\n }\r\n }\r\n\r\n function stopRAF () {\r\n if (activeRAF) {\r\n raf.cancel(handleRAF);\r\n activeRAF = null;\r\n }\r\n }\r\n\r\n function handleContextLoss (event) {\r\n event.preventDefault();\r\n\r\n // set context lost flag\r\n contextLost = true;\r\n\r\n // pause request animation frame\r\n stopRAF();\r\n\r\n // lose context\r\n lossCallbacks.forEach(function (cb) {\r\n cb();\r\n });\r\n }\r\n\r\n function handleContextRestored (event) {\r\n // clear error code\r\n gl.getError();\r\n\r\n // clear context lost flag\r\n contextLost = false;\r\n\r\n // refresh state\r\n extensionState.restore();\r\n shaderState.restore();\r\n bufferState.restore();\r\n textureState.restore();\r\n renderbufferState.restore();\r\n framebufferState.restore();\r\n if (timer) {\r\n timer.restore();\r\n }\r\n\r\n // refresh state\r\n core.procs.refresh();\r\n\r\n // restart RAF\r\n startRAF();\r\n\r\n // restore context\r\n restoreCallbacks.forEach(function (cb) {\r\n cb();\r\n });\r\n }\r\n\r\n if (canvas) {\r\n canvas.addEventListener(CONTEXT_LOST_EVENT, handleContextLoss, false);\r\n canvas.addEventListener(CONTEXT_RESTORED_EVENT, handleContextRestored, false);\r\n }\r\n\r\n function destroy () {\r\n rafCallbacks.length = 0;\r\n stopRAF();\r\n\r\n if (canvas) {\r\n canvas.removeEventListener(CONTEXT_LOST_EVENT, handleContextLoss);\r\n canvas.removeEventListener(CONTEXT_RESTORED_EVENT, handleContextRestored);\r\n }\r\n\r\n shaderState.clear();\r\n framebufferState.clear();\r\n renderbufferState.clear();\r\n textureState.clear();\r\n elementState.clear();\r\n bufferState.clear();\r\n\r\n if (timer) {\r\n timer.clear();\r\n }\r\n\r\n destroyCallbacks.forEach(function (cb) {\r\n cb();\r\n });\r\n }\r\n\r\n function compileProcedure (options) {\r\n check$1(!!options, 'invalid args to regl({...})');\r\n check$1.type(options, 'object', 'invalid args to regl({...})');\r\n\r\n function flattenNestedOptions (options) {\r\n var result = extend({}, options);\r\n delete result.uniforms;\r\n delete result.attributes;\r\n delete result.context;\r\n\r\n if ('stencil' in result && result.stencil.op) {\r\n result.stencil.opBack = result.stencil.opFront = result.stencil.op;\r\n delete result.stencil.op;\r\n }\r\n\r\n function merge (name) {\r\n if (name in result) {\r\n var child = result[name];\r\n delete result[name];\r\n Object.keys(child).forEach(function (prop) {\r\n result[name + '.' + prop] = child[prop];\r\n });\r\n }\r\n }\r\n merge('blend');\r\n merge('depth');\r\n merge('cull');\r\n merge('stencil');\r\n merge('polygonOffset');\r\n merge('scissor');\r\n merge('sample');\r\n\r\n return result\r\n }\r\n\r\n function separateDynamic (object) {\r\n var staticItems = {};\r\n var dynamicItems = {};\r\n Object.keys(object).forEach(function (option) {\r\n var value = object[option];\r\n if (dynamic.isDynamic(value)) {\r\n dynamicItems[option] = dynamic.unbox(value, option);\r\n } else {\r\n staticItems[option] = value;\r\n }\r\n });\r\n return {\r\n dynamic: dynamicItems,\r\n static: staticItems\r\n }\r\n }\r\n\r\n // Treat context variables separate from other dynamic variables\r\n var context = separateDynamic(options.context || {});\r\n var uniforms = separateDynamic(options.uniforms || {});\r\n var attributes = separateDynamic(options.attributes || {});\r\n var opts = separateDynamic(flattenNestedOptions(options));\r\n\r\n var stats$$1 = {\r\n gpuTime: 0.0,\r\n cpuTime: 0.0,\r\n count: 0\r\n };\r\n\r\n var compiled = core.compile(opts, attributes, uniforms, context, stats$$1);\r\n\r\n var draw = compiled.draw;\r\n var batch = compiled.batch;\r\n var scope = compiled.scope;\r\n\r\n // FIXME: we should modify code generation for batch commands so this\r\n // isn't necessary\r\n var EMPTY_ARRAY = [];\r\n function reserve (count) {\r\n while (EMPTY_ARRAY.length < count) {\r\n EMPTY_ARRAY.push(null);\r\n }\r\n return EMPTY_ARRAY\r\n }\r\n\r\n function REGLCommand (args, body) {\r\n var i;\r\n if (contextLost) {\r\n check$1.raise('context lost');\r\n }\r\n if (typeof args === 'function') {\r\n return scope.call(this, null, args, 0)\r\n } else if (typeof body === 'function') {\r\n if (typeof args === 'number') {\r\n for (i = 0; i < args; ++i) {\r\n scope.call(this, null, body, i);\r\n }\r\n return\r\n } else if (Array.isArray(args)) {\r\n for (i = 0; i < args.length; ++i) {\r\n scope.call(this, args[i], body, i);\r\n }\r\n return\r\n } else {\r\n return scope.call(this, args, body, 0)\r\n }\r\n } else if (typeof args === 'number') {\r\n if (args > 0) {\r\n return batch.call(this, reserve(args | 0), args | 0)\r\n }\r\n } else if (Array.isArray(args)) {\r\n if (args.length) {\r\n return batch.call(this, args, args.length)\r\n }\r\n } else {\r\n return draw.call(this, args)\r\n }\r\n }\r\n\r\n return extend(REGLCommand, {\r\n stats: stats$$1\r\n })\r\n }\r\n\r\n var setFBO = framebufferState.setFBO = compileProcedure({\r\n framebuffer: dynamic.define.call(null, DYN_PROP, 'framebuffer')\r\n });\r\n\r\n function clearImpl (_, options) {\r\n var clearFlags = 0;\r\n core.procs.poll();\r\n\r\n var c = options.color;\r\n if (c) {\r\n gl.clearColor(+c[0] || 0, +c[1] || 0, +c[2] || 0, +c[3] || 0);\r\n clearFlags |= GL_COLOR_BUFFER_BIT;\r\n }\r\n if ('depth' in options) {\r\n gl.clearDepth(+options.depth);\r\n clearFlags |= GL_DEPTH_BUFFER_BIT;\r\n }\r\n if ('stencil' in options) {\r\n gl.clearStencil(options.stencil | 0);\r\n clearFlags |= GL_STENCIL_BUFFER_BIT;\r\n }\r\n\r\n check$1(!!clearFlags, 'called regl.clear with no buffer specified');\r\n gl.clear(clearFlags);\r\n }\r\n\r\n function clear (options) {\r\n check$1(\r\n typeof options === 'object' && options,\r\n 'regl.clear() takes an object as input');\r\n if ('framebuffer' in options) {\r\n if (options.framebuffer &&\r\n options.framebuffer_reglType === 'framebufferCube') {\r\n for (var i = 0; i < 6; ++i) {\r\n setFBO(extend({\r\n framebuffer: options.framebuffer.faces[i]\r\n }, options), clearImpl);\r\n }\r\n } else {\r\n setFBO(options, clearImpl);\r\n }\r\n } else {\r\n clearImpl(null, options);\r\n }\r\n }\r\n\r\n function frame (cb) {\r\n check$1.type(cb, 'function', 'regl.frame() callback must be a function');\r\n rafCallbacks.push(cb);\r\n\r\n function cancel () {\r\n // FIXME: should we check something other than equals cb here?\r\n // what if a user calls frame twice with the same callback...\r\n //\r\n var i = find(rafCallbacks, cb);\r\n check$1(i >= 0, 'cannot cancel a frame twice');\r\n function pendingCancel () {\r\n var index = find(rafCallbacks, pendingCancel);\r\n rafCallbacks[index] = rafCallbacks[rafCallbacks.length - 1];\r\n rafCallbacks.length -= 1;\r\n if (rafCallbacks.length <= 0) {\r\n stopRAF();\r\n }\r\n }\r\n rafCallbacks[i] = pendingCancel;\r\n }\r\n\r\n startRAF();\r\n\r\n return {\r\n cancel: cancel\r\n }\r\n }\r\n\r\n // poll viewport\r\n function pollViewport () {\r\n var viewport = nextState.viewport;\r\n var scissorBox = nextState.scissor_box;\r\n viewport[0] = viewport[1] = scissorBox[0] = scissorBox[1] = 0;\r\n contextState.viewportWidth =\r\n contextState.framebufferWidth =\r\n contextState.drawingBufferWidth =\r\n viewport[2] =\r\n scissorBox[2] = gl.drawingBufferWidth;\r\n contextState.viewportHeight =\r\n contextState.framebufferHeight =\r\n contextState.drawingBufferHeight =\r\n viewport[3] =\r\n scissorBox[3] = gl.drawingBufferHeight;\r\n }\r\n\r\n function poll () {\r\n contextState.tick += 1;\r\n contextState.time = now();\r\n pollViewport();\r\n core.procs.poll();\r\n }\r\n\r\n function refresh () {\r\n pollViewport();\r\n core.procs.refresh();\r\n if (timer) {\r\n timer.update();\r\n }\r\n }\r\n\r\n function now () {\r\n return (clock() - START_TIME) / 1000.0\r\n }\r\n\r\n refresh();\r\n\r\n function addListener (event, callback) {\r\n check$1.type(callback, 'function', 'listener callback must be a function');\r\n\r\n var callbacks;\r\n switch (event) {\r\n case 'frame':\r\n return frame(callback)\r\n case 'lost':\r\n callbacks = lossCallbacks;\r\n break\r\n case 'restore':\r\n callbacks = restoreCallbacks;\r\n break\r\n case 'destroy':\r\n callbacks = destroyCallbacks;\r\n break\r\n default:\r\n check$1.raise('invalid event, must be one of frame,lost,restore,destroy');\r\n }\r\n\r\n callbacks.push(callback);\r\n return {\r\n cancel: function () {\r\n for (var i = 0; i < callbacks.length; ++i) {\r\n if (callbacks[i] === callback) {\r\n callbacks[i] = callbacks[callbacks.length - 1];\r\n callbacks.pop();\r\n return\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n var regl = extend(compileProcedure, {\r\n // Clear current FBO\r\n clear: clear,\r\n\r\n // Short cuts for dynamic variables\r\n prop: dynamic.define.bind(null, DYN_PROP),\r\n context: dynamic.define.bind(null, DYN_CONTEXT),\r\n this: dynamic.define.bind(null, DYN_STATE),\r\n\r\n // executes an empty draw command\r\n draw: compileProcedure({}),\r\n\r\n // Resources\r\n buffer: function (options) {\r\n return bufferState.create(options, GL_ARRAY_BUFFER, false, false)\r\n },\r\n elements: function (options) {\r\n return elementState.create(options, false)\r\n },\r\n texture: textureState.create2D,\r\n cube: textureState.createCube,\r\n renderbuffer: renderbufferState.create,\r\n framebuffer: framebufferState.create,\r\n framebufferCube: framebufferState.createCube,\r\n\r\n // Expose context attributes\r\n attributes: glAttributes,\r\n\r\n // Frame rendering\r\n frame: frame,\r\n on: addListener,\r\n\r\n // System limits\r\n limits: limits,\r\n hasExtension: function (name) {\r\n return limits.extensions.indexOf(name.toLowerCase()) >= 0\r\n },\r\n\r\n // Read pixels\r\n read: readPixels,\r\n\r\n // Destroy regl and all associated resources\r\n destroy: destroy,\r\n\r\n // Direct GL state manipulation\r\n _gl: gl,\r\n _refresh: refresh,\r\n\r\n poll: function () {\r\n poll();\r\n if (timer) {\r\n timer.update();\r\n }\r\n },\r\n\r\n // Current time\r\n now: now,\r\n\r\n // regl Statistics Information\r\n stats: stats$$1\r\n });\r\n\r\n config.onDone(null, regl);\r\n\r\n return regl\r\n}\n\nreturn wrapREGL;\n\n})));\n//# sourceMappingURL=regl.js.map\n","var mouseChange = require('mouse-change')\nvar mouseWheel = require('mouse-wheel')\nvar identity = require('gl-mat4/identity')\nvar perspective = require('gl-mat4/perspective')\nvar lookAt = require('gl-mat4/lookAt')\n\nmodule.exports = createCamera\n\nvar isBrowser = typeof window !== 'undefined'\n\nfunction createCamera (regl, props_) {\n var props = props_ || {}\n\n // Preserve backward-compatibilty while renaming preventDefault -> noScroll\n if (typeof props.noScroll === 'undefined') {\n props.noScroll = props.preventDefault;\n }\n\n var cameraState = {\n view: identity(new Float32Array(16)),\n projection: identity(new Float32Array(16)),\n center: new Float32Array(props.center || 3),\n theta: props.theta || 0,\n phi: props.phi || 0,\n distance: Math.log(props.distance || 10.0),\n eye: new Float32Array(3),\n up: new Float32Array(props.up || [0, 1, 0]),\n fovy: props.fovy || Math.PI / 4.0,\n near: typeof props.near !== 'undefined' ? props.near : 0.01,\n far: typeof props.far !== 'undefined' ? props.far : 1000.0,\n noScroll: typeof props.noScroll !== 'undefined' ? props.noScroll : false,\n flipY: !!props.flipY,\n dtheta: 0,\n dphi: 0,\n rotationSpeed: typeof props.rotationSpeed !== 'undefined' ? props.rotationSpeed : 1,\n zoomSpeed: typeof props.zoomSpeed !== 'undefined' ? props.zoomSpeed : 1,\n renderOnDirty: typeof props.renderOnDirty !== undefined ? !!props.renderOnDirty : false\n }\n\n var element = props.element\n var damping = typeof props.damping !== 'undefined' ? props.damping : 0.9\n\n var right = new Float32Array([1, 0, 0])\n var front = new Float32Array([0, 0, 1])\n\n var minDistance = Math.log('minDistance' in props ? props.minDistance : 0.1)\n var maxDistance = Math.log('maxDistance' in props ? props.maxDistance : 1000)\n\n var ddistance = 0\n\n var prevX = 0\n var prevY = 0\n\n if (isBrowser && props.mouse !== false) {\n var source = element || regl._gl.canvas\n\n function getWidth () {\n return element ? element.offsetWidth : window.innerWidth\n }\n\n function getHeight () {\n return element ? element.offsetHeight : window.innerHeight\n }\n\n mouseChange(source, function (buttons, x, y) {\n if (buttons & 1) {\n var dx = (x - prevX) / getWidth()\n var dy = (y - prevY) / getHeight()\n\n cameraState.dtheta += cameraState.rotationSpeed * 4.0 * dx\n cameraState.dphi += cameraState.rotationSpeed * 4.0 * dy\n cameraState.dirty = true;\n }\n prevX = x\n prevY = y\n })\n\n mouseWheel(source, function (dx, dy) {\n ddistance += dy / getHeight() * cameraState.zoomSpeed\n cameraState.dirty = true;\n }, props.noScroll)\n }\n\n function damp (x) {\n var xd = x * damping\n if (Math.abs(xd) < 0.1) {\n return 0\n }\n cameraState.dirty = true;\n return xd\n }\n\n function clamp (x, lo, hi) {\n return Math.min(Math.max(x, lo), hi)\n }\n\n function updateCamera (props) {\n Object.keys(props).forEach(function (prop) {\n cameraState[prop] = props[prop]\n })\n\n var center = cameraState.center\n var eye = cameraState.eye\n var up = cameraState.up\n var dtheta = cameraState.dtheta\n var dphi = cameraState.dphi\n\n cameraState.theta += dtheta\n cameraState.phi = clamp(\n cameraState.phi + dphi,\n -Math.PI / 2.0,\n Math.PI / 2.0)\n cameraState.distance = clamp(\n cameraState.distance + ddistance,\n minDistance,\n maxDistance)\n\n cameraState.dtheta = damp(dtheta)\n cameraState.dphi = damp(dphi)\n ddistance = damp(ddistance)\n\n var theta = cameraState.theta\n var phi = cameraState.phi\n var r = Math.exp(cameraState.distance)\n\n var vf = r * Math.sin(theta) * Math.cos(phi)\n var vr = r * Math.cos(theta) * Math.cos(phi)\n var vu = r * Math.sin(phi)\n\n for (var i = 0; i < 3; ++i) {\n eye[i] = center[i] + vf * front[i] + vr * right[i] + vu * up[i]\n }\n\n lookAt(cameraState.view, eye, center, up)\n }\n\n cameraState.dirty = true;\n\n var injectContext = regl({\n context: Object.assign({}, cameraState, {\n dirty: function () {\n return cameraState.dirty;\n },\n projection: function (context) {\n perspective(cameraState.projection,\n cameraState.fovy,\n context.viewportWidth / context.viewportHeight,\n cameraState.near,\n cameraState.far)\n if (cameraState.flipY) { cameraState.projection[5] *= -1 }\n return cameraState.projection\n }\n }),\n uniforms: Object.keys(cameraState).reduce(function (uniforms, name) {\n uniforms[name] = regl.context(name)\n return uniforms\n }, {})\n })\n\n function setupCamera (props, block) {\n if (typeof setupCamera.dirty !== 'undefined') {\n cameraState.dirty = setupCamera.dirty || cameraState.dirty\n setupCamera.dirty = undefined;\n }\n\n if (props && block) {\n cameraState.dirty = true;\n }\n\n if (cameraState.renderOnDirty && !cameraState.dirty) return;\n\n if (!block) {\n block = props\n props = {}\n }\n\n updateCamera(props)\n injectContext(block)\n cameraState.dirty = false;\n }\n\n Object.keys(cameraState).forEach(function (name) {\n setupCamera[name] = cameraState[name]\n })\n\n return setupCamera\n}\n","'use strict'\n\nmodule.exports = mouseListen\n\nvar mouse = require('mouse-event')\n\nfunction mouseListen (element, callback) {\n if (!callback) {\n callback = element\n element = window\n }\n\n var buttonState = 0\n var x = 0\n var y = 0\n var mods = {\n shift: false,\n alt: false,\n control: false,\n meta: false\n }\n var attached = false\n\n function updateMods (ev) {\n var changed = false\n if ('altKey' in ev) {\n changed = changed || ev.altKey !== mods.alt\n mods.alt = !!ev.altKey\n }\n if ('shiftKey' in ev) {\n changed = changed || ev.shiftKey !== mods.shift\n mods.shift = !!ev.shiftKey\n }\n if ('ctrlKey' in ev) {\n changed = changed || ev.ctrlKey !== mods.control\n mods.control = !!ev.ctrlKey\n }\n if ('metaKey' in ev) {\n changed = changed || ev.metaKey !== mods.meta\n mods.meta = !!ev.metaKey\n }\n return changed\n }\n\n function handleEvent (nextButtons, ev) {\n var nextX = mouse.x(ev)\n var nextY = mouse.y(ev)\n if ('buttons' in ev) {\n nextButtons = ev.buttons | 0\n }\n if (nextButtons !== buttonState ||\n nextX !== x ||\n nextY !== y ||\n updateMods(ev)) {\n buttonState = nextButtons | 0\n x = nextX || 0\n y = nextY || 0\n callback && callback(buttonState, x, y, mods)\n }\n }\n\n function clearState (ev) {\n handleEvent(0, ev)\n }\n\n function handleBlur () {\n if (buttonState ||\n x ||\n y ||\n mods.shift ||\n mods.alt ||\n mods.meta ||\n mods.control) {\n x = y = 0\n buttonState = 0\n mods.shift = mods.alt = mods.control = mods.meta = false\n callback && callback(0, 0, 0, mods)\n }\n }\n\n function handleMods (ev) {\n if (updateMods(ev)) {\n callback && callback(buttonState, x, y, mods)\n }\n }\n\n function handleMouseMove (ev) {\n if (mouse.buttons(ev) === 0) {\n handleEvent(0, ev)\n } else {\n handleEvent(buttonState, ev)\n }\n }\n\n function handleMouseDown (ev) {\n handleEvent(buttonState | mouse.buttons(ev), ev)\n }\n\n function handleMouseUp (ev) {\n handleEvent(buttonState & ~mouse.buttons(ev), ev)\n }\n\n function attachListeners () {\n if (attached) {\n return\n }\n attached = true\n\n element.addEventListener('mousemove', handleMouseMove)\n\n element.addEventListener('mousedown', handleMouseDown)\n\n element.addEventListener('mouseup', handleMouseUp)\n\n element.addEventListener('mouseleave', clearState)\n element.addEventListener('mouseenter', clearState)\n element.addEventListener('mouseout', clearState)\n element.addEventListener('mouseover', clearState)\n\n element.addEventListener('blur', handleBlur)\n\n element.addEventListener('keyup', handleMods)\n element.addEventListener('keydown', handleMods)\n element.addEventListener('keypress', handleMods)\n\n if (element !== window) {\n window.addEventListener('blur', handleBlur)\n\n window.addEventListener('keyup', handleMods)\n window.addEventListener('keydown', handleMods)\n window.addEventListener('keypress', handleMods)\n }\n }\n\n function detachListeners () {\n if (!attached) {\n return\n }\n attached = false\n\n element.removeEventListener('mousemove', handleMouseMove)\n\n element.removeEventListener('mousedown', handleMouseDown)\n\n element.removeEventListener('mouseup', handleMouseUp)\n\n element.removeEventListener('mouseleave', clearState)\n element.removeEventListener('mouseenter', clearState)\n element.removeEventListener('mouseout', clearState)\n element.removeEventListener('mouseover', clearState)\n\n element.removeEventListener('blur', handleBlur)\n\n element.removeEventListener('keyup', handleMods)\n element.removeEventListener('keydown', handleMods)\n element.removeEventListener('keypress', handleMods)\n\n if (element !== window) {\n window.removeEventListener('blur', handleBlur)\n\n window.removeEventListener('keyup', handleMods)\n window.removeEventListener('keydown', handleMods)\n window.removeEventListener('keypress', handleMods)\n }\n }\n\n // Attach listeners\n attachListeners()\n\n var result = {\n element: element\n }\n\n Object.defineProperties(result, {\n enabled: {\n get: function () { return attached },\n set: function (f) {\n if (f) {\n attachListeners()\n } else {\n detachListeners()\n }\n },\n enumerable: true\n },\n buttons: {\n get: function () { return buttonState },\n enumerable: true\n },\n x: {\n get: function () { return x },\n enumerable: true\n },\n y: {\n get: function () { return y },\n enumerable: true\n },\n mods: {\n get: function () { return mods },\n enumerable: true\n }\n })\n\n return result\n}\n","'use strict'\n\nfunction mouseButtons(ev) {\n if(typeof ev === 'object') {\n if('buttons' in ev) {\n return ev.buttons\n } else if('which' in ev) {\n var b = ev.which\n if(b === 2) {\n return 4\n } else if(b === 3) {\n return 2\n } else if(b > 0) {\n return 1<<(b-1)\n }\n } else if('button' in ev) {\n var b = ev.button\n if(b === 1) {\n return 4\n } else if(b === 2) {\n return 2\n } else if(b >= 0) {\n return 1<<b\n }\n }\n }\n return 0\n}\nexports.buttons = mouseButtons\n\nfunction mouseElement(ev) {\n return ev.target || ev.srcElement || window\n}\nexports.element = mouseElement\n\nfunction mouseRelativeX(ev) {\n if(typeof ev === 'object') {\n if('offsetX' in ev) {\n return ev.offsetX\n }\n var target = mouseElement(ev)\n var bounds = target.getBoundingClientRect()\n return ev.clientX - bounds.left\n }\n return 0\n}\nexports.x = mouseRelativeX\n\nfunction mouseRelativeY(ev) {\n if(typeof ev === 'object') {\n if('offsetY' in ev) {\n return ev.offsetY\n }\n var target = mouseElement(ev)\n var bounds = target.getBoundingClientRect()\n return ev.clientY - bounds.top\n }\n return 0\n}\nexports.y = mouseRelativeY\n","'use strict'\n\nvar toPX = require('to-px')\n\nmodule.exports = mouseWheelListen\n\nfunction mouseWheelListen(element, callback, noScroll) {\n if(typeof element === 'function') {\n noScroll = !!callback\n callback = element\n element = window\n }\n var lineHeight = toPX('ex', element)\n var listener = function(ev) {\n if(noScroll) {\n ev.preventDefault()\n }\n var dx = ev.deltaX || 0\n var dy = ev.deltaY || 0\n var dz = ev.deltaZ || 0\n var mode = ev.deltaMode\n var scale = 1\n switch(mode) {\n case 1:\n scale = lineHeight\n break\n case 2:\n scale = window.innerHeight\n break\n }\n dx *= scale\n dy *= scale\n dz *= scale\n if(dx || dy || dz) {\n return callback(dx, dy, dz, ev)\n }\n }\n element.addEventListener('wheel', listener)\n return listener\n}\n","'use strict'\n\nvar parseUnit = require('parse-unit')\n\nmodule.exports = toPX\n\nvar PIXELS_PER_INCH = getSizeBrutal('in', document.body) // 96\n\n\nfunction getPropertyInPX(element, prop) {\n var parts = parseUnit(getComputedStyle(element).getPropertyValue(prop))\n return parts[0] * toPX(parts[1], element)\n}\n\n//This brutal hack is needed\nfunction getSizeBrutal(unit, element) {\n var testDIV = document.createElement('div')\n testDIV.style['height'] = '128' + unit\n element.appendChild(testDIV)\n var size = getPropertyInPX(testDIV, 'height') / 128\n element.removeChild(testDIV)\n return size\n}\n\nfunction toPX(str, element) {\n if (!str) return null\n\n element = element || document.body\n str = (str + '' || 'px').trim().toLowerCase()\n if(element === window || element === document) {\n element = document.body\n }\n\n switch(str) {\n case '%': //Ambiguous, not sure if we should use width or height\n return element.clientHeight / 100.0\n case 'ch':\n case 'ex':\n return getSizeBrutal(str, element)\n case 'em':\n return getPropertyInPX(element, 'font-size')\n case 'rem':\n return getPropertyInPX(document.body, 'font-size')\n case 'vw':\n return window.innerWidth/100\n case 'vh':\n return window.innerHeight/100\n case 'vmin':\n return Math.min(window.innerWidth, window.innerHeight) / 100\n case 'vmax':\n return Math.max(window.innerWidth, window.innerHeight) / 100\n case 'in':\n return PIXELS_PER_INCH\n case 'cm':\n return PIXELS_PER_INCH / 2.54\n case 'mm':\n return PIXELS_PER_INCH / 25.4\n case 'pt':\n return PIXELS_PER_INCH / 72\n case 'pc':\n return PIXELS_PER_INCH / 6\n case 'px':\n return 1\n }\n\n // detect number of units\n var parts = parseUnit(str)\n if (!isNaN(parts[0]) && parts[1]) {\n var px = toPX(parts[1], element)\n return typeof px === 'number' ? parts[0] * px : null\n }\n\n return null\n}\n","module.exports = function parseUnit(str, out) {\n if (!out)\n out = [ 0, '' ]\n\n str = String(str)\n var num = parseFloat(str, 10)\n out[0] = num\n out[1] = str.match(/[\\d.\\-\\+]*\\s*(.*)/)[1] || ''\n return out\n}","module.exports = perspective;\n\n/**\n * Generates a perspective projection matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nfunction perspective(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf = 1 / (near - far);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = (2 * far * near) * nf;\n out[15] = 0;\n return out;\n};","var identity = require('./identity');\n\nmodule.exports = lookAt;\n\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {vec3} eye Position of the viewer\n * @param {vec3} center Point the viewer is looking at\n * @param {vec3} up vec3 pointing up\n * @returns {mat4} out\n */\nfunction lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len,\n eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2],\n centerx = center[0],\n centery = center[1],\n centerz = center[2];\n\n if (Math.abs(eyex - centerx) < 0.000001 &&\n Math.abs(eyey - centery) < 0.000001 &&\n Math.abs(eyez - centerz) < 0.000001) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n\n len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n\n return out;\n};"],"sourceRoot":""} |