diff --git a/1/index.html b/1/index.html index 115f171..ed1ebbc 100644 --- a/1/index.html +++ b/1/index.html @@ -19,7 +19,7 @@ - + diff --git a/2/index.html b/2/index.html index a7e4b4c..4aa053f 100644 --- a/2/index.html +++ b/2/index.html @@ -19,7 +19,7 @@ - + diff --git a/3/index.html b/3/index.html index 35ff2d0..fedf6a0 100644 --- a/3/index.html +++ b/3/index.html @@ -19,7 +19,7 @@ - + diff --git a/4/index.html b/4/index.html index 8bb5924..2a4d96c 100644 --- a/4/index.html +++ b/4/index.html @@ -19,7 +19,7 @@ - + diff --git a/5/example.jpg b/5/example.jpg new file mode 100644 index 0000000..fb0ce05 Binary files /dev/null and b/5/example.jpg differ diff --git a/5/index.html b/5/index.html new file mode 100644 index 0000000..d841015 --- /dev/null +++ b/5/index.html @@ -0,0 +1,25 @@ + + + + + + Glow Path - Generative Art - seigler.github.io + + + + + + + + + + + + + + + + + + + diff --git a/app-139adcd2.js b/app-139adcd2.js deleted file mode 100644 index 63e491c..0000000 --- a/app-139adcd2.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";var e="undefined"==typeof global?self:global;if("function"!=typeof e.require){var r={},o={},a={},n={}.hasOwnProperty,t=/^\.\.?(\/|$)/,i=function(e,r){for(var o,a=[],n=(t.test(r)?e+"/"+r:r).split("/"),i=0,s=n.length;i.5){c.fill("#000");var q=e.random(2*Math.PI),W=e.random(.1,1.5)*_/2,I=W*e.random(-.7,.3);c.circle((i+(I+_)*Math.cos(q))/2,(i+(I+_)*Math.sin(q))/2,2*W)}do{var C=e.random(2*Math.PI),H=e.random(2*Math.PI);c.stroke(0),c.strokeWeight(1+_*Math.pow(e.random(.7368),3)),c.line(i*(Math.sin(C)+.5),i*(Math.cos(C)+.5),i*(Math.sin(H)+.5),i*(Math.cos(H)+.5))}while(e.random()<.5+.45*L);var R=e.random(0,2*Math.PI),D=e.random(b),T=n/(v-1)*U+D*Math.cos(R),N=t/(g-1)*y+D*Math.sin(R);e.image(c,T-i/2,N-i/2)}m.shader(w),w.setUniform("u_resolution",[n,t]),w.setUniform("u_alpha",.05),m.rect(0,0,n,t),e.blendMode(e.OVERLAY),e.image(m,0,0)}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}e.disableFriendlyErrors=!0;var a,n,t,i,s,l,d,h,c,u,f,m,M,p,w;e.preload=function(){M=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),p=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),w=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag")},e.setup=function(){l=2,d=2,s=70,window.onhashchange=function(){a=window.location.hash.substr(1),r()},a=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSB,100),n=e.windowWidth,t=e.windowHeight,h=e.createCanvas(n,t),i=1.75*(n+t)/Math.sqrt(s),c=e.createGraphics(i,i),u=e.createGraphics(i,i,e.WEBGL),f=e.createGraphics(i,i,e.WEBGL),m=e.createGraphics(n,t,e.WEBGL),c.noStroke(),u.noStroke(),f.noStroke(),m.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(a=null,r()):"s"==e.key&&e.saveCanvas("seigler-p5-1-gradient_burst-"+a+".jpg","jpg")},e.doubleClicked=function(){a=null,r()};var b;e.windowResized=function(){clearTimeout(b),b=setTimeout(function(){window.location.reload()},100)}})}),require.register("1/index.static.hbs",function(e,r,o){}),require.register("2/index.js",function(e,r,o){new p5(function(e){function r(){if(a)e.randomSeed(a);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random()),e.blendMode(e.BLEND),e.background("#000"),e.blendMode(e.ADD);for(var c=n*t/s,S=Math.sqrt(c),x=Math.max(1,Math.round(t/S))+1,k=Math.max(1,Math.round(n/S))+1,E=e.random(0,1e3*l),U=[],y=0;y.5){m.fill("#000");var q=e.random(2*Math.PI),W=e.random(.1,1.5)*B/2,I=W*e.random(-.7,.3);m.circle((i+(I+B)*Math.cos(q))/2,(i+(I+B)*Math.sin(q))/2,2*W)}for(var C=i/100,H=0;H.3?u:f,0,0,z,N),m.resetMatrix()}while(e.random()<.8);var A=e.random(0,2*Math.PI),O=e.random(S),Q=n/(k-1)*_+O*Math.cos(A),Y=t/(x-1)*G+O*Math.sin(A);e.image(m,Q-i/2,Y-i/2)}w.shader(v),v.setUniform("u_resolution",[n,t]),v.setUniform("u_alpha",.05),w.rect(0,0,n,t),e.blendMode(e.OVERLAY),e.image(w,0,0)}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}e.disableFriendlyErrors=!0;var a,n,t,i,s,l,d,h,c,u,f,m,M,p,w,b,g,v;e.preload=function(){b=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),g=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),v=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag"),u=e.loadImage("palm-leaf-1.jpg"),f=e.loadImage("palm-leaf-2.jpg")},e.setup=function(){l=2,d=6,h=2,s=80,c="seigler-p5-2-gradient_jungle-",window.onhashchange=function(){a=window.location.hash.substr(1),r()},a=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSB,100),n=e.windowWidth,t=e.windowHeight,e.createCanvas(n,t),i=2*(n+t)/Math.sqrt(s),m=e.createGraphics(i,i),M=e.createGraphics(i,i,e.WEBGL),p=e.createGraphics(i,i,e.WEBGL),w=e.createGraphics(n,t,e.WEBGL),m.noStroke(),M.noStroke(),p.noStroke(),w.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(a=null,r()):"s"==e.key&&e.saveCanvas(c+a+".jpg","jpg")},e.doubleClicked=function(){a=null,r()};var S;e.windowResized=function(){clearTimeout(S),S=setTimeout(function(){window.location.reload()},100)}})}),require.register("2/index.static.hbs",function(e,r,o){}),require.register("3/index.js",function(e,r,o){new p5(function(e){function r(){if(n)e.randomSeed(n);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),e.blendMode(e.BLEND),e.background(291/360,.3,.25);var h=e.random(0,Math.PI),c=Math.min(t,i)/e.random(10,80),u=Math.max(t,i)*Math.SQRT2,f=Math.ceil(Math.SQRT2*u/c),m=t/2,M=i/2,p=Math.cos(h)*u/2,w=Math.sin(h)*u/2;e.strokeCap(e.SQUARE);for(var b=Math.ceil(f/2);b>0;b--)e.stroke(291/360,.3,.2+.1*(b%2)),e.strokeWeight((2*b-1)*c),e.line(m-p,M-w,m+p,M+w);l.shader(d),d.setUniform("u_resolution",[t,i]),d.setUniform("u_alpha",.05),l.rect(0,0,t,i),e.blendMode(e.OVERLAY),e.image(l,0,0),e.blendMode(e.BLEND),e.strokeCap(e.ROUND);for(var g=5,v=Math.max(1,Math.round(i/g))+1,S=Math.max(1,Math.round(t/g))+1,x=1000.37,k=[],E=function(r){var o=r%S,a=Math.floor(r/S),n=s.map(function(r,n){var t=r/Math.min(v,S);return e.noise(x*n+a*t,x*n+o*t)});k.push({row:a,col:o,noise:n})},U=0;U1.75*d-.5)){var f=t/(S-1)*s-g/2,m=i/(v-1)*n-g/2,M=2*Math.PI*a(c)+y,p=(8*u*u+1)*g;e.stroke(.075,.5,h-.2*(o/k.length)+.1),e.strokeWeight(g*(1+2*u*u*u)),e.line(f-p*Math.cos(M),m-p*Math.sin(M),f+p*Math.cos(M),m+p*Math.sin(M))}})}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}function a(e){return 23.8615*Math.pow(e,5)-59.6041*Math.pow(e,4)+47.2472*Math.pow(e,3)-11.3053*Math.pow(e,2)+.806219*e-.00259101}e.disableFriendlyErrors=!0;var n,t,i,s,l,d;e.preload=function(){d=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag")},e.setup=function(){filenamePrefix="seigler-p5-3-peanut_butter_and_jelly-",t=e.windowWidth,i=e.windowHeight,s=[2,2,2,2],window.onhashchange=function(){n=window.location.hash.substr(1),r()},n=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSL,1),e.createCanvas(t,i),l=e.createGraphics(t,i,e.WEBGL),l.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(n=null,r()):"s"==e.key&&e.saveCanvas(filenamePrefix+n+".jpg","jpg")},e.doubleClicked=function(){n=null,r()};var h;e.windowResized=function(){clearTimeout(h),h=setTimeout(function(){window.location.reload()},100)}})}),require.register("3/index.static.hbs",function(e,r,o){}),require.register("4/index.js",function(e,r,o){new p5(function(e){function r(){if(a)e.randomSeed(a);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),e.blendMode(e.BLEND);var u=e.random(0,Math.PI),f=Math.min(n,t)/e.random(10,80),m=Math.max(n,t)*Math.SQRT2,M=Math.ceil(Math.SQRT2*m/f),p=e.random(),w=n/2,b=t/2,g=Math.cos(u)*m/2,v=Math.sin(u)*m/2;d.buffer.strokeCap(e.SQUARE);for(var S=Math.ceil(M/2);S>0;S--)d.buffer.stroke(p,.5,.2+.1*(S%2)),d.buffer.strokeWeight((2*S-1)*f),d.buffer.line(w-g,b-v,w+g,b+v);e.blendMode(e.BLEND);for(var x=Math.min(n,t)/Math.round(e.random(3,10)),k=Math.max(1,Math.round(t/x/Math.sin(Math.PI/3)))+1,E=Math.max(1,Math.round(n/x))+1,U=200*x+Math.SQRT2,y=[],L=function(r){var o=r%E,a=Math.floor(r/E),n=i.map(function(r,n){return e.noise(U*(n+1)+(a-k/2)*r,U*(n+1)+(o-E/2)*r)});y.push({row:a,col:o,noise:n})},_=0;_=3){d.cells.fill(r.site.noise[2]),d.cells.beginShape();for(var o=0;o1&&r(e[e.length-2]+"/index")})}),require.register("___globals___",function(e,r,o){})}(),require("___globals___"),require("initialize"); \ No newline at end of file diff --git a/app-165617be.js b/app-165617be.js new file mode 100644 index 0000000..57d39f0 --- /dev/null +++ b/app-165617be.js @@ -0,0 +1 @@ +!function(){"use strict";var e="undefined"==typeof global?self:global;if("function"!=typeof e.require){var r={},o={},a={},n={}.hasOwnProperty,t=/^\.\.?(\/|$)/,i=function(e,r){for(var o,a=[],n=(t.test(r)?e+"/"+r:r).split("/"),i=0,s=n.length;i.5){u.fill("#000");var H=e.random(2*Math.PI),I=e.random(.1,1.5)*_/2,j=I*e.random(-.7,.3);u.circle((i+(j+_)*Math.cos(H))/2,(i+(j+_)*Math.sin(H))/2,2*I)}do{var q=e.random(2*Math.PI),N=e.random(2*Math.PI);u.stroke(0),u.strokeWeight(1+_*Math.pow(e.random(.7368),3)),u.line(i*(Math.sin(q)+.5),i*(Math.cos(q)+.5),i*(Math.sin(N)+.5),i*(Math.cos(N)+.5))}while(e.random()<.5+.45*U);var R=e.random(0,2*Math.PI),C=e.random(p),T=n/(g-1)*E+C*Math.cos(R),D=t/(v-1)*L+C*Math.sin(R);e.image(u,T-i/2,D-i/2)}m.shader(w),w.setUniform("u_resolution",[n,t]),w.setUniform("u_alpha",.05),m.rect(0,0,n,t),e.blendMode(e.OVERLAY),e.image(m,0,0)}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}e.disableFriendlyErrors=!0;var a,n,t,i,s,d,l,h,u,c,f,m,M,b,w;e.preload=function(){M=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),b=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),w=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag")},e.setup=function(){d=2,l=2,s=70,window.onhashchange=function(){a=window.location.hash.substr(1),r()},a=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSB,100),n=e.windowWidth,t=e.windowHeight,h=e.createCanvas(n,t),i=1.75*(n+t)/Math.sqrt(s),u=e.createGraphics(i,i),c=e.createGraphics(i,i,e.WEBGL),f=e.createGraphics(i,i,e.WEBGL),m=e.createGraphics(n,t,e.WEBGL),u.noStroke(),c.noStroke(),f.noStroke(),m.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(a=null,r()):"s"==e.key&&e.saveCanvas("seigler-p5-1-gradient_burst-"+a+".jpg","jpg")},e.doubleClicked=function(){a=null,r()};var p;e.windowResized=function(){clearTimeout(p),p=setTimeout(function(){window.location.reload()},100)}})}),require.register("1/index.static.hbs",function(e,r,o){}),require.register("2/index.js",function(e,r,o){new p5(function(e){function r(){if(a)e.randomSeed(a);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random()),e.blendMode(e.BLEND),e.background("#000"),e.blendMode(e.ADD);for(var u=n*t/s,S=Math.sqrt(u),x=Math.max(1,Math.round(t/S))+1,k=Math.max(1,Math.round(n/S))+1,y=e.random(0,1e3*d),E=[],L=0;L.5){m.fill("#000");var H=e.random(2*Math.PI),I=e.random(.1,1.5)*W/2,j=I*e.random(-.7,.3);m.circle((i+(j+W)*Math.cos(H))/2,(i+(j+W)*Math.sin(H))/2,2*I)}for(var q=i/100,N=0;N.3?c:f,0,0,V,D),m.resetMatrix()}while(e.random()<.8);var O=e.random(0,2*Math.PI),A=e.random(S),Q=n/(k-1)*_+A*Math.cos(O),Y=t/(x-1)*G+A*Math.sin(O);e.image(m,Q-i/2,Y-i/2)}w.shader(g),g.setUniform("u_resolution",[n,t]),g.setUniform("u_alpha",.05),w.rect(0,0,n,t),e.blendMode(e.OVERLAY),e.image(w,0,0)}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}e.disableFriendlyErrors=!0;var a,n,t,i,s,d,l,h,u,c,f,m,M,b,w,p,v,g;e.preload=function(){p=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),v=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),g=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag"),c=e.loadImage("palm-leaf-1.jpg"),f=e.loadImage("palm-leaf-2.jpg")},e.setup=function(){d=2,l=6,h=2,s=80,u="seigler-p5-2-gradient_jungle-",window.onhashchange=function(){a=window.location.hash.substr(1),r()},a=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSB,100),n=e.windowWidth,t=e.windowHeight,e.createCanvas(n,t),i=2*(n+t)/Math.sqrt(s),m=e.createGraphics(i,i),M=e.createGraphics(i,i,e.WEBGL),b=e.createGraphics(i,i,e.WEBGL),w=e.createGraphics(n,t,e.WEBGL),m.noStroke(),M.noStroke(),b.noStroke(),w.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(a=null,r()):"s"==e.key&&e.saveCanvas(u+a+".jpg","jpg")},e.doubleClicked=function(){a=null,r()};var S;e.windowResized=function(){clearTimeout(S),S=setTimeout(function(){window.location.reload()},100)}})}),require.register("2/index.static.hbs",function(e,r,o){}),require.register("3/index.js",function(e,r,o){new p5(function(e){function r(){if(n)e.randomSeed(n);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),e.blendMode(e.BLEND),e.background(291/360,.3,.25);var h=e.random(0,Math.PI),u=Math.min(t,i)/e.random(10,80),c=Math.max(t,i)*Math.SQRT2,f=Math.ceil(Math.SQRT2*c/u),m=t/2,M=i/2,b=Math.cos(h)*c/2,w=Math.sin(h)*c/2;e.strokeCap(e.SQUARE);for(var p=Math.ceil(f/2);p>0;p--)e.stroke(291/360,.3,.2+.1*(p%2)),e.strokeWeight((2*p-1)*u),e.line(m-b,M-w,m+b,M+w);d.shader(l),l.setUniform("u_resolution",[t,i]),l.setUniform("u_alpha",.05),d.rect(0,0,t,i),e.blendMode(e.OVERLAY),e.image(d,0,0),e.blendMode(e.BLEND),e.strokeCap(e.ROUND);for(var v=5,g=Math.max(1,Math.round(i/v))+1,S=Math.max(1,Math.round(t/v))+1,x=1000.37,k=[],y=function(r){var o=r%S,a=Math.floor(r/S),n=s.map(function(r,n){var t=r/Math.min(g,S);return e.noise(x*n+a*t,x*n+o*t)});k.push({row:a,col:o,noise:n})},E=0;E1.75*l-.5)){var f=t/(S-1)*s-v/2,m=i/(g-1)*n-v/2,M=2*Math.PI*a(u)+L,b=(8*c*c+1)*v;e.stroke(.075,.5,h-.2*(o/k.length)+.1),e.strokeWeight(v*(1+2*c*c*c)),e.line(f-b*Math.cos(M),m-b*Math.sin(M),f+b*Math.cos(M),m+b*Math.sin(M))}})}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}function a(e){return 23.8615*Math.pow(e,5)-59.6041*Math.pow(e,4)+47.2472*Math.pow(e,3)-11.3053*Math.pow(e,2)+.806219*e-.00259101}e.disableFriendlyErrors=!0;var n,t,i,s,d,l;e.preload=function(){l=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag")},e.setup=function(){filenamePrefix="seigler-p5-3-peanut_butter_and_jelly-",t=e.windowWidth,i=e.windowHeight,s=[2,2,2,2],window.onhashchange=function(){n=window.location.hash.substr(1),r()},n=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSL,1),e.createCanvas(t,i),d=e.createGraphics(t,i,e.WEBGL),d.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(n=null,r()):"s"==e.key&&e.saveCanvas(filenamePrefix+n+".jpg","jpg")},e.doubleClicked=function(){n=null,r()};var h;e.windowResized=function(){clearTimeout(h),h=setTimeout(function(){window.location.reload()},100)}})}),require.register("3/index.static.hbs",function(e,r,o){}),require.register("4/index.js",function(e,r,o){new p5(function(e){function r(){if(a)e.randomSeed(a);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),e.blendMode(e.BLEND);var c=e.random(0,Math.PI),f=Math.min(n,t)/e.random(10,80),m=Math.max(n,t)*Math.SQRT2,M=Math.ceil(Math.SQRT2*m/f),b=e.random(),w=n/2,p=t/2,v=Math.cos(c)*m/2,g=Math.sin(c)*m/2;l.buffer.strokeCap(e.SQUARE);for(var S=Math.ceil(M/2);S>0;S--)l.buffer.stroke(b,.5,.2+.1*(S%2)),l.buffer.strokeWeight((2*S-1)*f),l.buffer.line(w-v,p-g,w+v,p+g);e.blendMode(e.BLEND);for(var x=Math.min(n,t)/Math.round(e.random(3,10)),k=Math.max(1,Math.round(t/x/Math.sin(Math.PI/3)))+1,y=Math.max(1,Math.round(n/x))+1,E=200*x+Math.SQRT2,L=[],U=function(r){var o=r%y,a=Math.floor(r/y),n=i.map(function(r,n){return e.noise(E*(n+1)+(a-k/2)*r,E*(n+1)+(o-y/2)*r)});L.push({row:a,col:o,noise:n})},_=0;_=3){l.cells.fill(r.site.noise[2]),l.cells.beginShape();for(var o=0;o.5?a.y=e.random()>.5?t*s*.4:t*(1-.4*s):a.x=e.random()>.5?n*s*.4:n*(1-.4*s);var i=e.random(Math.PI/8,Math.PI),d=Math.atan2(t/2-a.y,n/2-a.x);d+=e.random(-.25,.25)*i,r.beginShape(),r.vertex(a.x,a.y);var l=0;do{var h=a.x,c=a.y,f=a.x+u/2*Math.cos(d),m=a.y+u/2*Math.sin(d);d+=e.random(-1,1)*i,r.quadraticVertex(h,c,e.lerp(h,f,.5),e.lerp(c,m,.5)),a={x:f,y:m},l++}while(l<80||a.x>-u/2&&a.x-u/2&&a.y1&&r(e[e.length-2]+"/index")})}),require.register("___globals___",function(e,r,o){})}(),require("___globals___"),require("initialize"); \ No newline at end of file diff --git a/index.html b/index.html index 7909ea3..5e415f3 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,10 @@

P5.js generative art

+
+ layers of meandering dark curves with one glowing, colored curve +
2019-11-12 - glow path
+
colored pinstripes distorted by a field of smoothed lenses of varying strength
2019-11-10 - lenses
diff --git a/shaders/displacement.frag b/shaders/displacement.frag index 4818799..9dc7efe 100644 --- a/shaders/displacement.frag +++ b/shaders/displacement.frag @@ -13,12 +13,14 @@ uniform float u_intensity; void main() { vec2 uv = vTexCoord; - // the texture is loaded upside down and backwards by default so lets flip it - uv = 1.0 - uv; // get the displacement map as a vec4 using texture2D vec4 mapTex = texture2D(u_map, uv); + // the texture is loaded upside down and backwards by default so lets flip it + // uv = 1.0 - uv; + uv[1] = 1.0 - uv[1]; + // lets get the average color of the rgb values float avg = dot(mapTex.rgb, vec3(0.33333));