Transaction 8b74655383ba5a8ce61a383adfc877776aa5b0a8a86c6d374c25ceb61836403f
1 Input
-
cab06c95c2ea9340248ffe8f175de404851c205826a7d745f889d58b6956117b:0
OP_DATA_32(32) 5954388d7a62e034e1cf6251fdd20afff33d5355aba8e1d1db1a649acb0dfe0cOP_CHECKSIG(172)OP_0(0)OP_IF(99)OP_DATA_3(3) ordOP_DATA_1(1)OP_DATA_23(23) text/html;charset=utf-8OP_0(0)OP_PUSHDATA2(77) <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Plastica</title> <script type="text/javascript"> let palettes=[["#f9f0de","#d0bba3","#392b24"],["#f9f0de","#e94d26","#726c5d","#392b24"],["#f9f0de","#c67333","#927154","#392b24"],["#d2452b","#385d32","#392b24","#fab511","#f9f0de"],["#f9f0de","#bc9a56","#b76f30","#d80f15","#1d1e1b"],["#f9f0de","#8e8780","#fab515","#d7312e","#2a71af","#ad7347","#1d1d1b"],["#f299a5","#084698","#1a86c8","#74afe0","#a0d6da","#f8f9f2"],["#29361b","#f39233","#f3e3d6","#OP_PUSHDATA2(77) 140f0c","#cc3314"],["#d3c3b6","#bab2a7","#bf9c74","#bf5b03","#993503"],["#dbd0c3","#f2a74b","#d88236","#724116","#a55f21"],["#fffeff","#a58c68","#2f2a26","#8c847a","#df3f36"],["#281740","#f29d35","#04504e","#f27405","#f24c3d"],["#ecf2f0","#d9946c","#260b01","#80875e","#d96459"],["#eae6e2","#d9865a","#4f616f","#f2bfac","#d96055"],["#254174","#e4c192","#d1ac58","#337da3","#d29854"],["#d1d2aa","#5c7346","#eeaf24","#242424","#d7481e"],["#1c2137","#284555","#de4639","#db6528","#f5ad0d"],["#f1f3ee","#bf925a","#464e41","#OP_PUSHDATA2(77) a62014","#bf1515"],["#e6e4cc","#bf8c60","#d03814","#97632b","#edbeaa"],["#8ecae6","#219ebc","#023047","#012232","#ffb703","#fb8500"],["#264653","#2a9d8f","#e9c46a","#242424","#f4a261","#e76f51"],["#A9E5E4","#01239C","#085DE8","#50B2A1","#96ffff"],["#F18B56","#2D2D9F","#B264BE","#3A40CC","#E0D9F5"]]; </script> <script id="snippet-random-code" type="text/javascript"> let seed = window.location.href.split('/').find(t => t.includes('i0')); if (seed == null) { const alphabet = "0123456789abcdefghijklmnopqrstuvwsyz"; seeOP_PUSHDATA2(77) d = new URLSearchParams(window.location.search).get("seed") || Array(64).fill(0).map(_ => alphabet[(Math.random() * alphabet.length) | 0]).join('') + "i0"; } else { let pattern = "seed="; for (let i = 0; i < seed.length - pattern.length; ++i) { if (seed.substring(i, i + pattern.length) == pattern) { seed = seed.substring(i + pattern.length); break; } } } function cyrb128($) { let _ = 1779033703, u = 3144134277, i = 1013904242, l = 2773480762; for (let n = 0, r; n < $.length; n++) _ = u ^ Math.imul(_ ^ (r = $.charCoOP_PUSHDATA2(77) deAt(n)), 597399067), u = i ^ Math.imul(u ^ r, 2869860233), i = l ^ Math.imul(i ^ r, 951274213), l = _ ^ Math.imul(l ^ r, 2716044179); return _ = Math.imul(i ^ _ >>> 18, 597399067), u = Math.imul(l ^ u >>> 22, 2869860233), i = Math.imul(_ ^ i >>> 17, 951274213), l = Math.imul(u ^ l >>> 19, 2716044179), [(_ ^ u ^ i ^ l) >>> 0, (u ^ _) >>> 0, (i ^ _) >>> 0, (l ^ _) >>> 0] } function sfc32($, _, u, i) { return function () { u >>>= 0, i >>>= 0; var l = ($ >>>= 0) + (_ >>>= 0) | 0; return $ = _ ^ _ >>> 9, _ = u + (u <<OP_PUSHDATA2(77) 3) | 0, u = (u = u << 21 | u >>> 11) + (l = l + (i = i + 1 | 0) | 0) | 0, (l >>> 0) / 4294967296 } } let mRnd = sfc32(...cyrb128(seed)); </script> <style> html { background: black; height: 100%; } body { height: 100%; margin: 0; padding: 0px; } canvas { padding: 0; margin: auto; display: block; position: absolute; top: 0; bottom: 0; left: 0; right: 0; } </style> </head> <body> <canvas id="canvas"></canvas> <script type="text/javascript"> function Palette(rand){ let pal_ind = Math.floor(palettes.length*rand); returOP_PUSHDATA2(77) n pal_ind; } function Angle(rand){ let angle = 0.5 + Math.floor(6*rand)/10.0; return angle; } function Scale(rand){ let scale = 2.0 + Math.floor(11*rand)/10.0; return scale; } function FOV(rand){ let fov = 3 + Math.floor(4*rand); return fov; } function Surf(rand){ let surf = Math.floor(8*rand); return surf; } window.$generativeTraits={ "Palette": Palette(mRnd()), "Angle": Angle(mRnd()), "Scale": Scale(mRnd()), "FOV": FOV(mRnd()), "Surface": Surf(mRnd()), } console.log(window.$generativeTraits) let gl,program,texturOP_PUSHDATA2(77) ePal,canvas_size_w=1080,canvas_size_h=1080;const numColors=4096;let timeLocation,textureSizeLocation,angle,scale,fov,surf,rot;function compile(e,t,o){var a=e.createShader(e.VERTEX_SHADER),t=(e.shaderSource(a,t),e.compileShader(a),e.createShader(e.FRAGMENT_SHADER)),o=(e.shaderSource(t,o),e.compileShader(t),e.createProgram());return e.attachShader(o,a),e.attachShader(o,t),e.linkProgram(o),e.useProgram(o),o}function init(){console.log(seed);var e=window.$generativeTraits.Palette,e=(angle=window.$generativeTraits.AngleOP_PUSHDATA2(77) ,scale=window.$generativeTraits.Scale,fov=window.$generativeTraits.FOV,surf=window.$generativeTraits.Surface,rot=[3,4].includes(surf)?0:1,gC(palettes[e])),t=((gl=canvas.getContext("webgl2",{antialias:!0,alpha:!1})).canvas.width=canvas_size_w,gl.canvas.height=canvas_size_h,program=compile(gl,`#version 300 es in vec4 a_position; void main(){ gl_Position=a_position; }`,`#version 300 es #define PI 3.1415926538 precision mediump float; uniform sampler2D u_samplerPal; uniform vec2 u_resolution; uniform float u_time; unifOP_PUSHDATA2(77) orm float u_randSeed; uniform float u_angle; uniform float u_scale; uniform float u_fov; uniform int u_surf; uniform bool u_rot; out vec4 outputColor; uint hh(uint x){x+=(x<<10u);x^=(x>> 6u);x+=(x<<3u);x^=(x>>11u);x+=(x<<15u);return x;} uint hh(uvec2 v) {return hh(v.x^hh(v.y));} float fc(uint m){ const uint iM=0x007FFFFFu; const uint iO=0x3F800000u; m&=iM; m|=iO; float f=uintBitsToFloat(m); return f-1.0; } float rnd(vec2 v){return fc(hh(floatBitsToUint(v)));} float ns(vec2 x){ x+=u_randSeed; vec2 i=floor(x); vec2 fOP_PUSHDATA2(77) =fract(x); float a=rnd(i); float b=rnd(i+vec2(1.0,0.0)); float c=rnd(i+vec2(0.0,1.0)); float d=rnd(i+vec2(1.0,1.0)); vec2 u=f*f*(3.0-2.0*f); return mix(a,b,u.x)+(c-a)*u.y*(1.0-u.x)+(d-b)*u.x*u.y; } float fbm(vec2 st){ return 0.5*ns(st)+0.25*ns(2.0*st); } vec2 wrp(vec2 p){ float a=fbm(p*0.5)*2.0*PI+u_time; p+=0.1*vec2(cos(a),sin(a)); a=fbm(p*0.5)*2.0*PI+u_time; p+=0.1*vec2(cos(a),sin(a)); a=fbm(p*0.5)*2.0*PI+u_time; p+=0.1*vec2(cos(a),sin(a)); a=fbm(p*0.5)*2.0*PI+u_time; p+=0.1*vec2(cos(a),sin(a)); return p; } floatOP_PUSHDATA2(77) g(vec2 v){ float g1; if(u_surf==0){ g1=(sin(4.0*u_time+v.x*v.y*8.0+16.0*(sin(v.x*v.x)+sin(v.y*v.y)))+1.0)/2.0; }else if(u_surf==1){ g1=(sin(4.0*u_time+log(0.1+pow((sin(4.0*u_time+v.x*8.0)+sin(v.y*8.0)),2.0)))+1.0)/2.0; }else if(u_surf==2){ g1=(cos(4.0*u_time+8.0*v.x*sin(sin(2.0*u_time+sqrt(16.0*v.x*v.x+16.0*v.y*v.y))))+1.0)/2.0; }else if(u_surf==3){ g1=(sin(4.0*u_time+4.0*log(1.5+v.x*v.x*8.0+cos(8.0*u_time+(v.y*8.0))))+1.0)/2.0; }else if(u_surf==4){ g1=(cos(4.0*u_time+((8.0*v.x-cos(8.0*v.x)))-cos(8.0*u_time+8.0*v.OP_PUSHDATA2(77) y))+1.0)/2.0; }else if(u_surf==5){ g1=(cos(4.0*u_time+(cos(4.0*u_time+4.0*v.y)-8.0*v.x*v.y))+1.0)/2.0; }else if(u_surf==6){ g1=(cos(4.0*u_time+(cos(4.0*u_time+12.0*v.y)-4.0*(v.x*v.x+v.y*v.y)))+1.0)/2.0; }else if(u_surf==7){ g1=(cos(2.0*u_time+2.0*v.x+(4.0*sin(2.0*u_time+2.0*v.x)*(2.0*v.y)))+1.0)/2.0; } const float pct=0.6; const float dp=0.2; float g2=(1.0-smoothstep(0.0, 2.0, v.y))*(smoothstep(pct-dp, pct, g1))-smoothstep(pct,pct+dp,g1); return -g2*g1+g2+g1; } vec3 trn(vec3 p,float angle){ mat2 m1=mat2(cos(angle),OP_PUSHDATA2(77) -sin(angle),sin(angle),cos(angle)); p.yz *= m1; if (u_rot){ mat2 m2=mat2(cos(0.5*u_time),-sin(0.5*u_time),sin(0.5*u_time),cos(0.5*u_time)); p.xy*=m2; } return p; } const float sUB=20.; const float f=sin(atan(1.,sUB)); float sde(vec3 p){ return (p.z-g(p.xy/10.0))*f; } bool rayM(in vec3 ro,in vec3 rd,out vec3 p){ p=ro+rd*0.01; while(true){ float d = sde(p); if(d < 0.001){return true;} p+=rd*d; if(length(p-ro)>50.){return false;} } return true; } const vec2 eps=vec2(1e-3,0); vec3 light(vec3 l,vec3 p){ float index = g(OP_PUSHDATA2(77) p.xy/10.0) * 255.0; vec4 color=texture(u_samplerPal,vec2((index+0.5)/256.0,0.5)); float d=sde(p); vec3 norm=normalize(vec3(sde(p+eps.xyy)-d,sde(p+eps.yxy)-d,sde(p+eps.yyx)-d)); vec3 ld=normalize(l-p); float s=max(0.,dot(ld,norm)); return vec3(color.rgb*s*s); } const vec3 l=vec3(0,5,12); const vec3 ro=vec3(0,0,15); void main(){ vec2 st=gl_FragCoord.xy/u_resolution-u_resolution/u_resolution.x/2.0; vec2 uv=wrp(st*u_scale); vec3 c=vec3(10.0*uv,u_fov); vec3 ro_=ro; c=trn(c,u_angle); ro_=trn(ro_,u_angle); vec3 p; bool reOP_PUSHDATA2(77) t=rayM(ro_,normalize(c-ro_),p); vec3 col=light(l,p); float d=length(p-ro_); col-=vec3(smoothstep(0.,200.,d)); col=min(vec3(1),col); if (ret == false){ float index=g(p.xy/10.0)*255.0; vec4 outcol=texture(u_samplerPal,vec2((index+0.5)/256.0,0.5)); col=col*1.25+0.125; col=0.8*col+(u_rot?vec3(0):0.2*outcol.rgb); } outputColor=vec4(col*1.25,1.0); }`),gl.createBuffer()),t=(gl.bindBuffer(gl.ARRAY_BUFFER,t),gl.bufferData(gl.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),gl.STATIC_DRAW),gl.getAttribLocation(program,"aOP_PUSHDATA2(77) _position")),t=(gl.enableVertexAttribArray(t),gl.vertexAttribPointer(t,2,gl.FLOAT,!1,0,0),timeLocation=gl.getUniformLocation(program,"u_time"),gl.getUniformLocation(program,"u_samplerPal")),o=gl.getUniformLocation(program,"u_randSeed"),a=(textureSizeLocation=gl.getUniformLocation(program,"u_resolution"),gl.getUniformLocation(program,"u_angle")),n=gl.getUniformLocation(program,"u_scale"),r=gl.getUniformLocation(program,"u_fov"),i=gl.getUniformLocation(program,"u_surf"),l=gl.getUniformLocation(program,"u_rot");gl.uniOP_PUSHDATA2(77) form1f(timeLocation,0),gl.uniform1f(o,512*mRnd()),gl.uniform1f(a,angle),gl.uniform1f(n,scale),gl.uniform1f(r,fov),gl.uniform1i(i,surf),gl.uniform1i(l,rot),texturePal=gl.createTexture(),gl.bindTexture(gl.TEXTURE_2D,texturePal),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST),gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,numColors,1,0,gl.RGBA,gl.UNSIGNED_BYTE,e),gl.uniform1i(t,0),gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,textureOP_PUSHDATA2(77) Pal),gl.clearColor(0,0,0,1),window.addEventListener("keydown",onDocumentKeyDown,!1),window.addEventListener("resize",onWindowResize,!1),onWindowResize()}function renderLoop(e){e*=.001,gl.uniform1f(timeLocation,.1*e),gl.uniform2f(textureSizeLocation,canvas_size_w,canvas_size_h),gl.viewport(0,0,canvas_size_w,canvas_size_h),gl.clear(gl.COLOR_BUFFER_BIT),gl.drawArrays(gl.TRIANGLE_STRIP,0,4),requestAnimationFrame(renderLoop)}function onWindowResize(){window.innerWidth>=window.innerHeight?(canvas.style.width="",canvas.stOP_PUSHDATA2(77) yle.height="100%"):(canvas.style.width="100%",canvas.style.height="")}function onDocumentKeyDown(e){e=e.which;83===e?(gl.canvas.width=canvas_size_w,gl.canvas.height=canvas_size_h,gl.uniform2f(textureSizeLocation,gl.canvas.width,gl.canvas.height),gl.viewport(0,0,gl.canvas.width,gl.canvas.height),gl.clear(gl.COLOR_BUFFER_BIT),gl.drawArrays(gl.TRIANGLE_STRIP,0,4),imgData=gl.canvas.toDataURL("image/png"),saveFile(imgData.replace("image/png","image/octet-stream"),"gl-"+seed+".png"),onWindowResize()):49===e?(gl.canvas.wiOP_PUSHDATA2(77) dth=canvas_size_w=1080,gl.canvas.height=canvas_size_h=1080):50===e&&(gl.canvas.width=canvas_size_w=2160,gl.canvas.height=canvas_size_h=2160)}init(),requestAnimationFrame(renderLoop);let saveFile=function(e,t){var o=document.createElement("a");"string"==typeof o.download?(document.body.appendChild(o),o.download=t,o.href=e,o.click(),document.body.removeChild(o)):location.replace(uri)};function gC(e){var t=numColors/(e.length-1),o=e.map(e=>{return[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.OP_PUSHDATA2(77) substring(5,7),16)]}),a=new Uint8Array(4*numColors);for(let e=0;e<numColors;e++){var n=Math.floor(e/t),r=o[n],i=o[n+1],n=(e-n*t)/t,l=r[0]+n*(i[0]-r[0]),s=r[1]+n*(i[1]-r[1]),n=r[2]+n*(i[2]-r[2]);a[4*e]=Math.round(l),a[4*e+1]=Math.round(s),a[4*e+2]=Math.round(n),a[4*e+3]=255}return a} </script> </body> </html>OP_ENDIF(104)
1 Outputs
- 8b74655383ba5a8ce61a383adfc877776aa5b0a8a86c6d374c25ceb61836403f:0
value 10386
address bc1pkzjcrg70xsrfankcv2qlznzxye3f3rpgu3hk7dyljajk7mr26e6smwh4dq