glre 0.28.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/native.cjs CHANGED
@@ -1,7 +1,11 @@
1
- "use strict";var Q=Object.defineProperty;var Ze=Object.getOwnPropertyDescriptor;var Qe=Object.getOwnPropertyNames;var Je=Object.prototype.hasOwnProperty;var et=(e,t)=>{for(var r in t)Q(e,r,{get:t[r],enumerable:!0})},tt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Qe(t))!Je.call(e,n)&&n!==r&&Q(e,n,{get:()=>t[n],enumerable:!(o=Ze(t,n))||o.enumerable});return e};var rt=e=>tt(Q({},"__esModule",{value:!0}),e);var xo={};et(xo,{ADDITIONAL_FUNCTIONS:()=>Fe,BOOL_RETURN_FUNCTIONS:()=>B,BUILTIN_TYPES:()=>oe,COMPARISON_OPERATORS:()=>ne,COMPONENT_COUNT_TO_TYPE:()=>q,CONSTANTS:()=>L,CONVERSIONS:()=>J,FIRST_ARG_TYPE_FUNCTIONS:()=>M,FUNCTIONS:()=>te,Fn:()=>Xt,HIGHEST_TYPE_FUNCTIONS:()=>W,If:()=>bt,LOGICAL_OPERATORS:()=>se,Loop:()=>gt,OPERATORS:()=>F,OPERATOR_KEYS:()=>ee,PRESERVE_TYPE_FUNCTIONS:()=>z,SCALAR_RETURN_FUNCTIONS:()=>$,SWIZZLES:()=>ct,Switch:()=>vt,TYPE_MAPPING:()=>re,VEC3_RETURN_FUNCTIONS:()=>V,VEC4_RETURN_FUNCTIONS:()=>D,abs:()=>ur,acos:()=>cr,alignTo256:()=>Ye,all:()=>fr,any:()=>pr,asin:()=>lr,assign:()=>de,atan:()=>mr,atan2:()=>dr,attribute:()=>Ct,bitcast:()=>xr,bool:()=>Wt,bvec2:()=>tr,bvec3:()=>rr,bvec4:()=>or,cbrt:()=>br,ceil:()=>gr,clamp:()=>vr,code:()=>c,color:()=>nr,cos:()=>Xr,createAttrib:()=>Te,createBindGroup:()=>Se,createBufferLayout:()=>Le,createDescriptor:()=>Ne,createDevice:()=>_e,createGL:()=>Ie,createIbo:()=>Xe,createPipeline:()=>Pe,createProgram:()=>ge,createTexture:()=>Ee,createTextureSampler:()=>Ce,createUniformBuffer:()=>we,createVbo:()=>ve,createVertexBuffer:()=>Re,cross:()=>yr,cubeTexture:()=>ir,dFdx:()=>Tr,dFdy:()=>Er,defaultFragmentGLSL:()=>qe,defaultVertexGLSL:()=>De,degrees:()=>hr,difference:()=>_r,dig:()=>at,distance:()=>Pr,dot:()=>Sr,each:()=>Ae,equals:()=>Nr,exp:()=>Rr,exp2:()=>wr,ext:()=>st,f:()=>i,faceforward:()=>Cr,fig:()=>it,float:()=>zt,floor:()=>Lr,flush:()=>ot,formatConversions:()=>O,fract:()=>Or,fragment:()=>G,fwidth:()=>Ur,getId:()=>S,getOperator:()=>pe,getStride:()=>ye,hex2rgb:()=>fe,iMouse:()=>Pt,iResolution:()=>_t,iTime:()=>St,infer:()=>_,inferParameterTypes:()=>xt,int:()=>Vt,inverseSqrt:()=>Gr,is:()=>l,isConversion:()=>ue,isFunction:()=>ae,isGL:()=>Ge,isNodeProxy:()=>ce,isOperator:()=>ie,isServer:()=>ke,isSwizzle:()=>Y,isWebGPUSupported:()=>je,ivec2:()=>Ht,ivec3:()=>Kt,ivec4:()=>Zt,joins:()=>k,length:()=>Ir,lengthSq:()=>Ar,log:()=>Fr,log2:()=>$r,mat2:()=>Yt,mat3:()=>kt,mat4:()=>jt,max:()=>Br,min:()=>zr,mix:()=>Vr,n:()=>b,negate:()=>Mr,node:()=>u,normalLocal:()=>It,normalView:()=>Ft,normalWorld:()=>At,normalize:()=>Wr,o:()=>Me,oneMinus:()=>Dr,position:()=>Nt,positionLocal:()=>Ot,positionView:()=>Gt,positionWorld:()=>Ut,pow:()=>qr,pow2:()=>Yr,pow3:()=>kr,pow4:()=>jr,radians:()=>Hr,reciprocal:()=>Kr,reflect:()=>Zr,refract:()=>Qr,replace:()=>nt,round:()=>Jr,s:()=>xe,saturate:()=>eo,screenCoordinate:()=>$t,screenUV:()=>Bt,select:()=>ht,sig:()=>ut,sign:()=>to,sin:()=>ro,smoothstep:()=>oo,sqrt:()=>no,step:()=>so,tan:()=>io,texture:()=>sr,textureSize:()=>ar,toConst:()=>me,toVar:()=>le,transformDirection:()=>ao,trunc:()=>uo,u:()=>A,uint:()=>Mt,useGL:()=>mo,uv:()=>Rt,uvec2:()=>Qt,uvec3:()=>Jt,uvec4:()=>er,v:()=>Et,varying:()=>yt,vec2:()=>Dt,vec3:()=>be,vec4:()=>qt,vertex:()=>I,vertexColor:()=>wt,vertexStage:()=>Lt,webgl:()=>he,webgpu:()=>Oe});module.exports=rt(xo);var He=require("react");var U=require("reev"),K=require("refr");var j=require("reev");var l={arr:Array.isArray,bol:e=>typeof e=="boolean",str:e=>typeof e=="string",num:e=>typeof e=="number",int:e=>Number.isInteger(e),fun:e=>typeof e=="function",und:e=>typeof e>"u",nul:e=>e===null,set:e=>e instanceof Set,map:e=>e instanceof Map,obj:e=>!!e&&e.constructor.name==="Object",nan:e=>typeof e=="number"&&Number.isNaN(e)},Ae=(e,t)=>e.forEach(t),ot=(e,...t)=>{Ae(e,r=>r(...t))},nt=(e="",t="_",r="/")=>e.split(t).join(r),st=(e=".pdf")=>e.split(".").pop()?.toLowerCase()??"",it=(e=0)=>`${e}`.split(".")[1]?.length??0,at=(e=0)=>`${e}`.split(".")[0]?.length-(e<0?1:0),ut=(e=0,t=-2)=>(t*=-1,t=Math.pow(10,t),e*=t,e=Math.round(e),e/=t,e);var ct=["x","y","z","w","r","g","b","a","s","t","p","q"],L=["bool","uint","int","float","bvec2","bvec3","bvec4","ivec2","ivec3","ivec4","uvec2","uvec3","uvec4","vec2","vec3","vec4","color","mat2","mat3","mat4"],J=["toFloat","toInt","toUint","toBool","toVec2","toVec3","toVec4","toIvec2","toIvec3","toIvec4","toUvec2","toUvec3","toUvec4","toBvec2","toBvec3","toBvec4","toMat2","toMat3","toMat4","toColor"],F={add:"+",sub:"-",mul:"*",div:"/",mod:"%",equal:"==",notEqual:"!=",lessThan:"<",lessThanEqual:"<=",greaterThan:">",greaterThanEqual:">=",and:"&&",or:"||",bitAnd:"&",bitOr:"|",bitXor:"^",shiftLeft:"<<",shiftRight:">>"},ee=Object.keys(F),$=["dot","distance","length","lengthSq","determinant","luminance"],B=["all","any"],z=["abs","sign","floor","ceil","round","fract","trunc","sin","cos","tan","asin","acos","atan","exp","exp2","log","log2","sqrt","inverseSqrt","normalize","oneMinus","saturate","negate","reciprocal","dFdx","dFdy","fwidth"],V=["cross"],M=["reflect","refract"],W=["min","max","mix","clamp","step","smoothstep"],D=["texture","textureLod","textureSize","cubeTexture"],Fe=["atan2","degrees","faceforward","bitcast","cbrt","difference","equals","pow","pow2","pow3","pow4","radians","transformDirection"],te=[...$,...B,...z,...V,...M,...W,...D,...Fe],re={float:"f32",int:"i32",uint:"u32",bool:"bool",vec2:"vec2f",vec3:"vec3f",vec4:"vec4f",mat2:"mat2x2f",mat3:"mat3x3f",mat4:"mat4x4f",ivec2:"vec2i",ivec3:"vec3i",ivec4:"vec4i",uvec2:"vec2u",uvec3:"vec3u",uvec4:"vec4u",bvec2:"vec2<bool>",bvec3:"vec3<bool>",bvec4:"vec4<bool>"},q={1:"float",2:"vec2",3:"vec3",4:"vec4",9:"mat3",16:"mat4"},oe={gl_FragCoord:"vec4",position:"vec3",normal:"vec3",uv:"vec2",color:"vec4"},ne=["equal","notEqual","lessThan","lessThanEqual","greaterThan","greaterThanEqual"],se=["and","or"];var Y=e=>l.str(e)&&/^[xyzwrgbastpq]{1,4}$/.test(e),ie=e=>ee.includes(e),ae=e=>te.includes(e),ue=e=>J.includes(e),ce=e=>!e||!l.fun(e)?!1:e.isProxy,ft=0,fe=e=>{let t=(e>>16&255)/255,r=(e>>8&255)/255,o=(e&255)/255;return[t,r,o]},S=()=>`i${ft++}`,k=(e,t)=>e.filter(r=>!l.und(r)&&!l.nul(r)).map(r=>c(r,t)).join(", "),O=(e,t)=>l.str(e)?t?.isWebGL?e:re[e]:"",pe=e=>F[e]||e,$e=e=>{let t=Array.from(e.uniforms).map((o,n)=>e.isWebGL?`uniform ${o};`:`@group(0) @binding(${n}) var<uniform> ${o};`).join(`
2
- `),r=Array.from(e.functions).join(`
3
- `);return`${t}
4
- ${r}`},Be=(e,t,r=!0)=>r?`
1
+ "use strict";var J=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var ot=Object.prototype.hasOwnProperty;var nt=(e,t)=>{for(var r in t)J(e,r,{get:t[r],enumerable:!0})},st=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rt(t))!ot.call(e,o)&&o!==r&&J(e,o,{get:()=>t[o],enumerable:!(n=tt(t,o))||n.enumerable});return e};var it=e=>st(J({},"__esModule",{value:!0}),e);var ho={};nt(ho,{ADDITIONAL_FUNCTIONS:()=>$e,BOOL_RETURN_FUNCTIONS:()=>z,BUILTIN_TYPES:()=>ne,COMPARISON_OPERATORS:()=>se,COMPONENT_COUNT_TO_TYPE:()=>k,CONSTANTS:()=>C,CONVERSIONS:()=>ee,FIRST_ARG_TYPE_FUNCTIONS:()=>D,FUNCTIONS:()=>re,Fn:()=>_t,HIGHEST_TYPE_FUNCTIONS:()=>W,If:()=>yt,LOGICAL_OPERATORS:()=>ie,Loop:()=>Xt,OPERATORS:()=>$,OPERATOR_KEYS:()=>te,PRESERVE_TYPE_FUNCTIONS:()=>M,SCALAR_RETURN_FUNCTIONS:()=>B,SWIZZLES:()=>mt,Switch:()=>Tt,TYPE_MAPPING:()=>oe,VEC3_RETURN_FUNCTIONS:()=>V,VEC4_RETURN_FUNCTIONS:()=>q,WGSL_TO_GLSL_BUILTIN:()=>ae,abs:()=>gr,acos:()=>br,alignTo256:()=>Ke,all:()=>vr,any:()=>yr,asin:()=>Xr,assign:()=>xe,atan:()=>Tr,atan2:()=>_r,attribute:()=>Nt,bitcast:()=>hr,bool:()=>Zt,builtin:()=>wt,bvec2:()=>cr,bvec3:()=>pr,bvec4:()=>fr,cbrt:()=>Er,ceil:()=>Pr,clamp:()=>Nr,code:()=>p,color:()=>lr,conversion:()=>b,cos:()=>Sr,createAttrib:()=>_e,createBindGroup:()=>Se,createBufferLayout:()=>Oe,createDescriptor:()=>we,createDevice:()=>Pe,createGL:()=>Fe,createIbo:()=>Xe,createPipeline:()=>Ne,createProgram:()=>ve,createTexture:()=>he,createTextureSampler:()=>Ce,createUniformBuffer:()=>Le,createVbo:()=>ye,createVertexBuffer:()=>Re,cross:()=>wr,cubeTexture:()=>dr,dFdx:()=>Rr,dFdy:()=>Lr,defaultFragmentGLSL:()=>He,defaultVertexGLSL:()=>je,degrees:()=>Cr,difference:()=>Or,dig:()=>ft,distance:()=>Ir,dot:()=>Gr,each:()=>Ae,equals:()=>Ur,exp:()=>Fr,exp2:()=>Ar,ext:()=>ct,faceforward:()=>$r,fig:()=>pt,float:()=>jt,floor:()=>Br,flush:()=>at,formatConversions:()=>w,fract:()=>zr,fragCoord:()=>kt,fragDepth:()=>Gt,fragment:()=>U,frontFacing:()=>It,function_:()=>i,fwidth:()=>Mr,generateDefine:()=>me,getId:()=>I,getOperator:()=>le,getStride:()=>Te,hex2rgb:()=>fe,iMouse:()=>Lt,iResolution:()=>Rt,iTime:()=>Ct,infer:()=>_,inferImpl:()=>De,instanceIndex:()=>Ot,int:()=>Ht,inverseSqrt:()=>Vr,is:()=>g,isConversion:()=>pe,isFunction:()=>ce,isGL:()=>Ue,isNodeProxy:()=>S,isOperator:()=>ue,isServer:()=>Ze,isSwizzle:()=>Y,isWebGPUSupported:()=>Qe,ivec2:()=>or,ivec3:()=>nr,ivec4:()=>sr,joins:()=>G,length:()=>Dr,lengthSq:()=>Wr,log:()=>qr,log2:()=>kr,mat2:()=>er,mat3:()=>tr,mat4:()=>rr,max:()=>Yr,min:()=>jr,mix:()=>Hr,negate:()=>Kr,node:()=>c,normalLocal:()=>Mt,normalView:()=>Dt,normalWorld:()=>Vt,normalize:()=>Zr,oneMinus:()=>Qr,operator:()=>We,pointCoord:()=>At,position:()=>qe,positionLocal:()=>$t,positionView:()=>zt,positionWorld:()=>Bt,pow:()=>Jr,pow2:()=>eo,pow3:()=>to,pow4:()=>ro,radians:()=>oo,reciprocal:()=>no,reflect:()=>so,refract:()=>io,replace:()=>ut,round:()=>ao,sampleIndex:()=>Ut,sampleMask:()=>Ft,saturate:()=>uo,screenCoordinate:()=>Wt,screenUV:()=>qt,select:()=>Et,sig:()=>lt,sign:()=>co,sin:()=>po,smoothstep:()=>fo,sqrt:()=>lo,step:()=>mo,swizzle:()=>ge,tan:()=>xo,texture:()=>mr,textureSize:()=>xr,toVar:()=>de,transformDirection:()=>go,trunc:()=>bo,uint:()=>Kt,uniform:()=>j,useGL:()=>_o,uvec2:()=>ir,uvec3:()=>ar,uvec4:()=>ur,variable:()=>St,varying:()=>Pt,vec2:()=>Qt,vec3:()=>be,vec4:()=>Jt,vertex:()=>F,vertexId:()=>Yt,vertexIndex:()=>ke,webgl:()=>Ee,webgpu:()=>Ie});module.exports=it(ho);var Je=require("react");var O=require("reev"),Z=require("refr");var H=require("reev");var g={arr:Array.isArray,bol:e=>typeof e=="boolean",str:e=>typeof e=="string",num:e=>typeof e=="number",int:e=>Number.isInteger(e),fun:e=>typeof e=="function",und:e=>typeof e>"u",nul:e=>e===null,set:e=>e instanceof Set,map:e=>e instanceof Map,obj:e=>!!e&&e.constructor.name==="Object",nan:e=>typeof e=="number"&&Number.isNaN(e)},Ae=(e,t)=>e.forEach(t),at=(e,...t)=>{Ae(e,r=>r(...t))},ut=(e="",t="_",r="/")=>e.split(t).join(r),ct=(e=".pdf")=>e.split(".").pop()?.toLowerCase()??"",pt=(e=0)=>`${e}`.split(".")[1]?.length??0,ft=(e=0)=>`${e}`.split(".")[0]?.length-(e<0?1:0),lt=(e=0,t=-2)=>(t*=-1,t=Math.pow(10,t),e*=t,e=Math.round(e),e/=t,e);var mt=["x","y","z","w","r","g","b","a","s","t","p","q"],C=["bool","uint","int","float","bvec2","bvec3","bvec4","ivec2","ivec3","ivec4","uvec2","uvec3","uvec4","vec2","vec3","vec4","color","mat2","mat3","mat4"],ee=["toFloat","toInt","toUint","toBool","toVec2","toVec3","toVec4","toIvec2","toIvec3","toIvec4","toUvec2","toUvec3","toUvec4","toBvec2","toBvec3","toBvec4","toMat2","toMat3","toMat4","toColor"],$={add:"+",sub:"-",mul:"*",div:"/",mod:"%",equal:"==",notEqual:"!=",lessThan:"<",lessThanEqual:"<=",greaterThan:">",greaterThanEqual:">=",and:"&&",or:"||",bitAnd:"&",bitOr:"|",bitXor:"^",shiftLeft:"<<",shiftRight:">>"},te=Object.keys($),B=["dot","distance","length","lengthSq","determinant","luminance"],z=["all","any"],M=["abs","sign","floor","ceil","round","fract","trunc","sin","cos","tan","asin","acos","atan","exp","exp2","log","log2","sqrt","inverseSqrt","normalize","oneMinus","saturate","negate","reciprocal","dFdx","dFdy","fwidth"],V=["cross"],D=["reflect","refract"],W=["min","max","mix","clamp","step","smoothstep"],q=["texture","textureLod","textureSize","cubeTexture"],$e=["atan2","degrees","faceforward","bitcast","cbrt","difference","equals","pow","pow2","pow3","pow4","radians","transformDirection"],re=[...B,...z,...M,...V,...D,...W,...q,...$e],oe={float:"f32",int:"i32",uint:"u32",bool:"bool",vec2:"vec2f",vec3:"vec3f",vec4:"vec4f",mat2:"mat2x2f",mat3:"mat3x3f",mat4:"mat4x4f",ivec2:"vec2i",ivec3:"vec3i",ivec4:"vec4i",uvec2:"vec2u",uvec3:"vec3u",uvec4:"vec4u",bvec2:"vec2<bool>",bvec3:"vec3<bool>",bvec4:"vec4<bool>"},k={1:"float",2:"vec2",3:"vec3",4:"vec4",9:"mat3",16:"mat4"},ne={position:"vec4",vertex_index:"uint",instance_index:"uint",front_facing:"bool",frag_depth:"float",sample_index:"uint",sample_mask:"uint",point_coord:"vec2",positionLocal:"vec3",positionWorld:"vec3",positionView:"vec3",normalLocal:"vec3",normalWorld:"vec3",normalView:"vec3",screenCoordinate:"vec2",screenUV:"vec2",gl_FragCoord:"vec4",gl_VertexID:"uint",gl_InstanceID:"uint",gl_FrontFacing:"bool",gl_FragDepth:"float",gl_SampleID:"uint",gl_SampleMask:"uint",gl_PointCoord:"vec2",normal:"vec3",uv:"vec2",color:"vec4"},se=["equal","notEqual","lessThan","lessThanEqual","greaterThan","greaterThanEqual"],ie=["and","or"],ae={position:"gl_FragCoord",vertex_index:"gl_VertexID",instance_index:"gl_InstanceID",front_facing:"gl_FrontFacing",frag_depth:"gl_FragDepth",sample_index:"gl_SampleID",sample_mask:"gl_SampleMask",point_coord:"gl_PointCoord"};var Y=e=>g.str(e)&&/^[xyzwrgbastpq]{1,4}$/.test(e),ue=e=>te.includes(e),ce=e=>re.includes(e),pe=e=>ee.includes(e),S=e=>!e||typeof e!="object"?!1:e.isProxy,dt=0,fe=e=>{let t=(e>>16&255)/255,r=(e>>8&255)/255,n=(e&255)/255;return[t,r,n]},I=()=>`i${dt++}`,G=(e,t)=>e.filter(r=>!g.und(r)&&!g.nul(r)).map(r=>p(r,t)).join(", "),w=(e,t)=>g.str(e)?t?.isWebGL?e:oe[e]:"",le=e=>$[e]||e,Be=e=>Array.from(e.headers).map(([,t])=>t).join(`
2
+ `),me=(e,t)=>{let{id:r,children:n=[]}=e,[o,s,...u]=n,a=s?_(s,t):"void",m=u.map((h,T)=>[`p${T}`,_(h,t)]),y=[p(o,t)];if(s&&y.push(`return ${p(s,t)};`),t?.isWebGL){let h=m.map(([T,E])=>`${E} ${T}`);return`${a} ${r}(${h}) {
3
+ ${y.join(`
4
+ `)}
5
+ }`}let f=w(a,t),d=m.map(([h,T])=>`${h}: ${w(T,t)}`);return`fn ${r}(${d}) -> ${f} {
6
+ ${y.join(`
7
+ `)}
8
+ }`},ze=(e,t,r=!0)=>r?`
5
9
  #version 300 es
6
10
  precision mediump float;
7
11
  out vec4 fragColor;
@@ -13,34 +17,34 @@ ${t}
13
17
  @fragment
14
18
  fn main(@builtin(position) position: vec4f) -> @location(0) vec4f {
15
19
  return ${e};
16
- }`.trim(),G=(e,t)=>{let r=c(e,t),o=$e(t);return Be(r,o,t.isWebGL)},I=(e,t)=>{let r=c(e,t),o=$e(t);return Be(r,o,t.isWebGL)};var ze=e=>l.bol(e)?"bool":l.num(e)?Number.isInteger(e)?"int":"float":l.arr(e)&&q[e.length]||"float",Ve=(e,t,r)=>{if(ne.includes(r)||se.includes(r))return"bool";if(e===t||e.includes("vec")&&!t.includes("vec"))return e;if(t.includes("vec")&&!e.includes("vec"))return t;let o=L.indexOf(e),n=L.indexOf(t);return o>=n?e:t},pt=e=>e.reduce((t,r)=>{let o=_(r),n=L.indexOf(t);return L.indexOf(o)>n?o:t},"float"),lt=e=>q[e]||"vec4",mt=e=>e?oe[e]:"vec3",dt=(e,t)=>{let r=t.length>0?_(t[0]):"float";return M.includes(e)?r:$.includes(e)?"float":B.includes(e)?"bool":z.includes(e)?r:V.includes(e)?"vec3":D.includes(e)?"vec4":W.includes(e)?pt(t):r},_=(e,t)=>{if(!e)throw"";if(!ce(e))return ze(e);let{type:r,props:o}=e,{id:n,children:s=[],value:a,returnType:f}=o,[X,p,m]=s;return r==="uniform"||r==="variable"||r==="constant"||r==="attribute"||r==="varying"?ze(a):r==="conversions"?X:r==="operator"?Ve(_(p,t),_(m,t),X):r==="math_fun"?dt(X,s.slice(1)):r==="swizzle"?lt(X.length):r==="ternary"?Ve(_(p,t),_(m,t),"add"):r==="fn_run"||r==="fn_def"?f:r==="builtin"?mt(n):"float"},xt=(e,t)=>e.map(r=>_(r,t));var c=(e,t)=>{if(t||(t={}),t.uniforms||(t.uniforms=new Set),t.functions||(t.functions=new Set),l.num(e))return e.toFixed(1);if(l.str(e))return e;if(l.bol(e))return e.toString();if(!e)return"";let{type:r,props:o}=e,{id:n="",children:s=[]}=o,[a,f,X]=s;if(r==="uniform"){let p=_(e,t);return t.uniforms.add(`${p} ${n}`),t.onUniform?.(n,o.value),n}if(r==="variable"||r==="varying"||r==="constant"||r==="attribute")return n;if(r==="vertex_stage")return c(a,t);if(r==="swizzle")return`${c(f,t)}.${c(a,t)}`;if(r==="operator")return a==="not"||a==="bitNot"?`!${c(f,t)}`:`(${c(f,t)} ${pe(a)} ${c(X,t)})`;if(r==="math_fun")return`${a}(${k(s.slice(1),t)})`;if(r==="conversions")return`${O(a,t)}(${k(s.slice(1),t)})`;if(r==="scope")return s.map(p=>c(p,t)).join(`
17
- `);if(r==="assign")return`${c(a,t)} = ${c(f,t)};`;if(r==="fn_run")return t.functions.add(c(a,t)),`${n}(${s.slice(1).map(p=>c(p,t)).join(", ")})`;if(r==="fn_def"){let{paramInfo:p=[],returnType:m}=o,y=c(a,t),C=f?`return ${c(f,t)};`:"";if(t?.isWebGL){let T=p.map(({name:E,type:h})=>`${h} ${E}`).join(", ");return`${m} ${n}(${T}) {
18
- ${y}
19
- ${C}
20
- }`}else{let T=O(m,t),E=p.map(({name:h,type:P})=>{let g=O(P,t);return`${h}: ${g}`}).join(", ");return`fn ${n}(${E}) -> ${T} {
21
- ${y}
22
- ${C}
23
- }`}}if(r==="loop")return`for (int i = 0; i < ${a}; i++) {
24
- ${c(f,t)}
25
- }`;if(r==="if"){let p=`if (${c(a,t)}) {
26
- ${c(f,t)}
27
- }`;for(let m=2;m<s.length;m+=2){let y=m>=s.length-1;p+=y?` else {
28
- ${c(s[m],t)}
29
- }`:` else if (${c(s[m],t)}) {
30
- ${c(s[m+1],t)}
31
- }`}return p}if(r==="switch"){let p=`switch (${c(a,t)}) {
32
- `;for(let m of s.slice(1))p+=c(m,t)+`
33
- `;return p+="}",p}if(r==="case"){let p=s.slice(0,-1),m=s[s.length-1],y="";for(let C of p)y+=`case ${c(C,t)}:
34
- `;return y+=`${c(m,t)}
20
+ }`.trim(),U=(e,t={})=>{let r=p(e,t),n=Be(t),o=ze(r,n,t.isWebGL);return console.log(`// \u2193\u2193\u2193 generated \u2193\u2193\u2193
21
+
22
+ ${o}
23
+
24
+ `),o},F=(e,t)=>{let r=p(e,t),n=Be(t);return ze(r,n,t.isWebGL)};var Ve=e=>g.bol(e)?"bool":g.num(e)?"float":g.arr(e)&&k[e.length]||"float",Me=(e,t,r)=>{if(se.includes(r)||ie.includes(r))return"bool";if(e===t||e.includes("vec")&&!t.includes("vec"))return e;if(t.includes("vec")&&!e.includes("vec"))return t;let n=C.indexOf(e),o=C.indexOf(t);return n>=o?e:t},xt=(e,t)=>e.reduce((r,n)=>{let o=_(n,t),s=C.indexOf(r);return C.indexOf(o)>s?o:r},"float"),gt=e=>k[e],bt=e=>ne[e],vt=(e,t,r)=>{let n=t.length>0?_(t[0],r):"float";return D.includes(e)?n:B.includes(e)?"float":z.includes(e)?"bool":M.includes(e)?n:V.includes(e)?"vec3":q.includes(e)?"vec4":W.includes(e)?xt(t,r):n},De=(e,t)=>{let{type:r,props:n}=e,{id:o,children:s=[],value:u}=n,[a,m,y]=s;return r==="uniform"||r==="variable"||r==="constant"||r==="attribute"||r==="varying"?Ve(u):r==="conversion"?a:r==="operator"?Me(_(m,t),_(y,t),a):r==="function"?vt(a,s.slice(1),t):r==="swizzle"?gt(a.length):r==="ternary"?Me(_(m,t),_(y,t),"add"):r==="define"?m?_(m,t):"void":r==="builtin"?bt(o):"float"},_=(e,t)=>{if(t||(t={}),!S(e))return Ve(e);if(t.infers||(t.infers=new WeakMap),t.infers.has(e))return t.infers.get(e);let r=De(e,t);return t.infers.set(e,r),r};var p=(e,t)=>{if(t||(t={}),t.headers||(t.headers=new Map),g.str(e))return e;if(g.num(e))return e.toFixed(1);if(g.bol(e))return e?"true":"false";if(!e)return"";let{type:r,props:n}=e,{id:o="",children:s=[]}=n,[u,a,m]=s,y="";if(r==="uniform"){if(t.headers.has(o))return o;t.binding||(t.binding=0);let f=_(e,t);y=t.isWebGL?`uniform ${f} ${o};`:`@group(0) @binding(${t.binding++}) var<uniform> ${o}: ${w(f,t)};`}if(r==="attribute"){if(t.headers.has(o))return o;y=`${_(e,t)} ${o}`}if(r==="constant"){if(t.headers.has(o))return o;y=`${_(e,t)} ${o}`}if(r==="varying"){if(t.headers.has(o))return o;y=`${_(e,t)} ${o}`}if(y)return t.headers.set(o,y),t.onMount?.(o,n.value),o;if(r==="variable")return o;if(r==="swizzle")return`${p(a,t)}.${p(u,t)}`;if(r==="operator")return u==="not"||u==="bitNot"?`!${p(a,t)}`:`(${p(a,t)} ${le(u)} ${p(m,t)})`;if(r==="function")return u==="negate"?`(-${G(s.slice(1),t)})`:`${u}(${G(s.slice(1),t)})`;if(r==="conversion")return`${w(u,t)}(${G(s.slice(1),t)})`;if(r==="scope")return s.map(f=>p(f,t)).join(`
25
+ `);if(r==="assign")return`${p(u,t)} = ${p(a,t)};`;if(r==="define"){let f=s.slice(2),d=`${o}(${f.map(h=>p(h,t))})`;return t.headers.has(o)||t.headers.set(o,me(n,t)),d}if(r==="loop")return`for (int i = 0; i < ${u}; i++) {
26
+ ${p(a,t)}
27
+ }`;if(r==="if"){let f=`if (${p(u,t)}) {
28
+ ${p(a,t)}
29
+ }`;for(let d=2;d<s.length;d+=2){let h=d>=s.length-1;f+=h?` else {
30
+ ${p(s[d],t)}
31
+ }`:` else if (${p(s[d],t)}) {
32
+ ${p(s[d+1],t)}
33
+ }`}return f}if(r==="switch"){let f=`switch (${p(u,t)}) {
34
+ `;for(let d=1;d<s.length;d+=2)d>=s.length-1&&s.length%2===0?f+=`default:
35
+ ${p(s[d],t)}
36
+ break;
37
+ `:d+1<s.length&&(f+=`case ${p(s[d],t)}:
38
+ ${p(s[d+1],t)}
35
39
  break;
36
- `,y}if(r==="default"&&`${c(a,t)}`,r==="ternary")return`(${c(a,t)} ? ${c(f,t)} : ${c(X,t)})`;if(r==="declare"){let p=_(f,t),m=a?.props?.id;if(t.isWebGL)return`${p} ${m} = ${c(f,t)};`;let y=O(p);return`var ${m}: ${y} = ${c(f,t)};`}if(r==="builtin"){if(t?.isWebGL){if(n==="position")return"gl_FragCoord";if(n==="uv")return"gl_FragCoord.xy"}return n}return c(a,t)};var N=null,R=(e,t=()=>{})=>{let r=N;N=e,t(),N=r},w=e=>{N&&(N.props.children||(N.props.children=[]),N.props.children.push(e))},bt=(e,t)=>{let r=u("scope");R(r,t);let o=u("if",null,e,r);w(o);let n=()=>({ElseIf:(s,a)=>{let f=u("scope");return R(f,a),o.props.children.push(s,f),n()},Else:s=>{let a=u("scope");R(a,s),o.props.children.push(a)}});return n()},gt=(e,t)=>{let r=u("scope");R(r,()=>t?.({i:u("variable",{id:"i"})}));let o=u("loop",null,e,r);return w(o),o},vt=e=>{let t=u("switch",null,e);w(t);let r=()=>({Case:(...o)=>n=>{let s=u("scope");R(s,n);let a=u("case",null,...o,s);return t.props.children.push(a),r()},Default:o=>{let n=u("scope");R(n,o);let s=u("default",null,n);t.props.children.push(s)}});return r()},Xt=e=>{let t=S();return(...r)=>{let o=u("scope"),n,s=[];for(let p=0;p<r.length;p++){let m=`p${p}`,y=u("variable",{id:m});s.push(y)}R(o,()=>n=e(s));let a=n?_(n):"void",f=r.map((p,m)=>({name:`p${m}`,type:_(p)})),X=u("fn_def",{id:t,returnType:a,paramInfo:f,args:r},o,n);return u("fn_run",{id:t,returnType:a},X,...s)}},le=e=>t=>{t||(t=S());let r=u("variable",{id:t}),o=u("declare",null,r,e);return w(o),r},me=e=>t=>{t||(t=S());let r=u("constant",{id:t}),o=u("declare",null,r,e);return w(o),r},de=e=>t=>{let r=u("assign",null,e,t);return w(r),e},yt=(e,t)=>{t||(t=S());let r=u("varying",{id:t}),o=u("declare",null,r,e);return w(o),r};var Tt=e=>t=>{if(t==="string")return c(e)},u=(e,t,...r)=>{t||(t={}),r.length&&(t.children=r);let o=new Proxy(()=>{},{get(n,s){if(s==="type")return e;if(s==="props")return t;if(s==="toVar")return le(o);if(s==="toConst")return me(o);if(s==="assign")return de(o);if(s==="isProxy")return!0;if(s==="toString")return c.bind(null,o);if(s===Symbol.toPrimitive)return Tt(o);if(Y(s))return xe(s,o);if(ie(s))return(...a)=>Me(s,o,...a);if(ae(s))return(...a)=>i(s,o,...a);if(ue(s))return b(s,o)},set(n,s,a){return Y(s)?(xe(s,o).assign(a),!0):!1}});return o},Et=(...e)=>u("variable",{id:S()},...e),xe=(e,t)=>u("swizzle",null,e,t),b=(e,...t)=>u("conversions",null,e,...t),Me=(e,...t)=>u("operator",null,e,...t),i=(e,...t)=>u("math_fun",null,e,...t),A=(e,t)=>u("uniform",{id:e,value:t}),ht=(e,t,r)=>u("ternary",null,e,t,r);var _t=A("iResolution",[1280,800]),Pt=A("iMouse",[0,0]),St=A("iTime",0),Nt=u("variable",{id:"gl_FragCoord"}),Rt=(e=0)=>u("attribute",{id:`uv${e||""}`}),wt=(e=0)=>u("attribute",{id:`color${e||""}`}),Ct=(e,t)=>u("attribute",{id:e,type:t}),Lt=e=>u("vertex_stage",null,e),Ot=u("builtin",{id:"positionLocal"}),Ut=u("builtin",{id:"positionWorld"}),Gt=u("builtin",{id:"positionView"}),It=u("builtin",{id:"normalLocal"}),At=u("builtin",{id:"normalWorld"}),Ft=u("builtin",{id:"normalView"}),$t=u("builtin",{id:"screenCoordinate"}),Bt=u("builtin",{id:"screenUV"}),zt=e=>b("float",e),Vt=e=>b("int",e),Mt=e=>b("uint",e),Wt=e=>b("bool",e),Dt=(e,t)=>b("vec2",e,t),be=(e,t,r)=>b("vec3",e,t,r),qt=(e,t,r,o)=>b("vec4",e,t,r,o),Yt=(...e)=>b("mat2",...e),kt=(...e)=>b("mat3",...e),jt=(...e)=>b("mat4",...e),Ht=(e,t)=>b("ivec2",e,t),Kt=(e,t,r)=>b("ivec3",e,t,r),Zt=(e,t,r,o)=>b("ivec4",e,t,r,o),Qt=(e,t)=>b("uvec2",e,t),Jt=(e,t,r)=>b("uvec3",e,t,r),er=(e,t,r,o)=>b("uvec4",e,t,r,o),tr=(e,t)=>b("bvec2",e,t),rr=(e,t,r)=>b("bvec3",e,t,r),or=(e,t,r,o)=>b("bvec4",e,t,r,o),nr=(e,t,r)=>l.num(e)&&l.und(t)&&l.und(r)?be(...fe(e)):be(e,t,r),sr=(e,t,r)=>i("texture",e,t,r),ir=(e,t,r)=>i("cubeTexture",e,t,r),ar=(e,t)=>i("textureSize",e,t),ur=e=>i("abs",e),cr=e=>i("acos",e),fr=e=>i("all",e),pr=e=>i("any",e),lr=e=>i("asin",e),mr=(e,t)=>t!==void 0?i("atan",e,t):i("atan",e),dr=(e,t)=>i("atan",e,t),xr=(e,t)=>i("bitcast",e,t),br=e=>i("cbrt",e),gr=e=>i("ceil",e),vr=(e,t,r)=>i("clamp",e,t,r),Xr=e=>i("cos",e),yr=(e,t)=>i("cross",e,t),Tr=e=>i("dFdx",e),Er=e=>i("dFdy",e),hr=e=>i("degrees",e),_r=(e,t)=>i("difference",e,t),Pr=(e,t)=>i("distance",e,t),Sr=(e,t)=>i("dot",e,t),Nr=(e,t)=>i("equals",e,t),Rr=e=>i("exp",e),wr=e=>i("exp2",e),Cr=(e,t,r)=>i("faceforward",e,t,r),Lr=e=>i("floor",e),Or=e=>i("fract",e),Ur=e=>i("fwidth",e),Gr=e=>i("inverseSqrt",e),Ir=e=>i("length",e),Ar=e=>i("lengthSq",e),Fr=e=>i("log",e),$r=e=>i("log2",e),Br=(e,t)=>i("max",e,t),zr=(e,t)=>i("min",e,t),Vr=(e,t,r)=>i("mix",e,t,r),Mr=e=>i("negate",e),Wr=e=>i("normalize",e),Dr=e=>i("oneMinus",e),qr=(e,t)=>i("pow",e,t),Yr=e=>i("pow2",e),kr=e=>i("pow3",e),jr=e=>i("pow4",e),Hr=e=>i("radians",e),Kr=e=>i("reciprocal",e),Zr=(e,t)=>i("reflect",e,t),Qr=(e,t,r)=>i("refract",e,t,r),Jr=e=>i("round",e),eo=e=>i("saturate",e),to=e=>i("sign",e),ro=e=>i("sin",e),oo=(e,t,r)=>i("smoothstep",e,t,r),no=e=>i("sqrt",e),so=(e,t)=>i("step",e,t),io=e=>i("tan",e),ao=(e,t)=>i("transformDirection",e,t),uo=e=>i("trunc",e);var De=`
40
+ `);return f+="}",f}if(r==="ternary")return`(${p(u,t)} ? ${p(a,t)} : ${p(m,t)})`;if(r==="declare"){let f=_(a,t),d=u?.props?.id;if(t.isWebGL)return`${f} ${d} = ${p(a,t)};`;let h=w(f);return`var ${d}: ${h} = ${p(a,t)};`}if(r==="builtin"){if(t?.isWebGL){let f=ae[o];if(f)return f;if(o==="uv")return"gl_FragCoord.xy"}return o}return p(u,t)};var R=null,L=(e,t=()=>{})=>{let r=R;R=e,t(),R=r},A=e=>{R&&(R.props.children||(R.props.children=[]),R.props.children.push(e))},de=(e,t)=>{t||(t=I());let r=c("variable",{id:t}),n=c("declare",null,r,e);return A(n),r},xe=(e,t)=>{let r=c("assign",null,e,t);return A(r),e},yt=(e,t)=>{let r=c("scope");L(r,t);let n=c("if",null,e,r);A(n);let o=()=>({ElseIf:(s,u)=>{let a=c("scope");return L(a,u),n.props.children.push(s,a),o()},Else:s=>{let u=c("scope");L(u,s),n.props.children.push(u)}});return o()},Xt=(e,t)=>{let r=c("scope");L(r,()=>t({i:c("variable",{id:"i"})}));let n=c("loop",null,e,r);return A(n),n},Tt=e=>{let t=c("switch",null,e);A(t);let r=()=>({Case:(...n)=>o=>{let s=c("scope");L(s,o);for(let u of n)t.props.children.push(u,s);return r()},Default:n=>{let o=c("scope");L(o,n),t.props.children.push(o)}});return r()},_t=e=>{let t=I();return(...r)=>{let n=c("scope"),o,s=[];for(let u=0;u<r.length;u++){let a=`p${u}`,m=c("variable",{id:a});s.push(m)}return L(n,()=>o=e(s)),c("define",{id:t},n,o,...r)}};var ht=(e,t)=>{if(t==="string")return p(e)},c=(e,t,...r)=>{t||(t={}),r.length&&(t.children=r);let n=(u,a)=>{if(a==="type")return e;if(a==="props")return t;if(a==="toVar")return de.bind(null,s);if(a==="assign")return xe.bind(null,s);if(a==="isProxy")return!0;if(a==="toString")return p.bind(null,s);if(a===Symbol.toPrimitive)return ht.bind(null,s);if(Y(a))return ge(a,s);if(ue(a))return(...m)=>We(a,s,...m);if(ce(a))return(...m)=>i(a,s,...m);if(pe(a))return b(a,s)},o=(u,a,m)=>Y(a)?(ge(a,s).assign(m),!0):!1,s=new Proxy({},{get:n,set:o});return s};var ge=(e,t)=>c("swizzle",null,e,t),We=(e,...t)=>c("operator",null,e,...t),i=(e,...t)=>c("function",null,e,...t),b=(e,...t)=>c("conversion",null,e,...t);var Et=(e,t,r)=>c("ternary",null,e,t,r),j=(e,t)=>c("uniform",{id:t,value:e}),Pt=(e,t)=>c("varying",{id:t,value:e}),Nt=(e,t)=>c("varying",{id:t,value:e}),St=e=>c("variable",{id:e}),wt=e=>c("builtin",{id:e}),Rt=j([1280,800],"iResolution"),Lt=j([0,0],"iMouse"),Ct=j(0,"iTime"),qe=c("builtin",{id:"position"}),ke=c("builtin",{id:"vertex_index"}),Ot=c("builtin",{id:"instance_index"}),It=c("builtin",{id:"front_facing"}),Gt=c("builtin",{id:"frag_depth"}),Ut=c("builtin",{id:"sample_index"}),Ft=c("builtin",{id:"sample_mask"}),At=c("builtin",{id:"point_coord"}),$t=c("builtin",{id:"position"}),Bt=c("builtin",{id:"positionWorld"}),zt=c("builtin",{id:"positionView"}),Mt=c("builtin",{id:"normalLocal"}),Vt=c("builtin",{id:"normalWorld"}),Dt=c("builtin",{id:"normalView"}),Wt=c("builtin",{id:"screenCoordinate"}),qt=c("builtin",{id:"screenUV"}),kt=qe,Yt=ke,jt=e=>b("float",e),Ht=e=>b("int",e),Kt=e=>b("uint",e),Zt=e=>b("bool",e),Qt=(e,t)=>b("vec2",e,t),be=(e,t,r)=>b("vec3",e,t,r),Jt=(e,t,r,n)=>b("vec4",e,t,r,n),er=(...e)=>b("mat2",...e),tr=(...e)=>b("mat3",...e),rr=(...e)=>b("mat4",...e),or=(e,t)=>b("ivec2",e,t),nr=(e,t,r)=>b("ivec3",e,t,r),sr=(e,t,r,n)=>b("ivec4",e,t,r,n),ir=(e,t)=>b("uvec2",e,t),ar=(e,t,r)=>b("uvec3",e,t,r),ur=(e,t,r,n)=>b("uvec4",e,t,r,n),cr=(e,t)=>b("bvec2",e,t),pr=(e,t,r)=>b("bvec3",e,t,r),fr=(e,t,r,n)=>b("bvec4",e,t,r,n),lr=(e,t,r)=>g.num(e)&&g.und(t)&&g.und(r)?be(...fe(e)):be(e,t,r),mr=(e,t,r)=>i("texture",e,t,r),dr=(e,t,r)=>i("cubeTexture",e,t,r),xr=(e,t)=>i("textureSize",e,t),gr=e=>i("abs",e),br=e=>i("acos",e),vr=e=>i("all",e),yr=e=>i("any",e),Xr=e=>i("asin",e),Tr=(e,t)=>t!==void 0?i("atan",e,t):i("atan",e),_r=(e,t)=>i("atan",e,t),hr=(e,t)=>i("bitcast",e,t),Er=e=>i("cbrt",e),Pr=e=>i("ceil",e),Nr=(e,t,r)=>i("clamp",e,t,r),Sr=e=>i("cos",e),wr=(e,t)=>i("cross",e,t),Rr=e=>i("dFdx",e),Lr=e=>i("dFdy",e),Cr=e=>i("degrees",e),Or=(e,t)=>i("difference",e,t),Ir=(e,t)=>i("distance",e,t),Gr=(e,t)=>i("dot",e,t),Ur=(e,t)=>i("equals",e,t),Fr=e=>i("exp",e),Ar=e=>i("exp2",e),$r=(e,t,r)=>i("faceforward",e,t,r),Br=e=>i("floor",e),zr=e=>i("fract",e),Mr=e=>i("fwidth",e),Vr=e=>i("inverseSqrt",e),Dr=e=>i("length",e),Wr=e=>i("lengthSq",e),qr=e=>i("log",e),kr=e=>i("log2",e),Yr=(e,t)=>i("max",e,t),jr=(e,t)=>i("min",e,t),Hr=(e,t,r)=>i("mix",e,t,r),Kr=e=>i("negate",e),Zr=e=>i("normalize",e),Qr=e=>i("oneMinus",e),Jr=(e,t)=>i("pow",e,t),eo=e=>i("pow2",e),to=e=>i("pow3",e),ro=e=>i("pow4",e),oo=e=>i("radians",e),no=e=>i("reciprocal",e),so=(e,t)=>i("reflect",e,t),io=(e,t,r)=>i("refract",e,t,r),ao=e=>i("round",e),uo=e=>i("saturate",e),co=e=>i("sign",e),po=e=>i("sin",e),fo=(e,t,r)=>i("smoothstep",e,t,r),lo=e=>i("sqrt",e),mo=(e,t)=>i("step",e,t),xo=e=>i("tan",e),go=(e,t)=>i("transformDirection",e,t),bo=e=>i("trunc",e);var je=`
37
41
  #version 300 es
38
42
  void main() {
39
43
  float x = float(gl_VertexID % 2) * 4.0 - 1.0;
40
44
  float y = float(gl_VertexID / 2) * 4.0 - 1.0;
41
45
  gl_Position = vec4(x, y, 0.0, 1.0);
42
46
  }
43
- `,qe=`
47
+ `,He=`
44
48
  #version 300 es
45
49
  precision mediump float;
46
50
  uniform vec2 iResolution;
@@ -48,19 +52,19 @@ out vec4 fragColor;
48
52
  void main() {
49
53
  fragColor = vec4(fract(gl_FragCoord.xy / iResolution), 0, 1);
50
54
  }
51
- `,We=(e,t,r)=>{let o=e.createShader(r);if(!o)throw new Error("Failed to create shader");if(e.shaderSource(o,t.trim()),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS))return o;let n=e.getShaderInfoLog(o);e.deleteShader(o),console.warn(`Could not compile shader: ${n}`)},ge=(e,t=De,r=qe,o=()=>{})=>{l.str(r)||(r=G(r,{isWebGL:!0})),l.str(t)||(t=I(r,{isWebGL:!0}));let n=e.createProgram(),s=We(e,t,e.VERTEX_SHADER),a=We(e,r,e.FRAGMENT_SHADER);if(!s||!a)return o();if(e.attachShader(n,s),e.attachShader(n,a),e.linkProgram(n),e.getProgramParameter(n,e.LINK_STATUS))return n;let f=e.getProgramInfoLog(n);e.deleteProgram(n),o(),console.warn(`Could not link pg: ${f}`)},ve=(e,t)=>{let r=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array(t),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),r},Xe=(e,t)=>{let r=e.createBuffer();return e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r),e.bufferData(e.ELEMENT_ARRAY_BUFFER,new Int16Array(t),e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),r},ye=(e,t,r)=>{r&&(e=Math.max(...r)+1);let o=t.length/e;return Math.floor(o)},Te=(e,t,r,o,n)=>{e.bindBuffer(e.ARRAY_BUFFER,o),e.enableVertexAttribArray(r),e.vertexAttribPointer(r,t,e.FLOAT,!1,0,0),n&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)},Ee=(e,t,r,o)=>{let n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),e.generateMipmap(e.TEXTURE_2D),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),e.uniform1i(r,o),e.activeTexture(e.TEXTURE0+o),e.bindTexture(e.TEXTURE_2D,n)};var he=async e=>{let t=e.el.getContext("webgl2"),r=ge(t,e.vs,e.fs,()=>void(e.isLoop=!1)),o={context:t,program:r};t.useProgram(r);let n=0,s=(0,j.nested)(T=>t.getUniformLocation(r,T)),a=(0,j.nested)(T=>t.getAttribLocation(r,T)),f=(0,j.nested)(()=>n++);return{webgl:o,render:()=>{t.clear(t.COLOR_BUFFER_BIT),t.viewport(0,0,...e.size),t.drawArrays(t.TRIANGLES,0,3)},clean:()=>t.deleteProgram(r),_attribute:(T="",E,h)=>{let P=a(T,!0),g=ve(t,E),d=Xe(t,h),x=ye(e.count,E,h);Te(t,x,P,g,d)},_uniform:(T,E)=>{let h=s(T);if(l.num(E))return t.uniform1f(h,E);let P=E.length;if(P<=4)return t[`uniform${P}fv`](h,E);P=Math.sqrt(P)<<0,t[`uniformMatrix${P}fv`](h,!1,E)},_texture:(T,E)=>{let h=new Image;Object.assign(h,{src:E,crossOrigin:"anonymous"}),h.decode().then(()=>{let P=s(T),g=f(T);Ee(t,h,P,g)})}}};var H=require("reev");var co=`
55
+ `,Ye=(e,t,r)=>{let n=e.createShader(r);if(!n)throw new Error("Failed to create shader");if(e.shaderSource(n,t.trim()),e.compileShader(n),e.getShaderParameter(n,e.COMPILE_STATUS))return n;let o=e.getShaderInfoLog(n);e.deleteShader(n),console.warn(`Could not compile shader: ${o}`)},ve=(e,t=je,r=He,n=()=>{})=>{S(r)&&(r=U(r,{isWebGL:!0})),S(t)&&(t=F(r,{isWebGL:!0}));let o=e.createProgram(),s=Ye(e,t,e.VERTEX_SHADER),u=Ye(e,r,e.FRAGMENT_SHADER);if(!s||!u)return n();if(e.attachShader(o,s),e.attachShader(o,u),e.linkProgram(o),e.getProgramParameter(o,e.LINK_STATUS))return o;let a=e.getProgramInfoLog(o);e.deleteProgram(o),n(),console.warn(`Could not link pg: ${a}`)},ye=(e,t)=>{let r=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array(t),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),r},Xe=(e,t)=>{let r=e.createBuffer();return e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r),e.bufferData(e.ELEMENT_ARRAY_BUFFER,new Int16Array(t),e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),r},Te=(e,t,r)=>{r&&(e=Math.max(...r)+1);let n=t.length/e;return Math.floor(n)},_e=(e,t,r,n,o)=>{e.bindBuffer(e.ARRAY_BUFFER,n),e.enableVertexAttribArray(r),e.vertexAttribPointer(r,t,e.FLOAT,!1,0,0),o&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,o)},he=(e,t,r,n)=>{let o=e.createTexture();e.bindTexture(e.TEXTURE_2D,o),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),e.generateMipmap(e.TEXTURE_2D),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),e.uniform1i(r,n),e.activeTexture(e.TEXTURE0+n),e.bindTexture(e.TEXTURE_2D,o)};var Ee=async e=>{let t=e.el.getContext("webgl2"),r=ve(t,e.vs,e.fs,()=>void(e.isLoop=!1));t.useProgram(r);let n=0,o=(0,H.nested)(T=>t.getUniformLocation(r,T)),s=(0,H.nested)(T=>t.getAttribLocation(r,T)),u=(0,H.nested)(()=>n++);return{webgl:{context:t,program:r},render:()=>{t.clear(t.COLOR_BUFFER_BIT),t.viewport(0,0,...e.size),t.drawArrays(t.TRIANGLES,0,3)},clean:()=>t.deleteProgram(r),_attribute:(T="",E,P)=>{let N=s(T,!0),X=ye(t,E),l=Xe(t,P),x=Te(e.count,E,P);_e(t,x,N,X,l)},_uniform:(T,E)=>{let P=o(T);if(g.num(E))return t.uniform1f(P,E);let N=E.length;if(N<=4)return t[`uniform${N}fv`](P,E);N=Math.sqrt(N)<<0,t[`uniformMatrix${N}fv`](P,!1,E)},_texture:(T,E)=>{let P=new Image;Object.assign(P,{src:E,crossOrigin:"anonymous"}),P.decode().then(()=>{let N=o(T),X=u(T);he(t,P,N,X)})}}};var K=require("reev");var vo=`
52
56
  @vertex
53
57
  fn main(@builtin(vertex_index) vertex_index: u32) -> @builtin(position) vec4f {
54
58
  let x = f32(vertex_index % 2u) * 4.0 - 1.0;
55
59
  let y = f32(vertex_index / 2u) * 4.0 - 1.0;
56
60
  return vec4f(x, y, 0.0, 1.0);
57
61
  }
58
- `,fo=`
62
+ `,yo=`
59
63
  @group(0) @binding(0) var<uniform> iResolution: vec2f;
60
64
 
61
65
  @fragment
62
66
  fn main(@builtin(position) position: vec4f) -> @location(0) vec4f {
63
67
  return vec4f(position.xy / iResolution, 0.0, 1.0);
64
68
  }
65
- `,_e=async e=>{let t=navigator.gpu,r=t.getPreferredCanvasFormat(),n=await(await t.requestAdapter()).requestDevice();return e.configure({device:n,format:r,alphaMode:"opaque"}),{device:n,format:r}},Pe=(e,t,r,o,n=co,s=fo)=>{l.str(s)||(s=G(s,{isWebGL:!1})),l.str(n)||(n=I(n,{isWebGL:!1}));let a=e.createPipelineLayout({bindGroupLayouts:o});return e.createRenderPipeline({vertex:{module:e.createShaderModule({code:n.trim()}),entryPoint:"main",buffers:r},fragment:{module:e.createShaderModule({code:s.trim()}),entryPoint:"main",targets:[{format:t}]},layout:a,primitive:{topology:"triangle-list"}})},Se=(e,t)=>{let r=[],o=[];t.forEach((a,f)=>{if(!a)return;let X="buffer"in a,p=a instanceof GPUTextureView,m=a instanceof GPUSampler;if(X)r.push({binding:f,visibility:3,buffer:{type:"uniform"}});else if(p)r.push({binding:f,visibility:2,texture:{}});else if(m)r.push({binding:f,visibility:2,sampler:{}});else return;o.push({binding:f,resource:a})});let n=e.createBindGroupLayout({entries:r}),s=e.createBindGroup({layout:n,entries:o});return{layout:n,bindGroup:s}},Ne=e=>({colorAttachments:[{view:e.getCurrentTexture().createView(),clearValue:{r:0,g:0,b:0,a:1},loadOp:"clear",storeOp:"store"}]}),Ye=e=>Math.ceil(e/256)*256,Re=(e,t)=>{let r=new Float32Array(t),o=e.createBuffer({size:r.byteLength,usage:40});return{array:r,buffer:o}},we=(e,t)=>{let r=new Float32Array(t),o=Ye(r.byteLength),n=e.createBuffer({size:o,usage:72});return{array:r,buffer:n}},Ce=(e,t=1280,r=800)=>{let o=e.createTexture({size:[t,r],format:"rgba8unorm",usage:22}),n=e.createSampler({magFilter:"linear",minFilter:"linear"});return{texture:o,sampler:n}},po=(e,t)=>e/t,lo=e=>e===2?"float32x2":e===3?"float32x3":e===4?"float32x4":"float32",Le=(e,t,r=6)=>{let o=po(t,r);return{arrayStride:o*4,attributes:[{shaderLocation:e,offset:0,format:lo(o)}]}};var Oe=async e=>{let t=e.el.getContext("webgpu"),{device:r,format:o}=await _e(t),n={device:r,context:t,resources:[[],[]],loadingImg:0,needsUpdate:!0},s=[],a=[],f=[],X=(0,H.nested)((g,d)=>{let{array:x,buffer:v}=Re(r,d);return a.push(v),f.push(Le(f.length,x.length,e.count)),n.needsUpdate=!0,{array:x,buffer:v}}),p=(0,H.nested)((g,d)=>{let{array:x,buffer:v}=we(r,d);return n.resources[0].push({buffer:v}),n.needsUpdate=!0,{array:x,buffer:v}}),m=(0,H.nested)((g,{width:d,height:x})=>{let{texture:v,sampler:Z}=Ce(r,d,x);return n.resources[1].push(Z,v.createView()),n.needsUpdate=!0,{texture:v,width:d,height:x}}),y=()=>{let g=[];s.length=0,n.resources.forEach(d=>{if(!d.length)return;let{layout:x,bindGroup:v}=Se(r,d);g.push(x),s.push(v)}),n.pipeline=Pe(r,o,f,g,e.vs,e.fs)};return{webgpu:n,render:()=>{if(n.loadingImg)return;n.needsUpdate&&y(),n.needsUpdate=!1;let g=r.createCommandEncoder(),d=g.beginRenderPass(Ne(t));d.setPipeline(n.pipeline),s.forEach((x,v)=>d.setBindGroup(v,x)),a.forEach((x,v)=>d.setVertexBuffer(v,x)),d.draw(e.count,1,0,0),d.end(),r.queue.submit([g.finish()])},clean:()=>{},_attribute:(g="",d)=>{let{array:x,buffer:v}=X(g,d);r.queue.writeBuffer(v,0,x)},_uniform:(g,d)=>{l.num(d)&&(d=[d]);let{array:x,buffer:v}=p(g,d);x.set(d),r.queue.writeBuffer(v,0,x)},_texture:(g,d)=>{n.loadingImg++;let x=Object.assign(new Image,{src:d,crossOrigin:"anonymous"});x.decode().then(()=>{let{texture:v,width:Z,height:Ke}=m(g,x);r.queue.copyExternalImageToTexture({source:x},{texture:v},{width:Z,height:Ke}),n.loadingImg--})}}};var Ge=e=>l.obj(e)?"isGL"in e:!1,ke=()=>typeof window>"u",je=()=>ke()?!1:"gpu"in navigator,Ue=performance.now(),Ie=e=>{let t=(0,U.event)({isNative:!1,isWebGL:!0,isLoop:!0,isGL:!0,size:[0,0],mouse:[0,0],count:6,webgl:{},webgpu:{}});return t.queue=(0,K.createQueue)(),t.frame=(0,K.createFrame)(),t.attribute=(0,U.durable)((r,o,n)=>t.queue(()=>t._attribute?.(r,o,n))),t.texture=(0,U.durable)((r,o)=>t.queue(()=>t._texture?.(r,o))),t.uniform=(0,U.durable)((r,o,n)=>t.queue(()=>t._uniform?.(r,o,n))),t.uniform({iResolution:t.size,iMouse:[0,0],iTime:Ue}),t("mount",async()=>{t.vs=t.vs||t.vert||t.vertex,t.fs=t.fs||t.frag||t.fragment,je()||(t.isWebGL=!0),t.isWebGL?t(await he(t)):t(await Oe(t)),t.resize(),t.frame(()=>(t.loop(),t.queue.flush(),t.render(),t.isLoop)),!t.isNative&&(window.addEventListener("resize",t.resize),t.el.addEventListener("mousemove",t.mousemove))}),t("clean",()=>{t.frame.stop(),t.frame.clean(t.render),!t.isNative&&(window.removeEventListener("resize",t.resize),t.el.removeEventListener("mousemove",t.mousemove))}),t("resize",()=>{let r=t.width||window.innerWidth,o=t.height||window.innerHeight;t.size[0]=t.el.width=r,t.size[1]=t.el.height=o,t.uniform("iResolution",t.size)}),t("mousemove",(r,o=r.clientX,n=r.clientY)=>{let[s,a]=t.size,{top:f,left:X}=t.el.getBoundingClientRect();t.mouse[0]=(o-f-s/2)/(s/2),t.mouse[1]=-(n-X-a/2)/(a/2),t.uniform("iMouse",t.mouse)}),t("loop",()=>{Ue=performance.now()/1e3,t.uniform("iTime",Ue)}),t(e)};var mo=(e={})=>(0,He.useState)(()=>{let t=Ge(e)?e:Ie(e);return t.ref=r=>{t.el={},t({render(){r.flush(),r.endFrameEXP()}}),t.mount(),(()=>{t.width=r.drawingBufferWidth,t.height=r.drawingBufferHeight,t.resize()})()},t({isNative:!0})})[0];0&&(module.exports={ADDITIONAL_FUNCTIONS,BOOL_RETURN_FUNCTIONS,BUILTIN_TYPES,COMPARISON_OPERATORS,COMPONENT_COUNT_TO_TYPE,CONSTANTS,CONVERSIONS,FIRST_ARG_TYPE_FUNCTIONS,FUNCTIONS,Fn,HIGHEST_TYPE_FUNCTIONS,If,LOGICAL_OPERATORS,Loop,OPERATORS,OPERATOR_KEYS,PRESERVE_TYPE_FUNCTIONS,SCALAR_RETURN_FUNCTIONS,SWIZZLES,Switch,TYPE_MAPPING,VEC3_RETURN_FUNCTIONS,VEC4_RETURN_FUNCTIONS,abs,acos,alignTo256,all,any,asin,assign,atan,atan2,attribute,bitcast,bool,bvec2,bvec3,bvec4,cbrt,ceil,clamp,code,color,cos,createAttrib,createBindGroup,createBufferLayout,createDescriptor,createDevice,createGL,createIbo,createPipeline,createProgram,createTexture,createTextureSampler,createUniformBuffer,createVbo,createVertexBuffer,cross,cubeTexture,dFdx,dFdy,defaultFragmentGLSL,defaultVertexGLSL,degrees,difference,dig,distance,dot,each,equals,exp,exp2,ext,f,faceforward,fig,float,floor,flush,formatConversions,fract,fragment,fwidth,getId,getOperator,getStride,hex2rgb,iMouse,iResolution,iTime,infer,inferParameterTypes,int,inverseSqrt,is,isConversion,isFunction,isGL,isNodeProxy,isOperator,isServer,isSwizzle,isWebGPUSupported,ivec2,ivec3,ivec4,joins,length,lengthSq,log,log2,mat2,mat3,mat4,max,min,mix,n,negate,node,normalLocal,normalView,normalWorld,normalize,o,oneMinus,position,positionLocal,positionView,positionWorld,pow,pow2,pow3,pow4,radians,reciprocal,reflect,refract,replace,round,s,saturate,screenCoordinate,screenUV,select,sig,sign,sin,smoothstep,sqrt,step,tan,texture,textureSize,toConst,toVar,transformDirection,trunc,u,uint,useGL,uv,uvec2,uvec3,uvec4,v,varying,vec2,vec3,vec4,vertex,vertexColor,vertexStage,webgl,webgpu});
69
+ `,Pe=async e=>{let t=navigator.gpu,r=t.getPreferredCanvasFormat(),o=await(await t.requestAdapter()).requestDevice();return e.configure({device:o,format:r,alphaMode:"opaque"}),{device:o,format:r}},Ne=(e,t,r,n,o=vo,s=yo)=>{S(o)&&(o=F(o,{isWebGL:!1})),S(s)&&(s=U(s,{isWebGL:!1}));let u=e.createPipelineLayout({bindGroupLayouts:n});return e.createRenderPipeline({vertex:{module:e.createShaderModule({code:o.trim()}),entryPoint:"main",buffers:r},fragment:{module:e.createShaderModule({code:s.trim()}),entryPoint:"main",targets:[{format:t}]},layout:u,primitive:{topology:"triangle-list"}})},Se=(e,t)=>{let r=[],n=[];t.forEach((u,a)=>{if(!u)return;let m="buffer"in u,y=u instanceof GPUTextureView,f=u instanceof GPUSampler;if(m)r.push({binding:a,visibility:3,buffer:{type:"uniform"}});else if(y)r.push({binding:a,visibility:2,texture:{}});else if(f)r.push({binding:a,visibility:2,sampler:{}});else return;n.push({binding:a,resource:u})});let o=e.createBindGroupLayout({entries:r}),s=e.createBindGroup({layout:o,entries:n});return{layout:o,bindGroup:s}},we=e=>({colorAttachments:[{view:e.getCurrentTexture().createView(),clearValue:{r:0,g:0,b:0,a:1},loadOp:"clear",storeOp:"store"}]}),Ke=e=>Math.ceil(e/256)*256,Re=(e,t)=>{let r=new Float32Array(t),n=e.createBuffer({size:r.byteLength,usage:40});return{array:r,buffer:n}},Le=(e,t)=>{let r=new Float32Array(t),n=Ke(r.byteLength),o=e.createBuffer({size:n,usage:72});return{array:r,buffer:o}},Ce=(e,t=1280,r=800)=>{let n=e.createTexture({size:[t,r],format:"rgba8unorm",usage:22}),o=e.createSampler({magFilter:"linear",minFilter:"linear"});return{texture:n,sampler:o}},Xo=(e,t)=>e/t,To=e=>e===2?"float32x2":e===3?"float32x3":e===4?"float32x4":"float32",Oe=(e,t,r=6)=>{let n=Xo(t,r);return{arrayStride:n*4,attributes:[{shaderLocation:e,offset:0,format:To(n)}]}};var Ie=async e=>{let t=e.el.getContext("webgpu"),{device:r,format:n}=await Pe(t),o={device:r,context:t,resources:[[],[]],loadingImg:0,needsUpdate:!0},s=[],u=[],a=[],m=(0,K.nested)((X,l)=>{let{array:x,buffer:v}=Re(r,l);return u.push(v),a.push(Oe(a.length,x.length,e.count)),o.needsUpdate=!0,{array:x,buffer:v}}),y=(0,K.nested)((X,l)=>{let{array:x,buffer:v}=Le(r,l);return o.resources[0].push({buffer:v}),o.needsUpdate=!0,{array:x,buffer:v}}),f=(0,K.nested)((X,{width:l,height:x})=>{let{texture:v,sampler:Q}=Ce(r,l,x);return o.resources[1].push(Q,v.createView()),o.needsUpdate=!0,{texture:v,width:l,height:x}}),d=()=>{let X=[];s.length=0,o.resources.forEach(l=>{if(!l.length)return;let{layout:x,bindGroup:v}=Se(r,l);X.push(x),s.push(v)}),o.pipeline=Ne(r,n,a,X,e.vs,e.fs)};return{webgpu:o,render:()=>{if(o.loadingImg)return;o.needsUpdate&&d(),o.needsUpdate=!1;let X=r.createCommandEncoder(),l=X.beginRenderPass(we(t));l.setPipeline(o.pipeline),s.forEach((x,v)=>l.setBindGroup(v,x)),u.forEach((x,v)=>l.setVertexBuffer(v,x)),l.draw(e.count,1,0,0),l.end(),r.queue.submit([X.finish()])},clean:()=>{},_attribute:(X="",l)=>{let{array:x,buffer:v}=m(X,l);r.queue.writeBuffer(v,0,x)},_uniform:(X,l)=>{g.num(l)&&(l=[l]);let{array:x,buffer:v}=y(X,l);x.set(l),r.queue.writeBuffer(v,0,x)},_texture:(X,l)=>{o.loadingImg++;let x=Object.assign(new Image,{src:l,crossOrigin:"anonymous"});x.decode().then(()=>{let{texture:v,width:Q,height:et}=f(X,x);r.queue.copyExternalImageToTexture({source:x},{texture:v},{width:Q,height:et}),o.loadingImg--})}}};var Ue=e=>g.obj(e)?"isGL"in e:!1,Ze=()=>typeof window>"u",Qe=()=>Ze()?!1:"gpu"in navigator,Ge=performance.now(),Fe=e=>{let t=(0,O.event)({isNative:!1,isWebGL:!0,isLoop:!0,isGL:!0,size:[0,0],mouse:[0,0],count:6,webgl:{},webgpu:{}});return t.queue=(0,Z.createQueue)(),t.frame=(0,Z.createFrame)(),t.attribute=(0,O.durable)((r,n,o)=>t.queue(()=>t._attribute?.(r,n,o))),t.texture=(0,O.durable)((r,n)=>t.queue(()=>t._texture?.(r,n))),t.uniform=(0,O.durable)((r,n,o)=>t.queue(()=>t._uniform?.(r,n,o))),t.uniform({iResolution:t.size,iMouse:[0,0],iTime:Ge}),t("mount",async()=>{t.vs=t.vs||t.vert||t.vertex,t.fs=t.fs||t.frag||t.fragment,Qe()||(t.isWebGL=!0),t.isWebGL?t(await Ee(t)):t(await Ie(t)),t.resize(),t.frame(()=>(t.loop(),t.queue.flush(),t.render(),t.isLoop)),!t.isNative&&(window.addEventListener("resize",t.resize),t.el.addEventListener("mousemove",t.mousemove))}),t("clean",()=>{t.frame.stop(),t.frame.clean(t.render),!t.isNative&&(window.removeEventListener("resize",t.resize),t.el.removeEventListener("mousemove",t.mousemove))}),t("resize",()=>{let r=t.width||window.innerWidth,n=t.height||window.innerHeight;t.size[0]=t.el.width=r,t.size[1]=t.el.height=n,t.uniform("iResolution",t.size)}),t("mousemove",(r,n=r.clientX,o=r.clientY)=>{let[s,u]=t.size,{top:a,left:m}=t.el.getBoundingClientRect();t.mouse[0]=(n-a-s/2)/(s/2),t.mouse[1]=-(o-m-u/2)/(u/2),t.uniform("iMouse",t.mouse)}),t("loop",()=>{Ge=performance.now()/1e3,t.uniform("iTime",Ge)}),t(e)};var _o=(e={})=>(0,Je.useState)(()=>{let t=Ue(e)?e:Fe(e);return t.ref=r=>{t.el={},t({render(){r.flush(),r.endFrameEXP()}}),t.mount(),(()=>{t.width=r.drawingBufferWidth,t.height=r.drawingBufferHeight,t.resize()})()},t({isNative:!0})})[0];0&&(module.exports={ADDITIONAL_FUNCTIONS,BOOL_RETURN_FUNCTIONS,BUILTIN_TYPES,COMPARISON_OPERATORS,COMPONENT_COUNT_TO_TYPE,CONSTANTS,CONVERSIONS,FIRST_ARG_TYPE_FUNCTIONS,FUNCTIONS,Fn,HIGHEST_TYPE_FUNCTIONS,If,LOGICAL_OPERATORS,Loop,OPERATORS,OPERATOR_KEYS,PRESERVE_TYPE_FUNCTIONS,SCALAR_RETURN_FUNCTIONS,SWIZZLES,Switch,TYPE_MAPPING,VEC3_RETURN_FUNCTIONS,VEC4_RETURN_FUNCTIONS,WGSL_TO_GLSL_BUILTIN,abs,acos,alignTo256,all,any,asin,assign,atan,atan2,attribute,bitcast,bool,builtin,bvec2,bvec3,bvec4,cbrt,ceil,clamp,code,color,conversion,cos,createAttrib,createBindGroup,createBufferLayout,createDescriptor,createDevice,createGL,createIbo,createPipeline,createProgram,createTexture,createTextureSampler,createUniformBuffer,createVbo,createVertexBuffer,cross,cubeTexture,dFdx,dFdy,defaultFragmentGLSL,defaultVertexGLSL,degrees,difference,dig,distance,dot,each,equals,exp,exp2,ext,faceforward,fig,float,floor,flush,formatConversions,fract,fragCoord,fragDepth,fragment,frontFacing,function_,fwidth,generateDefine,getId,getOperator,getStride,hex2rgb,iMouse,iResolution,iTime,infer,inferImpl,instanceIndex,int,inverseSqrt,is,isConversion,isFunction,isGL,isNodeProxy,isOperator,isServer,isSwizzle,isWebGPUSupported,ivec2,ivec3,ivec4,joins,length,lengthSq,log,log2,mat2,mat3,mat4,max,min,mix,negate,node,normalLocal,normalView,normalWorld,normalize,oneMinus,operator,pointCoord,position,positionLocal,positionView,positionWorld,pow,pow2,pow3,pow4,radians,reciprocal,reflect,refract,replace,round,sampleIndex,sampleMask,saturate,screenCoordinate,screenUV,select,sig,sign,sin,smoothstep,sqrt,step,swizzle,tan,texture,textureSize,toVar,transformDirection,trunc,uint,uniform,useGL,uvec2,uvec3,uvec4,variable,varying,vec2,vec3,vec4,vertex,vertexId,vertexIndex,webgl,webgpu});
66
70
  //# sourceMappingURL=native.cjs.map