memoscan
← all memos

Memo 0xb6f84b4d…a05419 on Ethereum

(gl_FragCoord.x < padX || gl_FragCoord.x > canvasSize.x - padX || gl_FragCoord.y < padY || gl_FragCoord.y > canvasSize.y - padY))\n{\nif (sin(type*PI) > 0.0)\n{\nvec2 size = canvasSize - (vec2(padX, padY * 1.12) * 2.0);\nfloat box = clamp(roundedBoxSDF(gl_FragCoord.xy - (canvasSize * .5), size * .5, 0.0) / fadeSize, 0.0, 1.0);\nbox *= 3.5;\nbox += .3;\nbox -= .0 + (cnoise(vec3((gl_FragCoord.xy / canvasSize) * 8.4, 0.0)) * .4);\nbox = clamp(box, 0.0, 1.0);\nif (n2 < (1.0 - pow(1.0 - box, 4.0)))\n{\ndiscard;\nreturn;\n}\nelse\n{\nfloat b = (gl_FragColor.r + gl_FragColor.b + gl_FragColor.g ) / 3.0;\ngl_FragColor *= 0.9;\ngl_FragColor += (1.0 - b) * .1;\n}\n}\nelse\n{\n}\n}\n";return $.border||(f=""),d=d.replace("#include <fog_fragment>",`\ngl_FragColor.a = 1.0;\nfloat n2 = hash12(gl_FragCoord.xy / canvasSize * 1230.3);\nfloat zoomOffset = 1.0 - ${$.zoomLevelRat.toPrecision(5)};\nzoomOffset = pow(zoomOffset, 2.0);\nzoomOffset *= .5;\nfloat zOffset = ${(3*(Math.abs($.xRotation)-.55)).toPrecision(5)} + zoomOffset;\nfloat divider = 3.0 - zOffset;\nfloat z = .35 + vPosition.z - (zOffset * .35);\nif (z < 0.0) divider = 20.0;\nfloat b = pow(clamp(z / divider, -1.0, 1.0), 2.0);\nb = clamp(b, 0.0, 1.0) * 4.0;\ngl_FragColor = gl_FragColor * b;\nfloat h = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\nif (round(vTypeIndex) == 2.0 && vPosition.z > -1.5)\n{\nfloat ss = 1.5;\nfloat xs = ${a($.nSteps,700,1300,2.2,4,!1).toPrecision(5)};\nfloat cut = cnoise(vec3(lengthRadCircular * ss * xs, (vPosition.z + 123.3) * 1.0 * ss, (indexRat * 12.3) + (time * .01)));\nfloat hr = clamp((heightRat - .95), 0.0, 1.0) / .05;\nhr = clamp(hr, 0.0, 1.0);\nfloat cutThreshold = vHoleThreshold;\nfloat cutTimeOffset = .1;\nfloat cutRat = 1.0 - pow(1.0 - clamp(-cutTimeOffset + (time * 0.1), 0.0, 1.0), 3.0);\ncutRat = 1.0 - (cutRat * cutThreshold);\ncut *= clamp((z + 1.5) / 3.0, 0.0, 1.0) * 1.4;\nif (cut > cutRat)\n{\ndiscard;\nreturn;\n}\n}\n${f}\nfloat bri = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\nfloat n = hash12((gl_FragCoord.xy / canvasSize ) * 1000.0);\ngl_FragColor = gl_FragColor * .95 + vec4(n, n, n, 1.0) * .08 * (1.0 - bri) * noiseStrength;\ngl_FragColor += vec4(n, n, n, 1.0) * ((.013 + (bri * .12))) * noiseStrength * 2.0;\ngl_FragColor.rgb += clamp(1.0 - noiseStrength, 0.0, 1.0) * .05;\ngl_FragColor = clamp(gl_FragColor, vec4(0.0), vec4(1.0));\nbri = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\nint i1 = int(floor(gradientIndex + 0.0001));\nint i2 = int(floor(gradientIndex2 + 0.0001));\n${v}\nif (i1 > numGradients-1) i1 = 0;\nif (i2 > numGradients-1) i2 = 0;\nint ic1 = i1 * 5;\nvec4 c1 = colors[ic1];\nvec4 c2 = colors[ic1+1];\nvec4 c3 = colors[ic1+2];\nvec4 c4 = colors[ic1+3];\nvec4 c5 = colors[ic1+4];\nfloat s1 = stops[ic1];\nfloat s2 = stops[ic1+1];\nfloat s3 = stops[ic1+2];\nfloat s4 = stops[ic1+3];\nfloat s5 = stops[ic1+4];\nint ic2 = i2 * 5;\nvec4 c6 = colors[ic2];\nvec4 c7 = colors[ic2+1];\nvec4 c8 = colors[ic2+2];\nvec4 c9 = colors[ic2+3];\nvec4 c10 = colors[ic2+4];\nfloat s6 = stops[ic2];\nfloat s7 = stops[ic2+1];\nfloat s8 = stops[ic2+2];\nfloat s9 = stops[ic2+3];\nfloat s10 = stops[ic2+4];\nvec4 bw = gl_FragColor;\nbw.rgb += vec3(vValueShift);\nvec4 grad1 = gradient(c1, s1, c2, s2, c3, s3, c4, s4, c5, s5, 1.0 - bri);\nvec4 grad2 = gradient(c6, s6, c7, s7, c8, s8, c9, s9, c10, s10, 1.0 - bri);\nfloat dB1 = dBes[i1];\nfloat dB2 = dBes[i2];\nfloat sinScale = ${i.random_num(2,3).toPrecision(5)};\nsinScale = 2.0;\nfloat rat = (1.0 + sin(((lengthRadCircular * 3.14 * sinScale) + ((time * .2) + (vIndex))) + ${i.random_num(0,200).toPrecision(5)})) / 2.0;\ngl_FragColor = mix(grad1, grad2, rat);\nfloat satRat = .5 + (clamp(sin(lengthRadCircular * 8.0), 0.0, 1.0) * .5);\nsatRat *= vSatIncrease;\nfloat dR1 = dRs[i1];\nfloat dR2 = dRs[i2];\nfloat dR = pow((1.0 + cnoise(((vec3(vPosition.xy * 1.3, vPosition.y * .5)) + vec3(${i.random_num(10.2,345.3).toPrecision(5)})) * .5)) / 2.0, 2.0) * 3.0;\ndR = clamp(dR, 0.0, 1.0);\ndR *= 1.0 - mix(dR1, dR2, rat);\nvec2 satPos = gl_FragCoord.xy;\nvec2 satPosC = vec2((canvasSize.x * .5), (canvasSize.y * .5));\nsatPosC.x += ${i.random_num(-.3,.3).toPrecision(5)} * canvasSize.x;\nsatPosC.y += ${i.random_num(-.3,.3).toPrecision(5)} * canvasSize.y;\nsatPos.x += sin(satPos.x * 0.002) * canvasSize.x * .1;\nsatPos.y += sin(satPos.y * 0.0021) * canvasSize.x * .1;\nfloat satRat2 = 1.0 - (length(satPos - satPosC) / (canvasSize.x * .6));\nsatRat2 = pow(clamp(satRat2, 0.0, 1.0), 2.0);\ndR -= (satRat2 * dR) * 1.0;\ndR = clamp(dR, 0.0, 1.0);\nfloat desatB = mix(dB1, dB2, rat);\ngl_FragColor = mix(gl_FragColor, bw + desatB, dR);\nfloat sIndex = ${i.random_int(0,2).toPrecision(5)};\nif (vIndex >= sIndex && vIndex <= sIndex + (${i.random_int(1,1).toPrecision(5)}))\n{\nvec4 c = mix(colors[ic1+1], colors[ic1+3], clamp(vPosition.z, 0.0, 1.0));\ngl_FragColor = mix(c, c + (vec4(.12, .12, .12, 0.0) * noiseStrength), n);\n}\nvec3 hsv = rgb2hsv(gl_FragColor.rgb);\nvec3 saturated = hsv;\nhsv.r += -.02 + ((1.0 + sin(type * .1)) / 2.0 * .04);\ngl_FragColor.rgb = hsv2rgb(hsv);\nsaturated.g = clamp((saturated.g + .1), 0.0, .8);\nif (z < 0.0) gl_FragColor.rgb *= 1.0 - clamp(abs(clamp(z + 1.5, -1000.0, 0.0)) / 2.5, 0.0, 1.0);\nfloat fadeFactor = clamp(z - 1.0 + (time * (animRat*3.0)), 0.0, 1.0);\ngl_FragColor.rgb = mix(bgCol, gl_FragColor.rgb, fadeFactor);\n#include <fog_fragment>\n`),new M.ShaderMaterial({uniforms:l,vertexShader:g,side:M.DoubleSide,wireframe:!1,fragmentShader:d,lights:!0,fog:!0,name:"custom-material",depthWrite:!0})}(Le,Me,2,We(),e);Pe=new q.InstancedMesh(n,r,Me);let s=[],c=[],l=[],g=[],d=[],v=[],f=[],u=[],x=i.random_int(0,Me-1),m=0;for(let e=0;e<Me;e++){s.push(e);let n=$e[e],t=n-1,o=0;1==$.colorDistributionType&&(t=i.random_int(0,je.gradients.length)),t>je.gradients.length-1&&(t=je.gradients.length-1),e==x&&(o=je.gradients[t].sI);let r=t;if(i.random_bool(.8)&&je.gradients.length>1)for(r=i.random_int(0,je.gradients.length-1);r==t;)r=i.random_int(0,je.gradients.length-1);let a=0,y=2.99;n>3&&(y=2.99),a=1==n||2==n?Math.floor(i.random_num(2,y)):Math.floor(i.random_num(1,y)),$.allHoles&&(a=2),n>1&&n<4&&i.random_dec()>.8&&(a=0),2==a&&($.zoomLevel<=4&&m>=5?a=1:m++);let p=je.gradients[t].dB,h=i.random_num($.minHoleThreshold,$.maxHoleThreshold),w=(1+Math.sin(20*e))/2;w*=je.gradients[t].vS,u.push(p),g.push(a),c.push(t),l.push(r),d.push(o),v.push(h),f.push(w)}Pe.geometry.setAttribute("indexAttr",new THREE.InstancedBufferAttribute(new Int32Array(s),1,!1)),Pe.geometry.setAttribute("gradientIndexAttr",new THREE.InstancedBufferAttribute(new Int32Array(c),1,!1)),Pe.geometry.setAttribute("gradientIndexAttr2",new THREE.InstancedBufferAttribute(new Int32Array(l),1,!1)),Pe.geometry.setAttribute("typeIndex",new THREE.InstancedBufferAttribute(new Int32Array(g),1,!1)),Pe.geometry.setAttribute("sIrease",new THREE.InstancedBufferAttribute(new Float32Array(d),1,!1)),Pe.geometry.setAttribute("vS",new THREE.InstancedBufferAttribute(new Float32Array(f),1,!1)),Pe.geometry.setAttribute("holeThreshold",new THREE.InstancedBufferAttribute(new Float32Array(v),1,!1)),Pe.geometry.setAttribute("dB",new THREE.InstancedBufferAttribute(new Float32Array(u),1,!1)),ye.add(Pe)}(),function(){var e=q.ShaderLib.basic.vertexShader,n=function(e){return`\nuniform sampler2D map;\nuniform sampler2D debugMap;\nuniform float time;\nuniform float width;\nuniform float height;\nuniform float noiseStrength;\n${t}\n${o}\nfloat rand(vec2 co){\nreturn fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);\n}\nfloat sSin(float x)\n{\nreturn (1.0 + sin(x)) / 2.0;\n}\nfloat hash12(vec2 p)\n{\nvec3 p3 = fract(vec3(p.xyx) * .1031);\np3 += dot(p3, p3.yzx + 33.33);\nreturn fract((p3.x + p3.y) * p3.z);\n}\nvoid main ()\n{\nfloat pixR = ${e.toPrecision(6)};\nvec2 fc = gl_FragCoord.xy;\nvec2 uv = fc / vec2(width * pixR, height * pixR);\nvec2 uv2 = fc / vec2(width * pixR, height * pixR);\n${V}\n${O}\nvec4 c = texture2D( map, uv);\nfloat n = hash12(gl_FragCoord.xy);\ngl_FragColor = c;\nfloat bri = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\nfloat g = (pow(uv2.y, 2.5)) * 0.15;\ngl_FragColor += (g * .5) + (g * n * .5);\n}`}(ae),r=q.UniformsUtils.merge([q.ShaderLib.basic.uniforms,{time:{value:0}},{width:{value:ce}},{height:{value:se}},{noiseStrength:{value:1}}]);ze=new q.ShaderMaterial({uniforms:r,vertexShader:e,fragmentShader:n,name:"filter-material"}),pe=new q.Scene,pe.background=new q.Color(0,0,0),he=new q.OrthographicCamera(ce/-2,ce/2,se/2,se/-2,-10,10),he.position.z=1,we=new q.Mesh(new q.PlaneBufferGeometry(1,1),ze),we.scale.x=ce,we.scale.y=se,pe.add(we),Re=new q.Scene,Re.background=new q.Color(0,0,0),Te=new q.Object3D;let a=1/3,i=[];i.push(G.getCurrentRenderTarget(K).texture),i.push(G.getCurrentRenderTarget(U).texture),i.push(G.getCurrentRenderTarget(Q).texture),i.push(G.getCurrentRenderTarget(ee).texture),i.push(G.getCurrentRenderTarget(te).texture),i.push(G.getCurrentRenderTarget(re).texture);let s=0;for(let e=0;e<2;e++)for(let n=0;n<3;n++){let t=new q.Mesh(new q.PlaneBufferGeometry(a,.5),new q.MeshBasicMaterial);0==s?t.material.color=new q.Color(15,15,15,0):1==s&&(t.material.color=new q.Color(5,5,5,0)),t.position.x=-.5*(1-a)+a*n,t.position.y=.25-.5*e,t.material.map=i[s],t.material.map.offset=new q.Vector2(1/Le*2,0),Te.add(t),s++}Te.position.x=-.5,Te.position.y=.5,Te.scale.x=ce,Te.scale.y=se,Re.add(Te)}(),function e(){var n=Je();de+=(n-fe)/1e3;let t=1/30;ge+=t,fe=n;let o=Math.round(be/60);o<1&&(o=1);if(Fe>=30)Fe%o==0&&Qe(t),Oe?ue.domElement.toBlob((function(e){Oe=!1,function(e,n){var t=document.createElement("a");document.body.appendChild(t),t.style="display: none";let o=window.URL.createObjectURL(e);t.href=o,t.download=n,t.click(),window.URL.revokeObjectURL(o),t.remove()}(e,"frame"+Ie.toString()+".png"),r()})):r(),31==Fe&&document.body.appendChild(ue.domElement);else if(29==Fe){be=1/(de/30),ge=0,r()}else r();function r(){requestAnimationFrame(e),Fe++}}(),Qe(0),Ze(),window.addEventListener("resize",(e=>{Ze()})),document.addEventListener("keydown",(e=>{"Space"==e.code?De=!De:"KeyS"==e.code?Oe=!0:"KeyW"==e.code&&(Ve=!Ve)}));let en=function(){let e=A($.gradientIndices),n=[];c.forEach((e=>{n.push(A(e))})),n=[...new Set(n)],void 0!==window&&(window.schemeNames=n);let t="";switch($.zoomLevel){case 3:t="lowest";break;case 4:t="low";break;case 5:t="medium";break;case 6:t="high";break;case 6.5:t="ultra high"}let o=Math.abs($.swirlStrength),r="low";return o>.15?r="high":o>.05&&(r="medium"),{fidelity:t,fluidity:r,"color scheme":e,angle:$.angleIndex,direction:$.flipY?"downwards":"upwards",frame:$.border,"double sided":$.doubleSided}}();console.log("Features ------");for(const[e,n]of Object.entries(en))console.log(`${e}: ${n}`)}();