Comparing version 0.2.4 to 0.3.0
@@ -1,1 +0,1 @@ | ||
import I from"phenomenon";var M="phi",c="theta",T="mapSamples",A="mapBrightness",s="baseColor",O="markerColor",N="glowColor",E="markers",G="diffuse",u="devicePixelRatio",m={[M]:"z",[c]:"A",[T]:"k",[A]:"C",[s]:"w",[O]:"H",[N]:"x",[G]:"D"},{PI:S,sin:P,cos:X}=Math,f=L=>[].concat(...L.map(n=>{let[t,o]=n.location;t=t*S/180,o=o*S/180-S;let e=X(t);return[-e*X(o),P(t),e*P(o),n.size]})),v=(L,n)=>{let t=(e,_)=>({type:e,value:n[_]}),o=new I({canvas:L,context:{alpha:!0,stencil:!1,antialias:!0,depth:!1,preserveDrawingBuffer:!1},settings:{[u]:n[u]||1,onSetup:e=>{let _=e.RGB,r=e.UNSIGNED_BYTE,a=e.TEXTURE_2D,R=e.createTexture();e.bindTexture(a,R),e.texImage2D(a,0,_,1,1,0,_,r,new Uint8Array([0,0,0,0]));let i=new Image;i.onload=()=>{e.bindTexture(a,R),e.texImage2D(a,0,_,_,r,i),e.generateMipmap(a);let x=e.getParameter(e.CURRENT_PROGRAM),d=e.getUniformLocation(x,"E");e.texParameteri(a,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(a,e.TEXTURE_MAG_FILTER,e.NEAREST),e.uniform1i(d,0)},i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAACAAQAAAADMzoqnAAAAAXNSR0IArs4c6QAABA5JREFUeNrV179uHEUAx/Hf3JpbF+E2VASBsmVKTBcpKJs3SMEDcDwBiVJAAewYEBUivIHT0uUBIt0YCovKD0CRjUC4QfHYh8hYXu+P25vZ2Zm9c66gMd/GJ/tz82d3bk8GN4SrByYF2366FNTACIAkivVAAazQdnf3MvAlbNUQfOPAdQDvSAimMWhwy4I2g4SU+Kp04ISLpPBAKLxPyic3O/CCi+Y7rUJbiodcpDOFY7CgxCEXmdYD2EYK2s5lApOx5pEDDYCUwM1XdJUwBV11QQMg59keP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H7vinWAvoVCQ6zz0NX5V/6GkAVV+2/5qsJ/gU8bsxpM8IeAQAAAABJRU5ErkJggg=="}}});return o.add("",{vertex:"attribute vec3 aPosition;uniform mat4 uProjectionMatrix;uniform mat4 uModelMatrix;uniform mat4 uViewMatrix;void main(){gl_Position=uProjectionMatrix*uModelMatrix*uViewMatrix*vec4(aPosition,1.);}",fragment:"precision highp float;uniform vec2 s;uniform vec3 w,H,x;uniform vec4 y[64];uniform float z,A,k,B,C,D;uniform sampler2D E;float o=1./k;mat3 F(float a,float b){float c=cos(a),d=cos(b),e=sin(a),f=sin(b);return mat3(d,f*e,-f*c,0.,c,e,f,d*-e,d*c);}vec3 t(vec2 a){float b=sqrt(1.-a.y*a.y);return vec3(cos(a.x)*b,sin(a.x)*b,a.y);}vec3 u(vec3 a,out float v){a=a.xzy,a.z=-a.z;vec2 l=vec2(atan(a.y,a.x),a.z+o-1.);float m=max(2.,floor(log2(2.236068*k*3.141593*(1.-a.z*a.z))*.72021));vec2 d=floor(pow(1.618034,m)/2.236068*vec2(1.,1.618034)+.5),b=fract((d+1.)*.618034)*6.283185-3.883222,c=-2.*d*o;mat2 n=mat2(c.y,-c.x,-b.y,b.x);float h=3.141593;vec2 p=floor(n*l/(b.x*c.y-c.x*b.y)),i;for(float e=0.;e<4.;e+=1.){vec2 q=vec2(mod(e,2.),floor(e*.5));float f=dot(d,p+q);if(f>k)continue;vec2 j=vec2(6.283185*fract(f*.618034),(k-2.*f+1.)*o);float r=length(a-t(j));if(r<h)h=r,i=j;}v=h;vec3 g=t(i);g=g.xzy,g.y=-g.y;return g;}void main(){vec2 b=gl_FragCoord.xy/s*2.-1.;b.x*=s.x/s.y;vec3 f=normalize(vec3(0.,-.1,1.));float c=dot(b,b),a;vec3 d=normalize(vec3(b,sqrt(.64-c)));if(c<=.64){vec3 g=d*F(A,z),h=u(g,a);float l=asin(h.y),i=acos(-h.x/cos(l));i=h.z<0.?-i:i;float I=texture2D(E,vec2(i*.5/3.141593,-(l/3.141593+.5))).x,J=smoothstep(0.,a,.0016),p=pow(dot(d,f),D)*C,q=dot(d,vec3(0.,0.,1.));gl_FragColor=vec4(vec3(pow(I*J*q,1.5)*p+.2)*w,1.);int K=int(B);float r=0.;for(int j=0;j<64;j++){if(j>=K)break;vec4 m=y[j];vec3 n=m.xyz,v=n-g;float e=m.w;if(dot(v,v)>e*e*4.)continue;vec3 L=u(n,a);a=length(L-g);if(a<e){if(a+a<e)gl_FragColor.xyz=.2*w;r+=smoothstep(e*.5,0.,a)+(1.-exp(-2.*(e-a)));}}gl_FragColor.xyz+=min(1.,r*q*p)*H+pow(1.-dot(d,f),4.)*x;}float G=pow(dot(normalize(vec3(-b,sqrt(1.-c))),f)*1.3,4.)*smoothstep(.1,1.,.2/(c-.64));gl_FragColor+=vec4(G*x,G);}",uniforms:{s:{type:"vec2",value:[n.width,n.height]},z:t("float",M),A:t("float",c),k:t("float",T),C:t("float",A),w:t("vec3",s),H:t("vec3",O),D:t("float",G),x:t("vec3",N),y:{type:"vec4",value:f(n[E])},B:{type:"float",value:n[E].length}},mode:4,geometry:{vertices:[{x:-100,y:100,z:0},{x:-100,y:-100,z:0},{x:100,y:100,z:0},{x:100,y:-100,z:0},{x:-100,y:-100,z:0},{x:100,y:100,z:0}]},onRender:({uniforms:e})=>{let _={};if(n.onRender){n.onRender(_);for(let r in m)_[r]!==void 0&&(e[m[r]].value=_[r]);_[E]!==void 0&&(e["y"].value=f(_[E]),e["B"].value=_[E].length)}}}),o};export{v as default}; | ||
import U from"phenomenon";var M="phi",c="theta",A="mapSamples",T="mapBrightness",s="baseColor",O="markerColor",N="glowColor",E="markers",G="diffuse",u="devicePixelRatio",m="dark",P={[M]:"y",[c]:"z",[A]:"k",[T]:"B",[s]:"K",[O]:"L",[N]:"w",[G]:"C",[m]:"D"},{PI:R,sin:X,cos:f}=Math,x=L=>[].concat(...L.map(n=>{let[t,o]=n.location;t=t*R/180,o=o*R/180-R;let e=f(t);return[-e*f(o),X(t),e*X(o),n.size]})),l=(L,n)=>{let t=(e,_)=>({type:e,value:n[_]}),o=new U({canvas:L,context:{alpha:!0,stencil:!1,antialias:!0,depth:!1,preserveDrawingBuffer:!1},settings:{[u]:n[u]||1,onSetup:e=>{let _=e.RGB,r=e.UNSIGNED_BYTE,a=e.TEXTURE_2D,S=e.createTexture();e.bindTexture(a,S),e.texImage2D(a,0,_,1,1,0,_,r,new Uint8Array([0,0,0,0]));let i=new Image;i.onload=()=>{e.bindTexture(a,S),e.texImage2D(a,0,_,_,r,i),e.generateMipmap(a);let d=e.getParameter(e.CURRENT_PROGRAM),I=e.getUniformLocation(d,"E");e.texParameteri(a,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(a,e.TEXTURE_MAG_FILTER,e.NEAREST),e.uniform1i(I,0)},i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAACAAQAAAADMzoqnAAAAAXNSR0IArs4c6QAABA5JREFUeNrV179uHEUAx/Hf3JpbF+E2VASBsmVKTBcpKJs3SMEDcDwBiVJAAewYEBUivIHT0uUBIt0YCovKD0CRjUC4QfHYh8hYXu+P25vZ2Zm9c66gMd/GJ/tz82d3bk8GN4SrByYF2366FNTACIAkivVAAazQdnf3MvAlbNUQfOPAdQDvSAimMWhwy4I2g4SU+Kp04ISLpPBAKLxPyic3O/CCi+Y7rUJbiodcpDOFY7CgxCEXmdYD2EYK2s5lApOx5pEDDYCUwM1XdJUwBV11QQMg59kePSCaPAASQMEL2hwo6TJFgxpg+TgC2ymXPbuvc40awr3D1QCFfbH9kcoqAOkZozpQo0aqAGQRKCog/+tjkgbNFEtg2FffBvBGlSxHoAaAa1u6X4PBAwDiR8FFsrQgeUhfJTSALaB9jy5NCybJPn1SVFiWk7ywN+KzhH1aKAuydhGkbEF4lWohLXDXavlyFgHY7LBnLRdlAP6BS5Cc8RfVDXbkwN/oIvmY+6obbNeBP0JwTuMGu9gTzy1Q4RS/cWpfzszeYwd+CAFrtBW/Hur0gLbJGlD+/OjVwe/drfBxkbbg63dndEDfiEBlAd7ac0BPe1D6Jd8dfbLH+RI0OzseFB5s01/M+gMdAeluLOCAuaUA9Lezo/vSgXoCX9rtEiXnp7Q1W/CNyWcd8DXoS6jH/YZ5vAJEWY2dXFQe2TUgaFaNejCzJ98g6HnlVrsE58sDcYqg+9XY75fPqdoh/kRQWiXKg8MWlJQxUFMPjqnyujhFBE7UxIMjyszk0QwQlFsezImsyvUYYYVED2pk6m0Tg8T04Fwjk2kdAwSACqlM6gRRt3vQYAFGX0Ah7Ebx1H+MDRI5ui0QldH4j7FGcm90XdxD2Jg1AOEAVAKhEFXSn4cKUELurIAKwJ3MArypPscQaLhJFICJ0ohjDySAdH8AhDtCiTuMycH8CXzhH9jUACAO5uMhoAwA5i+T6WAKmmAqnLy80wxHqIPFYpqCwxGaYLt4Dyievg5kEoVEUAhs6pqKgFtDQYOuaXypaWKQfIuwwoGSZgfLsu/XAtI8cGN+h7Cc1A5oLOMhwlIPXuhu48AIvsSBkvtV9wsJRKCyYLfq5lTrQMFd1a262oqBck9K1V0YjQg0iEYYgpS1A9GlXQV5cykwm4A7BzVsxQqo7E+zCegO7Ma7yKgsuOcfKbMBwLC8wvVNYDsANYalEpOAa6zpWjTeMKGwEwC1CiQewJc5EKfgy7GmRAZA4vUVGwE2dPM/g0xuAInE/yG5aZ8ISxWGfYigUVbdyBElTHh2uCwGdfCkOLGgQVBh3Ewp+/QK4CDlR5Ws/Zf7yhCf8pH7vinWAvoVCQ6zz0NX5V/6GkAVV+2/5qsJ/gU8bsxpM8IeAQAAAABJRU5ErkJggg=="}}});return o.add("",{vertex:"attribute vec3 aPosition;uniform mat4 uProjectionMatrix;uniform mat4 uModelMatrix;uniform mat4 uViewMatrix;void main(){gl_Position=uProjectionMatrix*uModelMatrix*uViewMatrix*vec4(aPosition,1.);}",fragment:"precision highp float;uniform vec2 t;uniform vec3 K,L,w;uniform vec4 x[64];uniform float y,z,k,A,B,C,D;uniform sampler2D E;float r=1./k;mat3 F(float a,float b){float c=cos(a),d=cos(b),e=sin(a),f=sin(b);return mat3(d,f*e,-f*c,0.,c,e,f,d*-e,d*c);}vec3 u(vec2 a){float b=sqrt(1.-a.y*a.y);return vec3(cos(a.x)*b,sin(a.x)*b,a.y);}vec3 v(vec3 a,out float s){a=a.xzy,a.z=-a.z;vec2 l=vec2(atan(a.y,a.x),a.z+r-1.);float m=max(2.,floor(log2(2.236068*k*3.141593*(1.-a.z*a.z))*.72021));vec2 d=floor(pow(1.618034,m)/2.236068*vec2(1.,1.618034)+.5),b=fract((d+1.)*.618034)*6.283185-3.883222,c=-2.*d*r;mat2 n=mat2(c.y,-c.x,-b.y,b.x);float h=3.141593;vec2 o=floor(n*l/(b.x*c.y-c.x*b.y)),i;for(float e=0.;e<4.;e+=1.){vec2 p=vec2(mod(e,2.),floor(e*.5));float f=dot(d,o+p);if(f>k)continue;vec2 j=vec2(6.283185*fract(f*.618034),(k-2.*f+1.)*r);float q=length(a-u(j));if(q<h)h=q,i=j;}s=h;vec3 g=u(i);g=g.xzy,g.y=-g.y;return g;}void main(){vec2 a=gl_FragCoord.xy/t*2.-1.;a.x*=t.x/t.y;vec3 d=normalize(vec3(0.,0.,1.));float c=dot(a,a),b;vec3 e=normalize(vec3(a,sqrt(.64-c)));if(c<=.64){vec3 f=e*F(z,y),g=v(f,b);float j=asin(g.y),h=acos(-g.x/cos(j));h=g.z<0.?-h:h;float G=texture2D(E,vec2(h*.5/3.141593,-(j/3.141593+.5))).x,H=smoothstep(8e-3,0.,b),l=dot(e,d),s=pow(l,C)*B,m=G*H*s,M=mix((1.-m)*pow(l,.4),m,D)+.1;gl_FragColor=vec4(K*M,1.);int N=int(A);float n=0.;for(int i=0;i<64;i++){if(i>=N)break;vec4 o=x[i];vec3 p=o.xyz,I=p-f;float q=o.w;if(dot(I,I)>q*q*4.)continue;vec3 O=v(p,b);b=length(O-f),b<q?n+=smoothstep(q*.5,0.,b):0.;}n=min(1.,n*s),gl_FragColor.xyz=mix(gl_FragColor.xyz,L,n),gl_FragColor.xyz+=pow(1.-dot(e,d),4.)*w;}float J=pow(dot(normalize(vec3(-a,sqrt(1.-c))),d),4.)*smoothstep(.1,1.,.2/(c-.64));gl_FragColor+=vec4(J*w,J);}",uniforms:{t:{type:"vec2",value:[n.width,n.height]},y:t("float",M),z:t("float",c),k:t("float",A),B:t("float",T),K:t("vec3",s),L:t("vec3",O),C:t("float",G),w:t("vec3",N),D:t("float",m),x:{type:"vec4",value:x(n[E])},A:{type:"float",value:n[E].length}},mode:4,geometry:{vertices:[{x:-100,y:100,z:0},{x:-100,y:-100,z:0},{x:100,y:100,z:0},{x:100,y:-100,z:0},{x:-100,y:-100,z:0},{x:100,y:100,z:0}]},onRender:({uniforms:e})=>{let _={};if(n.onRender){n.onRender(_);for(let r in P)_[r]!==void 0&&(e[P[r]].value=_[r]);_[E]!==void 0&&(e["x"].value=x(_[E]),e["A"].value=_[E].length)}}}),o};export{l as default}; |
{ | ||
"name": "cobe", | ||
"version": "0.2.4", | ||
"version": "0.3.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.esm.js", |
@@ -20,2 +20,3 @@ # ⚫️ COBE | ||
theta: 0, | ||
dark: 0, | ||
diffuse: 1.2, | ||
@@ -22,0 +23,0 @@ mapSamples: 16000, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
8033
64