// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/layers/vectorTiles/views/vectorTiles/tileRendrerHelper3D",["require","exports","../../core/libs/gl-matrix/vec3","../../core/libs/gl-matrix/mat4"],function(u,v,r,n){var t={extent:{xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:{wkid:102100,isWrappable:!0},intersects:function(a){return!1}},center:[0,0],scale:1,resolution:1,rotation:0,width:1,height:1,size:[256,256],spatialReference:{wkid:102100,isWrappable:!0},worldScreenWidth:1,viewpoint:{},toMap:function(a,b){return[0,0]},toScreen:function(a,
b){return[0,0]},clone:function(){return null}},p=r.create();return function(a,b,d,q,f,g,k,m,c,e,h){c=[b[0],b[1],b[2]];for(var l=e;1>l;l*=2)c[0]--,c[1]>>=1,c[2]>>=1;b={context:a,budget:null,state:t,stationary:!0,devicePixelRatio:1,displayLevel:f.adjustLevel(g),requiredLevel:f.adjustLevel(b[0]),drawphase:0,renderer:q};if(k!==m)throw Error("It is expected that tiles are square!");g=1/e;f=f.getSchemaShift(c,g);l=f[1];d.tileTransform.displayCoord[0]=-1-2*g*h[0]-f[0];d.tileTransform.displayCoord[1]=1+2*
g*(1-h[1]-e)+l;e=d.tileTransform.transform;n.identity(e);h=.25*g/k;p.set([h,-h,1]);n.scale(e,e,p);a.setBlendFunctionSeparate(1,771,1,771);a.setClearDepth(1);a.clear(a.gl.DEPTH_BUFFER_BIT);b.state.size=[k,m];b.state.width=k;b.state.height=m;q.setStateParams(b.state,b.devicePixelRatio,c[0]);d.attach(b);a.setFaceCullingEnabled(!1);a.setDepthFunction(515);a.setBlendingEnabled(!1);a.setDepthTestEnabled(!0);a.setDepthWriteEnabled(!0);d.render(b);a.setDepthWriteEnabled(!1);a.setBlendingEnabled(!0);b.drawphase=
1;d.render(b);b.drawphase=2;d.render(b);a.setDepthWriteEnabled(!0);a.setDepthTestEnabled(!1);a.setFaceCullingEnabled(!0)}});