diff --git a/dist/images/38c3_visuals.png b/dist/images/38c3_visuals.png new file mode 100644 index 0000000..4d7b256 Binary files /dev/null and b/dist/images/38c3_visuals.png differ diff --git a/dist/images/arthurtent.jpeg b/dist/images/arthurtent.jpeg new file mode 100644 index 0000000..abaa680 Binary files /dev/null and b/dist/images/arthurtent.jpeg differ diff --git a/dist/images/preview/CallOfThesiren.frag.png b/dist/images/preview/CallOfThesiren.frag.png new file mode 100644 index 0000000..6991309 Binary files /dev/null and b/dist/images/preview/CallOfThesiren.frag.png differ diff --git a/dist/images/preview/Christmas_tree.frag.png b/dist/images/preview/Christmas_tree.frag.png new file mode 100644 index 0000000..7eafee9 Binary files /dev/null and b/dist/images/preview/Christmas_tree.frag.png differ diff --git a/dist/images/preview/DodecaIcosaAndStellations.frag.png b/dist/images/preview/DodecaIcosaAndStellations.frag.png new file mode 100644 index 0000000..532abe3 Binary files /dev/null and b/dist/images/preview/DodecaIcosaAndStellations.frag.png differ diff --git a/dist/images/preview/ElectricDream.frag.png b/dist/images/preview/ElectricDream.frag.png new file mode 100644 index 0000000..a3f86f9 Binary files /dev/null and b/dist/images/preview/ElectricDream.frag.png differ diff --git a/dist/images/preview/EyeOfHajiSauron.frag.png b/dist/images/preview/EyeOfHajiSauron.frag.png new file mode 100644 index 0000000..915ff06 Binary files /dev/null and b/dist/images/preview/EyeOfHajiSauron.frag.png differ diff --git a/dist/images/preview/MerryChristmasKishimisu.frag.png b/dist/images/preview/MerryChristmasKishimisu.frag.png new file mode 100644 index 0000000..ca00dfd Binary files /dev/null and b/dist/images/preview/MerryChristmasKishimisu.frag.png differ diff --git a/dist/images/preview/echappatoire.frag.png b/dist/images/preview/echappatoire.frag.png new file mode 100644 index 0000000..1c8128d Binary files /dev/null and b/dist/images/preview/echappatoire.frag.png differ diff --git a/dist/images/preview/echappatoire_with_heart.frag.png b/dist/images/preview/echappatoire_with_heart.frag.png new file mode 100644 index 0000000..336be63 Binary files /dev/null and b/dist/images/preview/echappatoire_with_heart.frag.png differ diff --git a/dist/images/preview/new_colorful_galaxy.frag.png b/dist/images/preview/new_colorful_galaxy.frag.png new file mode 100644 index 0000000..c5c7ca2 Binary files /dev/null and b/dist/images/preview/new_colorful_galaxy.frag.png differ diff --git a/dist/images/preview/nn_c.frag.png b/dist/images/preview/nn_c.frag.png new file mode 100644 index 0000000..8d681b7 Binary files /dev/null and b/dist/images/preview/nn_c.frag.png differ diff --git a/dist/images/preview/pantera_rosa_CRT.frag.png b/dist/images/preview/pantera_rosa_CRT.frag.png new file mode 100644 index 0000000..8f55937 Binary files /dev/null and b/dist/images/preview/pantera_rosa_CRT.frag.png differ diff --git a/dist/images/social-square-2.png b/dist/images/social-square-2.png new file mode 100644 index 0000000..6b2145c Binary files /dev/null and b/dist/images/social-square-2.png differ diff --git a/dist/manifest.json b/dist/manifest.json index d7c36f6..3df4605 100644 --- a/dist/manifest.json +++ b/dist/manifest.json @@ -1,6 +1,6 @@ { "name": "ShaderAmp", - "version": "1.0.2", + "version": "1.0.3", "description": "Unofficial ShaderToy Chrome Extension to visualize sound of any page.", "manifest_version": 3, "options_page": "options.html", diff --git a/dist/shaders/AudioVisualizerBars3_sidhu.frag b/dist/shaders/AudioVisualizerBars3_sidhu.frag index 51c1d48..f29b02c 100644 --- a/dist/shaders/AudioVisualizerBars3_sidhu.frag +++ b/dist/shaders/AudioVisualizerBars3_sidhu.frag @@ -4,14 +4,70 @@ // Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. // https://creativecommons.org/licenses/by-nc-sa/3.0/ uniform float iAmplifiedTime; +uniform float iTime; uniform sampler2D iAudioData; uniform sampler2D iChannel0; uniform sampler2D iChannel1; uniform vec2 iResolution; uniform vec2 iMouse; varying vec2 vUv; - #define AA 1.5/iResolution.y +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} + float ss(float e, float v) { @@ -26,7 +82,17 @@ float ss(float e, float v, float m) void main() { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); vec2 uv = -1.0 + 2.0 *vUv; + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(uv,-1.5)); + mat3 t = mat3(1.0); + camera(uv, ro, rd, t); uv = (-uv * 2.0); float barCount = 50.0; @@ -57,4 +123,7 @@ void main() ss(d, w) * b * ss(s + 0.01, d)); gl_FragColor = vec4(col,1.0); -} \ No newline at end of file + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + gl_FragColor+=vec4(bg, 1.); +} diff --git a/dist/shaders/CallOfThesiren.frag b/dist/shaders/CallOfThesiren.frag new file mode 100644 index 0000000..1530016 --- /dev/null +++ b/dist/shaders/CallOfThesiren.frag @@ -0,0 +1,384 @@ +// https://www.shadertoy.com/view/7sSSDd +// Modified by ArthurTent +// Created by Quasimondo +// Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +// https://creativecommons.org/licenses/by-nc-sa/3.0/ + +uniform float iAmplifiedTime; +uniform float iTime; +uniform sampler2D iAudioData; +uniform vec2 iResolution; +uniform vec2 iMouse; +varying vec2 vUv; + + +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; + +//Parts of this shader code are based on the work of Blackle Mori / https://www.shadertoy.com/view/wtVyWK +//Siren model trained and customized by Mario Klingemann / @Quasimondo + +vec4 r(vec2 pp,float t,vec2 q) { + vec4 p = vec4(pp,q.yx*1.5); + p*=1.+snd*1.3; + vec4 f0_0=sin(p.x*vec4(-1.21,-.03,1.20,-1.17)+p.y*vec4(-.28,1.35,1.36,-1.23)+p.z*vec4(-.12,-.05,-.04,-.06)+p.w*vec4(-.18,-.12,-.13,-.48)+vec4(-.46,1.24,.40,-.30)); + + f0_0/=1.+snd; + +vec4 f0_1=sin(p.x*vec4(-1.56,1.50,.48,1.36)+p.y*vec4(.10,-.75,.31,1.04)+p.z*vec4(-.27,-.03,-.03,-.05)+p.w*vec4(.01,-.16,-.41,.29)+vec4(.22,.21,.81,-1.16)); +vec4 f0_2=sin(p.x*vec4(-.94,-.22,1.00,1.10)+p.y*vec4(.38,-.74,.05,-1.54)+p.z*vec4(.04,-.05,-.06,-.06)+p.w*vec4(-.46,-.18,.20,.27)+vec4(.12,.97,.20,-.44)); +vec4 f0_3=sin(p.x*vec4(-1.13,-.72,.47,-1.66)+p.y*vec4(.24,.01,1.57,.56)+p.z*vec4(-.07,.04,-.10,-.00)+p.w*vec4(.32,.30,.08,-.04)+vec4(-.85,.37,-1.02,-1.29)); +vec4 f1_0=sin(mat4(.10,.41,-.34,-.20,.07,-.10,.07,-.20,.24,-.24,-.21,-.11,-.17,.23,-.06,-.16)*f0_0+ + mat4(.05,.25,-.19,-.24,-.24,.01,-.27,.28,-.03,.03,-.08,.06,.07,.01,-.01,.25)*f0_1+ + mat4(.07,.08,.01,.02,-.18,-.10,-.04,-.24,-.12,-.39,.10,.14,-.15,.35,-.29,.19)*f0_2+ + mat4(.15,.02,-.32,.04,-.08,.22,.24,.21,.02,.23,-.07,-.07,.36,.24,-.15,.03)*f0_3+ + vec4(-.18,-.33,.29,-.03))/1.00+f0_0; +vec4 f1_1=sin(mat4(-.31,.19,.11,-.31,.35,-.03,-.24,-.17,.20,.07,-.38,.08,.09,-.04,.16,.21)*f0_0+ + mat4(-.53,-.09,-.17,.22,-.31,-.08,.23,-.33,-.11,-.17,-.40,.23,.12,.27,-.04,-.72)*f0_1+ + mat4(-.47,-.17,-.36,-.02,-.09,-.14,-.17,.37,.29,-.11,-.09,-.02,-.28,.15,.30,.13)*f0_2+ + mat4(-.30,.25,.06,-.26,-.10,.12,.18,.26,-.26,-.02,-.46,-.03,.44,.09,.08,-.19)*f0_3+ + vec4(.06,.12,-.26,.19))/1.00+f0_1; +vec4 f1_2=sin(mat4(-.42,-.18,.15,-.15,-.22,-.34,.12,-.10,-.04,-.21,-.38,.15,-.32,.04,.25,.40)*f0_0+ + mat4(-.25,-.37,-.44,-.09,-.04,.12,-.07,-.17,-.05,-.25,.16,.72,.13,.10,.28,-.07)*f0_1+ + mat4(-.73,.12,.23,-.17,.08,-.28,-.02,.32,.25,-.47,-.23,.42,.24,.29,.07,.02)*f0_2+ + mat4(-.03,.38,.04,-.19,.04,.02,.14,.32,.22,.33,-.02,-.14,.16,.33,.06,-.27)*f0_3+ + vec4(.19,.03,.17,.31))/1.00+f0_2; +vec4 f1_3=sin(mat4(-.17,.11,.22,.05,-.07,-.14,-.01,-.15,-.11,-.22,-.46,.37,.18,.02,.23,-.09)*f0_0+ + mat4(.14,-.17,.31,-.31,.22,-.16,-.32,.44,.39,-.27,-.13,.02,.19,-.17,-.03,.24)*f0_1+ + mat4(-.13,.47,.27,-.30,-.05,-.25,-.08,-.09,.15,-.27,-.65,.02,.13,-.02,.05,-.10)*f0_2+ + mat4(-.54,.12,-.03,-.23,.21,-.14,.26,-.21,-.07,-.27,.20,-.19,.20,.17,-.01,.22)*f0_3+ + vec4(.12,-.20,-.05,.07))/1.00+f0_3; +vec4 f2_0=sin(mat4(-.23,-.03,.42,-.06,.55,-.30,.10,.25,.07,-.36,.13,.40,.23,.64,.17,-.47)*f1_0+ + mat4(.55,-.44,-1.00,-.09,.27,.02,.14,-.16,1.11,.25,-1.03,.20,.52,-.25,.44,.69)*f1_1+ + mat4(-.12,.20,.16,.19,.01,.68,.21,.30,-.33,-.37,.03,-.01,.10,.39,-.21,.28)*f1_2+ + mat4(-.45,.09,.37,.68,-.54,-.04,-.21,.61,-.11,-.14,.38,-.05,-.10,-.10,.07,-.31)*f1_3+ + vec4(-.23,.35,-.30,.31))/1.41+f1_0; +vec4 f2_1=sin(mat4(-.25,-.09,.15,.54,.50,-.07,.08,.25,.17,.16,.38,-.18,.14,.60,-.60,.23)*f1_0+ + mat4(-.32,-.37,.13,-.10,.03,-.65,-.63,-.11,-.20,.01,-.39,-.09,.13,.59,.19,-.42)*f1_1+ + mat4(-.46,.85,-.13,.39,-.14,-.38,-.60,-.18,.14,.12,-.02,-.57,-.42,.43,-.26,-.47)*f1_2+ + mat4(.32,-.67,-.86,.28,-.74,.33,-.26,-.26,-.16,-.14,-.27,-.18,.68,-.75,-.61,.07)*f1_3+ + vec4(-.09,.17,.13,-.46))/1.41+f1_1; +vec4 f2_2=sin(mat4(.35,-.01,-.44,.07,.25,.21,.21,-.14,-.20,.19,-.18,-.12,-.20,.06,-.40,-.27)*f1_0+ + mat4(.20,-.03,-.62,-.10,-.68,.20,-.58,-.50,.46,-.29,.14,.58,.45,-.03,.83,.25)*f1_1+ + mat4(.13,-.21,-.90,.01,.31,-.72,.29,.43,.22,.11,.37,-.46,-.23,-.20,.20,-.47)*f1_2+ + mat4(.15,-.16,.10,-.63,.54,.12,.17,.33,.27,-.04,-.66,-.03,.14,.09,-.29,.20)*f1_3+ + vec4(.09,.24,.31,-.04))/1.41+f1_2; +vec4 f2_3=sin(mat4(-.52,-.23,.03,-.28,.71,.06,.06,.13,.26,.30,.41,-.34,-.27,.04,-.29,.42)*f1_0+ + mat4(-.26,.57,.33,-.07,-.19,-.15,-.03,.35,-.78,-.15,.64,-.18,-.17,-.66,-.12,-.03)*f1_1+ + mat4(.21,-.35,.68,-.47,-.03,-.04,.30,.14,.10,.06,-.11,.20,-.18,.27,.00,.06)*f1_2+ + mat4(-.37,.12,.31,.15,.07,-.70,.15,.58,-.54,-.28,-.20,.07,-.35,-.08,.28,-.04)*f1_3+ + vec4(.62,-.20,.31,.31))/1.41+f1_3; +vec4 f3_0=sin(mat4(-1.07,-.19,.11,.55,.27,-.99,-.29,-.99,-.58,.32,-1.13,-.17,.44,-.74,.16,-.87)*f2_0+ + mat4(-.35,-.11,.54,-.81,-.64,.64,.67,-.18,.03,.17,-.69,-.31,-.47,.95,.69,-.51)*f2_1+ + mat4(.04,-1.12,.15,.62,-.32,.42,.58,-1.14,.00,.39,.29,-.17,.16,.69,.77,-.48)*f2_2+ + mat4(-.33,.07,.46,.74,.33,.71,-.29,.01,.04,.02,.50,-.18,-.07,.43,.65,-.07)*f2_3+ + vec4(-.24,.23,.16,.09))/1.73+f2_0; +vec4 f3_1=sin(mat4(.06,.17,-.07,.85,-.09,.08,-.54,.20,.24,-.39,.35,-.20,.25,-.39,.10,1.06)*f2_0+ + mat4(-1.34,.53,-.28,-.63,.44,-1.03,-.70,-.14,.41,-.28,-1.04,-.61,-.49,-.80,-.81,1.13)*f2_1+ + mat4(.36,.30,.23,.24,.26,-.36,.03,.12,.35,-.00,.16,-.74,.13,.26,-.65,-.65)*f2_2+ + mat4(-.43,-.10,-.07,.08,-.62,.21,-.48,.66,-.23,-.09,.30,.17,-.16,.11,.48,.86)*f2_3+ + vec4(-.36,-.42,.12,-.84))/1.73+f2_1; +vec4 f3_2=sin(mat4(-.03,.66,-.20,.15,-.04,-.06,.79,.27,-.31,-.27,.61,.22,.16,.34,.01,.33)*f2_0+ + mat4(-.07,-.06,-.39,-.08,-.60,-.78,-.27,.28,-.45,.05,.78,.51,.25,.18,.25,.42)*f2_1+ + mat4(-.56,.73,.42,-.40,-.22,1.17,.07,-.62,.20,-1.11,1.24,.11,.24,.17,.83,-1.48)*f2_2+ + mat4(.13,-.30,1.73,-.18,-.90,.19,-.07,.03,-.27,.28,-.71,.29,-.53,.32,-.54,-.04)*f2_3+ + vec4(-.11,-.66,.55,-.09))/1.73+f2_2; +vec4 f3_3=sin(mat4(-.12,.15,-.88,.08,.01,.31,.28,-.20,.06,.12,-.83,.77,-.73,.01,-.29,-.08)*f2_0+ + mat4(-.25,.10,.15,.69,.24,-.04,-.04,-.48,.46,-.07,-.23,-.23,.04,-.13,-.57,-.37)*f2_1+ + mat4(-.23,.39,.00,-.14,-.28,-.06,.10,-1.09,.05,-.16,1.07,.12,.09,-.19,-.21,-1.00)*f2_2+ + mat4(-1.57,-.71,-.55,-.67,.14,-1.05,1.18,-.58,-.57,-.35,-.20,.31,.21,-.45,-.48,.21)*f2_3+ + vec4(.27,-.28,.73,-.58))/1.73+f2_3; +vec4 f4_0=sin(mat4(.89,.39,.15,-.04,-.61,.37,.19,-1.22,-.40,1.05,-1.77,1.20,.03,-1.20,.66,-.00)*f3_0+ + mat4(.10,.02,.36,.15,.40,.18,.54,.03,.18,.64,.53,-.79,-.51,-.29,-.59,.02)*f3_1+ + mat4(.17,.24,-.51,-.07,.27,-.66,1.35,-.63,-.45,.06,.05,-.45,-.51,.49,-.02,-.81)*f3_2+ + mat4(.05,.46,.01,-.69,.75,1.11,.02,-.03,.07,-.82,.18,.76,.79,.23,.50,.63)*f3_3+ + vec4(-.95,1.41,.15,-.06))/2.00+f3_0; +vec4 f4_1=sin(mat4(.53,.44,-.07,.38,.06,-.15,-.21,.94,-.38,-1.59,.38,.45,1.30,.41,-.51,.20)*f3_0+ + mat4(-.32,-.23,-.40,-.47,-.41,-1.94,-1.16,.14,1.06,-.43,-1.74,.22,-.02,.47,-.46,1.03)*f3_1+ + mat4(.63,-.43,1.55,.69,1.32,.20,-.99,-.28,-.42,-.19,-.47,.04,-.32,-.14,-.52,.07)*f3_2+ + mat4(.62,-1.52,1.13,1.26,.26,.64,-.03,-.29,.52,-.16,-.79,-.37,.35,-.72,.48,-.66)*f3_3+ + vec4(.09,-.14,.15,1.24))/2.00+f3_1; +vec4 f4_2=sin(mat4(-.13,.59,.07,.23,.60,.16,.39,1.96,-.95,-.08,-.35,-1.23,-.01,-.87,.92,.93)*f3_0+ + mat4(-.92,-.59,-.41,.45,-1.20,-.72,1.19,-.92,-.15,-.07,-.49,-.37,-.89,-.15,-.20,.40)*f3_1+ + mat4(.52,.09,.38,.02,.41,-1.80,.44,.40,-.38,-.08,-.71,-.85,-1.23,-.24,1.08,-.43)*f3_2+ + mat4(-.29,.67,-.03,-.49,.39,.19,-.92,.95,.20,.09,-.29,-.08,.20,-.27,.29,-.23)*f3_3+ + vec4(.22,-.38,.13,-.11))/2.00+f3_2; +vec4 f4_3=sin(mat4(1.14,-.64,.36,.55,-.65,-.37,-.53,-1.25,-.16,-1.09,.62,-.84,.65,-.41,-.35,.92)*f3_0+ + mat4(-1.88,.86,-.67,1.14,-.14,1.28,.17,.35,-.06,.11,-.30,.29,.49,-.51,.09,.39)*f3_1+ + mat4(1.58,-.46,.17,-1.17,1.19,-1.12,-.01,-.13,-.19,.14,-.60,-.39,-1.15,.56,-.53,-.64)*f3_2+ + mat4(.03,.42,.25,-.93,.52,-.25,.04,.27,.32,-.76,-1.36,-.36,.25,.00,.37,-.63)*f3_3+ + vec4(-.60,.01,-.10,-.19))/2.00+f3_3; +vec4 f5_0=sin(mat4(-1.42,-.24,-.06,-.37,.10,-.92,-.25,.58,-.31,.52,-1.59,.20,.37,.03,.05,-1.34)*f4_0+ + mat4(-.80,.02,.79,-.05,.34,.45,-.31,-.54,-.39,-.05,-.44,.39,.25,.11,1.05,.81)*f4_1+ + mat4(.27,-.06,.87,.04,.24,.18,-.11,-.03,-.32,-.38,-.81,-.46,-.51,-.09,.05,.28)*f4_2+ + mat4(.51,.36,.62,.34,-.25,-.47,-.41,-.07,-.07,.07,-.18,.16,.05,.05,.42,.13)*f4_3+ + vec4(-.06,.19,-.33,-.29))/2.24+f4_0; +vec4 f5_1=sin(mat4(.12,.28,-.42,.49,-.06,.43,.37,.20,-.48,.85,.10,.17,-.31,-.10,-.10,.70)*f4_0+ + mat4(-1.28,.24,-.06,-.70,-.08,-.76,.09,-.39,-.34,.88,-2.23,-.71,-.90,-.79,-.10,.62)*f4_1+ + mat4(-.12,.16,-.07,-.93,.26,1.79,.13,.98,.30,-.26,-.49,-.12,-.52,.04,-.03,-.63)*f4_2+ + mat4(.18,-.50,.12,-.31,-.36,-.36,-.10,1.07,.56,-.30,-.04,.49,.08,.21,-.24,.54)*f4_3+ + vec4(-.07,-.02,-.33,-.66))/2.24+f4_1; +vec4 f5_2=sin(mat4(-.20,.60,.08,-.17,-.35,.07,-.62,-.09,-.63,-.42,.61,-.37,.27,.41,-.74,.65)*f4_0+ + mat4(.30,.39,-.80,.23,-.85,.51,-.46,-.16,.63,.47,.47,-.25,.33,-.48,.23,.41)*f4_1+ + mat4(-.07,.39,.38,-.03,.76,1.01,.02,-.22,-.24,-.18,-.32,.45,-.41,.40,-.19,-.99)*f4_2+ + mat4(-1.57,-.82,-.82,.09,-.64,.10,-.29,-.20,1.22,.26,.32,-.23,.23,.11,-.39,.12)*f4_3+ + vec4(-.74,-.17,.34,.27))/2.24+f4_2; +vec4 f5_3=sin(mat4(.01,.59,-.10,.42,.22,.75,-.08,.21,.43,-.26,.50,-.45,-.03,.45,.28,.20)*f4_0+ + mat4(-.27,-.76,-.14,1.34,-.48,.24,-1.08,-1.32,-.37,.22,.08,-.31,-.25,-.81,.38,-.27)*f4_1+ + mat4(.12,.40,.57,-.75,.12,.00,-.52,1.38,.83,.03,.62,-.97,-.14,-.81,-.36,-.50)*f4_2+ + mat4(-.85,-.09,-.01,.46,.08,-.07,.64,-.06,-.30,-.99,-.34,1.28,.26,.00,-.47,.27)*f4_3+ + vec4(-.32,.29,-.09,-.25))/2.24+f4_3; +vec4 f6_0=sin(mat4(.47,.26,-.79,.58,1.38,1.96,.86,.10,-.19,.68,-.72,-.26,-.22,.05,-.03,.79)*f5_0+ + mat4(-.08,-.23,1.80,-.37,1.24,.30,-1.46,-.30,.15,-.77,1.57,.17,-.27,.73,.69,-1.22)*f5_1+ + mat4(-.70,-.16,-1.67,1.02,-.95,.55,-.42,.20,1.26,.47,.36,-.69,-1.09,.40,.38,.21)*f5_2+ + mat4(-1.11,-.35,-.33,-1.35,1.16,.22,1.32,.71,.78,-.30,-.29,-.47,-.34,-.57,-.67,.15)*f5_3+ + vec4(.61,1.28,.07,-.23))/2.45+f5_0; +vec4 f6_1=sin(mat4(-.28,-.09,-1.03,-.13,.53,.20,1.28,-2.11,-.62,.05,-.75,1.13,.54,.31,-.78,.77)*f5_0+ + mat4(.46,-.93,-.34,-.80,-.95,-1.56,.42,.61,1.61,-.90,.03,2.71,-.05,.51,-.98,.39)*f5_1+ + mat4(-.94,.10,-.55,.10,-.64,.30,-1.17,.19,.35,-.31,.40,.93,-.64,.78,1.04,-.31)*f5_2+ + mat4(-.50,-.88,.40,-1.08,.88,.28,1.20,-.96,-.88,-.21,-1.03,1.79,-1.25,-.22,-1.39,.13)*f5_3+ + vec4(-.01,.55,1.31,-.13))/2.45+f5_1; +vec4 f6_2=sin(mat4(-.57,1.18,.05,-.17,.21,-.07,.05,-.32,.07,-.56,1.33,.39,-.25,-.14,.66,.92)*f5_0+ + mat4(-.13,1.29,-1.58,.34,-1.17,-.65,.93,-.29,.86,-.01,-.62,-.54,-.74,-.67,-.87,-.69)*f5_1+ + mat4(2.07,-.69,-.14,.86,-.31,-.20,-.63,.36,.39,-.65,-.25,-.22,.34,-.52,-.22,-.70)*f5_2+ + mat4(.76,-.30,-1.15,-.28,.26,1.37,.62,-.45,.11,-.05,.13,.81,-.28,-.45,.26,.49)*f5_3+ + vec4(.99,-.66,.59,.53))/2.45+f5_2; +vec4 f6_3=sin(mat4(.05,.62,.48,.38,.66,-.06,-1.24,-.07,-.15,-.99,-.01,-.04,-.68,-.17,-.34,.23)*f5_0+ + mat4(-.50,1.36,-1.00,.36,-.06,-.39,.69,-.67,-1.26,-1.10,-1.47,-1.67,-.37,.40,.50,-.01)*f5_1+ + mat4(.44,-.87,.29,-.86,-1.44,-.01,.40,.55,-.11,.03,-.23,-.56,1.02,-.29,-.58,-.75)*f5_2+ + mat4(1.90,.42,-.09,-.32,.46,-1.36,-.08,.46,-.37,.32,-.21,-.53,-.80,-.47,-.17,1.47)*f5_3+ + vec4(1.61,-.19,-.39,-.26))/2.45+f5_3; +vec4 f7_0=sin(mat4(.98,.63,-.71,.61,.34,1.16,.67,-.31,.19,.13,-1.37,.51,.94,1.12,-.90,.20)*f6_0+ + mat4(-.00,-.11,.63,-.43,.43,-.95,-.97,-2.06,.50,-.29,-.26,-.52,-.36,-.34,.42,1.71)*f6_1+ + mat4(-.09,1.18,.00,1.83,-.07,1.16,.85,.12,.70,-.33,.51,-.54,.74,.69,-.29,.38)*f6_2+ + mat4(.21,-.22,-.13,.63,-.84,-.29,.63,-.24,-.37,-.29,-.41,1.17,-1.40,-.71,.04,.27)*f6_3+ + vec4(.49,.46,.28,-.53))/2.65+f6_0; +vec4 f7_1=sin(mat4(-.02,-.93,1.10,-.01,-.35,.66,-.31,.94,-1.05,-.12,1.13,-.10,-.35,-.22,.24,-.23)*f6_0+ + mat4(1.81,-.21,.89,-.05,.78,1.69,-.36,-.62,.04,-.58,-1.72,.37,1.02,-1.38,.24,2.23)*f6_1+ + mat4(.32,1.14,1.18,.12,-.78,-1.30,.83,-.42,.80,.53,.14,.15,-.14,.13,.02,.17)*f6_2+ + mat4(.64,.13,-.13,.05,.09,.23,-.78,-.11,.07,-.16,.86,-.72,-.89,-.82,1.14,-.66)*f6_3+ + vec4(1.38,.45,-.57,1.55))/2.65+f6_1; +vec4 f7_2=sin(mat4(.61,.38,-1.20,-.89,-.02,-.92,.88,-.01,.47,.20,-.56,.04,.46,.43,-.12,-.17)*f6_0+ + mat4(-.81,-.55,-.99,-1.25,-.53,-.69,-1.15,.58,-1.35,-.04,-.95,-.85,.12,.77,.34,-.74)*f6_1+ + mat4(1.85,-.95,-.14,.58,.83,2.59,.09,-.98,-.31,-.74,1.11,-.46,-.22,-.59,-.35,-1.05)*f6_2+ + mat4(.31,.52,.16,-.11,1.30,-.23,.62,-.92,.28,.46,-.60,1.32,1.45,.33,-1.21,.69)*f6_3+ + vec4(-.79,-1.16,.36,-1.08))/2.65+f6_2; +vec4 f7_3=sin(mat4(-.20,.54,-.39,.09,-.43,.53,-.43,.06,-1.08,1.04,-.45,.66,-.22,-.25,-.54,.10)*f6_0+ + mat4(-1.01,.07,1.36,.01,.11,.61,-.96,.10,-.92,-.30,.52,.63,-.59,-.07,.23,.80)*f6_1+ + mat4(-.93,-.06,-1.50,-1.34,-.74,-.47,-.33,-.44,-.93,.71,-.26,-.27,-2.55,-.30,-.12,.44)*f6_2+ + mat4(-.67,-.44,.61,.14,.48,-.46,.81,-.73,-.62,-.15,-.37,.90,.57,.73,-.21,-.20)*f6_3+ + vec4(-1.03,-.10,-.18,.13))/2.65+f6_3; +vec4 f8_0=sin(mat4(.21,-.53,.73,-1.15,.41,-.59,-1.01,.59,-2.03,.76,1.25,-1.22,-.26,.43,.53,-.85)*f7_0+ + mat4(.44,-.46,-.08,-1.49,-.82,.21,.38,.08,.40,.52,.04,-.67,.89,-.20,-1.96,-.47)*f7_1+ + mat4(-.69,-.67,-.05,-.10,1.01,1.01,.62,-.81,.52,-.44,-.82,.12,.47,-.04,-.47,-1.19)*f7_2+ + mat4(.12,-.72,-.85,-.86,-.48,.58,.08,1.24,.01,-.93,.28,-.03,-1.01,.52,.48,-.95)*f7_3+ + vec4(.50,.40,-.29,.12))/2.83+f7_0; +vec4 f8_1=sin(mat4(-.23,-.33,-.85,-.06,-.03,.89,-.70,-.07,-.15,-.20,.49,.71,.82,.94,-.71,-.67)*f7_0+ + mat4(.06,.17,.70,-.55,.83,1.72,-.59,-1.42,.09,-.06,-.60,.75,.76,-.28,.76,-2.43)*f7_1+ + mat4(-1.92,.47,-.38,.22,.42,.33,-.10,-.76,-.56,.35,-.11,-.26,1.11,.41,-.36,.60)*f7_2+ + mat4(.69,-.27,-.32,.35,.28,-.41,-.48,-.99,.24,-.04,.60,-.57,.74,-.15,.17,.19)*f7_3+ + vec4(-.11,.41,-.20,-.06))/2.83+f7_1; +vec4 f8_2=sin(mat4(.07,.51,.15,-1.41,.63,.14,-.03,.17,-.13,.17,.15,.02,-.01,-.08,-.01,-.15)*f7_0+ + mat4(-.34,.12,.22,.69,-.09,.97,.13,-.70,-.05,-.17,.10,.14,-.78,-.79,1.21,.51)*f7_1+ + mat4(-2.09,.11,.56,-.11,-.22,-1.67,.25,-.53,.03,-.84,-1.17,-.28,-.58,.80,.79,-1.09)*f7_2+ + mat4(-.18,1.02,-.40,-.38,.18,-.58,-.91,-1.22,.16,-.12,-.29,.22,.39,.30,-.15,-.57)*f7_3+ + vec4(.35,-.53,.52,.98))/2.83+f7_2; +vec4 f8_3=sin(mat4(.16,.25,-1.50,.10,.78,-.47,.37,-.71,.25,-.67,-1.07,.47,.62,-.06,-.28,-.45)*f7_0+ + mat4(-1.32,-.20,-1.02,-1.23,.91,.30,1.63,-1.34,.74,1.51,-.23,-1.03,-.27,-.45,.40,.91)*f7_1+ + mat4(1.58,.64,-.39,-.02,.90,-1.37,-.62,.98,-.12,.31,-.69,.27,.74,-.15,-.35,-.27)*f7_2+ + mat4(-1.86,.51,-.30,.11,.30,-.16,.49,-.19,-.03,.23,-.59,.46,.11,-.54,-.93,-.51)*f7_3+ + vec4(-.18,.08,-.25,-.12))/2.83+f7_3; +vec4 f9_0=sin(mat4(-2.50,-.16,-.17,-.09,.17,1.60,1.59,1.37,1.08,-.74,.55,-.91,.35,-.31,.44,-.86)*f8_0+ + mat4(-.50,-.61,.20,-.35,.81,.19,.54,1.08,.16,-.05,-1.89,-1.83,-1.06,-.24,1.56,.34)*f8_1+ + mat4(-.25,.50,.71,1.79,.16,-2.20,-.28,-1.52,.18,2.27,.65,1.39,-1.66,-.10,.46,-.19)*f8_2+ + mat4(-.35,.62,-.83,.10,-.16,.28,-.55,.68,.33,-.18,.76,.27,-.30,-.35,-.64,-.12)*f8_3+ + vec4(-1.00,.77,1.20,.90))/3.00+f8_0; +vec4 f9_1=sin(mat4(.05,-.45,.68,.59,1.11,-.56,.07,-.37,1.70,-1.19,.08,.56,.68,.28,-.29,.73)*f8_0+ + mat4(1.36,.17,-.24,.36,.11,.03,-1.18,-1.23,-1.46,-1.32,-1.42,-.35,.74,.80,-.10,.99)*f8_1+ + mat4(2.95,1.78,-.93,-2.56,-.56,-.53,-.82,.78,-.95,-.91,-.73,-1.79,.33,-.81,.47,-.42)*f8_2+ + mat4(.06,-.56,.30,.75,.11,.33,.33,-2.02,1.23,.41,-.67,-.22,-.31,.48,-.33,.95)*f8_3+ + vec4(.44,.38,.16,-.97))/3.00+f8_1; +vec4 f9_2=sin(mat4(.97,.70,1.16,.60,-.11,.83,-.10,.49,-.31,.87,.47,.05,-.66,.01,-.59,-1.43)*f8_0+ + mat4(.15,-.57,-.06,-.43,.72,.77,-1.36,.04,-.53,-.67,-.26,-.17,-.58,.15,1.53,-.50)*f8_1+ + mat4(1.04,1.20,1.43,.48,.38,-1.15,.92,-1.87,-.10,.41,1.33,.45,-.71,.32,-.37,.54)*f8_2+ + mat4(-1.12,.47,-.25,-.59,-.02,-.57,.73,.10,-.27,-.28,1.19,.58,.83,.30,.35,.26)*f8_3+ + vec4(-.22,.79,-.26,.54))/3.00+f8_2; +vec4 f9_3=sin(mat4(.88,-.54,.41,-.75,1.39,.63,.52,-.01,.54,-.72,-.02,1.61,.10,-.23,-.02,-2.57)*f8_0+ + mat4(.40,-.88,.38,.18,.70,-1.88,-.73,-.43,-1.30,.69,.05,-.15,.95,.01,-.95,-1.43)*f8_1+ + mat4(.45,1.92,-.83,1.68,.46,.10,-.62,.45,-.33,.57,.59,.14,.74,-.36,-.38,-.46)*f8_2+ + mat4(-.69,-.10,.19,-.14,1.10,-2.51,-.36,1.14,-.28,.15,.86,-1.48,.63,.16,-.81,-.41)*f8_3+ + vec4(-.71,.73,1.69,1.16))/3.00+f8_3; +vec4 f10_0=sin(mat4(1.25,-1.01,-.85,-.17,-.33,1.44,1.01,.23,-1.49,-1.32,1.06,.77,-1.50,-.70,.17,-.88)*f9_0+ + mat4(.12,.24,-.74,.05,-1.33,1.14,-.09,-1.39,-.85,-.74,.54,-.47,1.35,-1.31,-.11,2.10)*f9_1+ + mat4(2.13,1.36,1.86,.57,-.05,-1.06,.40,.52,-.02,.82,.07,.44,.46,-.28,.64,.22)*f9_2+ + mat4(.19,-.29,-1.01,-.32,-1.07,1.38,.76,.16,-.07,-.76,.41,1.09,-.42,-.56,-.47,-.52)*f9_3+ + vec4(-.12,.75,.49,-.74))/3.16+f9_0; +vec4 f10_1=sin(mat4(.65,.78,-.27,-3.16,.17,.59,1.12,.68,-.32,.00,-1.02,.82,.63,1.71,.05,-1.20)*f9_0+ + mat4(.02,-.32,-.71,-1.18,-1.86,1.02,.67,1.56,.35,-1.73,.13,-.30,1.64,.81,-.03,1.66)*f9_1+ + mat4(.15,.16,-.02,-1.23,.32,1.29,.67,-1.24,-1.16,.38,.71,.52,-1.55,-.20,1.31,.59)*f9_2+ + mat4(-.50,.11,-.22,.24,-.90,.46,1.42,3.61,-.86,.50,-1.23,.63,1.68,.00,-1.81,-1.86)*f9_3+ + vec4(-2.45,1.20,1.60,2.32))/3.16+f9_1; +vec4 f10_2=sin(mat4(.69,-.46,.59,-2.72,-.16,-1.25,-1.94,1.52,-.48,.32,.47,-.32,.21,-.74,.46,-.23)*f9_0+ + mat4(.38,1.18,.53,-1.76,.06,-1.70,-.50,.99,.29,.31,1.01,.28,1.14,.84,1.00,-2.45)*f9_1+ + mat4(-2.77,-.39,-.30,-.97,.97,-.48,.52,1.31,-1.11,-.24,-2.46,1.59,-.12,-.71,-.28,-.86)*f9_2+ + mat4(.61,1.11,.11,.23,-.92,.60,.32,.39,-.25,2.56,-.21,1.82,-.10,.39,1.31,-.24)*f9_3+ + vec4(.29,-.25,-2.16,-.24))/3.16+f9_2; +vec4 f10_3=sin(mat4(-1.76,-.44,-2.00,-.07,1.50,-.64,-.04,.09,.13,-.75,1.15,.06,-.65,-.79,-.45,.21)*f9_0+ + mat4(-.02,-.77,-1.35,-.33,-.16,-.07,-.10,.24,-.27,-.44,-.54,-.66,1.05,-1.48,-1.03,.20)*f9_1+ + mat4(2.31,-.41,-.26,-1.98,.90,-.71,-.09,-.79,-.38,.21,-.20,.72,-.47,-.97,.54,.33)*f9_2+ + mat4(2.18,-.65,.40,-.35,-.39,-1.35,.45,.41,.34,.35,-.40,.62,-1.35,.27,-.43,-1.35)*f9_3+ + vec4(2.38,-1.01,1.29,-2.38))/3.16+f9_3; +vec4 f11_0=sin(mat4(-1.07,-.19,-.30,1.17,-.02,-.22,-.57,.61,.07,.04,-.80,-.69,1.07,-.76,-.95,2.01)*f10_0+ + mat4(-.42,1.57,.11,-.34,-1.79,.66,.24,-1.03,-.44,-1.27,1.16,.19,-.12,-1.25,.36,.24)*f10_1+ + mat4(.66,-2.15,-1.47,-1.90,.17,-.52,.07,-.25,-.77,-.71,-.36,2.27,.16,-1.06,.41,-.74)*f10_2+ + mat4(.71,.56,-.81,1.42,-.59,-.51,1.64,-2.11,-1.33,-.55,-1.81,-.32,.85,.51,-1.13,-.94)*f10_3+ + vec4(-.30,.12,.59,.67))/3.32+f10_0; +vec4 f11_1=sin(mat4(.52,-.19,.38,-1.94,-.58,.87,-1.60,-1.50,1.42,.25,.46,.31,.25,.38,-.26,-1.33)*f10_0+ + mat4(-.72,-.04,-.90,.37,-1.33,2.25,-2.24,.19,-.25,.54,1.83,1.68,1.23,-.43,-.70,-1.70)*f10_1+ + mat4(.72,-.61,-1.64,-3.01,2.08,-.15,1.16,-1.33,.01,1.42,.58,-.99,-.28,-.24,-.87,-1.06)*f10_2+ + mat4(.90,-.68,-1.01,-.00,1.36,-.28,.16,.07,.38,.59,-.57,-.96,.26,-.89,.68,-.05)*f10_3+ + vec4(-.82,.44,.11,.10))/3.32+f10_1; +vec4 f11_2=sin(mat4(.28,.37,-.41,-.13,.62,.55,.85,.05,-1.46,.00,-.41,-.68,1.58,.27,.15,-.20)*f10_0+ + mat4(1.08,-.44,-.56,-.14,.23,-1.04,-.32,.72,-1.59,.66,.23,.68,.22,.37,.31,-.26)*f10_1+ + mat4(.03,-1.39,1.07,1.22,1.02,1.89,1.14,.32,-1.11,-.54,-.97,.61,.67,.60,.17,1.40)*f10_2+ + mat4(.99,-.48,-.37,-.90,-1.45,-.93,-.35,.19,-1.07,.84,.79,-.74,-.16,1.11,.00,-.19)*f10_3+ + vec4(.72,-.96,-.29,.16))/3.32+f10_2; +vec4 f11_3=sin(mat4(.45,-.47,-.39,-.16,-.38,-.36,.07,1.29,-.35,-.89,-.74,1.34,-.31,1.22,.21,-.11)*f10_0+ + mat4(-.31,-.00,.22,-.07,.20,.34,-1.31,-.22,-.41,-.71,1.00,-.11,-.05,-.26,.54,1.36)*f10_1+ + mat4(1.17,.57,.18,.97,.37,-.02,1.51,-.09,-.22,-.50,-1.14,-.80,.97,.00,.21,.60)*f10_2+ + mat4(-1.44,.27,1.16,-.92,-.35,1.31,-.41,-.24,-.14,-.64,1.31,.25,.23,-.28,.65,-.83)*f10_3+ + vec4(-.14,-.67,-.91,.05))/3.32+f10_3; +vec4 f12_0=sin(mat4(.65,.57,-.36,-.97,-.19,-2.12,-.69,.32,-.52,-.94,-2.31,-.43,.37,-.56,-1.43,-1.20)*f11_0+ + mat4(-.59,-.57,-.47,.07,.21,-.57,.63,1.43,.20,-.93,.91,.57,.37,1.14,.09,-.20)*f11_1+ + mat4(.05,.85,-2.40,.13,-.44,-.06,-.33,.59,-1.09,.72,-.02,.84,-.64,-.24,-1.20,-.42)*f11_2+ + mat4(1.13,1.31,.10,-1.85,.28,1.85,.46,-.69,1.14,.59,-1.42,-1.08,.13,.37,-1.06,.64)*f11_3+ + vec4(-.63,-.44,.32,.55))/3.46+f11_0; +vec4 f12_1=sin(mat4(-.04,.16,-1.08,.14,.51,.01,2.03,-.39,-.18,.13,.65,-.57,-.36,-.29,-1.40,-.62)*f11_0+ + mat4(.83,.39,.28,.38,.76,-1.27,.96,-.93,.79,-.48,.92,-.04,-1.09,-.49,-.85,-2.06)*f11_1+ + mat4(.20,-.00,.55,-.93,1.22,.12,-.73,1.04,.67,-.93,.63,.31,-.83,-.76,.56,-.30)*f11_2+ + mat4(-1.50,.13,-.32,1.48,-.76,.02,-1.85,-.80,1.18,-.32,.96,.72,.36,.34,-.91,.22)*f11_3+ + vec4(.62,1.14,1.70,1.16))/3.46+f11_1; +vec4 f12_2=sin(mat4(.67,-.07,-.22,.60,.59,-1.62,.95,-.18,.12,.79,.91,.38,-.81,.38,-.67,.70)*f11_0+ + mat4(-.25,-.33,-.41,-.32,-.76,-1.11,-.13,-.79,-1.58,.86,.27,.90,-1.07,-.45,.12,-.00)*f11_1+ + mat4(.04,-.46,.78,-1.02,-.21,1.14,-.19,-.10,1.22,-.17,-1.00,-1.53,-.43,-1.84,-1.38,-1.03)*f11_2+ + mat4(.85,-.90,.97,-1.27,-.25,-.41,-.41,.27,.84,1.27,.47,.72,-.49,.68,.49,1.51)*f11_3+ + vec4(-.20,-1.22,.45,-.20))/3.46+f11_2; +vec4 f12_3=sin(mat4(.36,.97,.44,-.48,-.22,-.70,.43,.61,-.29,.02,.23,-.09,-1.35,-.23,-.28,-.48)*f11_0+ + mat4(.31,1.03,.11,.03,-.05,.43,.59,-.98,-.96,.02,-.40,.69,.51,.43,.71,-.24)*f11_1+ + mat4(.49,-.23,.93,-.36,.18,-.05,-.63,.54,1.12,1.24,-.02,-1.65,-.06,-.20,.34,-1.02)*f11_2+ + mat4(.42,1.62,-.75,-.55,-.83,-.22,.34,.84,-.32,.56,-1.70,.38,-.31,-.14,-.03,.04)*f11_3+ + vec4(.66,1.11,-.74,-.86))/3.46+f11_3; +vec4 f13_0=sin(mat4(-.87,-.06,-.36,.65,.03,-1.49,-1.23,.55,1.00,.22,1.73,2.04,-.49,.74,.59,1.84)*f12_0+ + mat4(-.13,.39,-.99,.17,.87,1.06,1.71,1.71,.50,.78,.58,-1.36,-.29,-.12,.17,.07)*f12_1+ + mat4(-1.14,-.14,-.19,.27,.93,-1.16,.11,.55,-.59,-.36,.62,.80,-.62,-.78,-1.10,.85)*f12_2+ + mat4(-1.23,.57,.46,.47,-.25,-.05,.32,-.26,2.69,1.09,-.60,1.49,.23,-.01,.10,-.07)*f12_3+ + vec4(-1.69,.92,.73,.89))/3.61+f12_0; +vec4 f13_1=sin(mat4(-.62,.37,-.34,.45,-.81,-.66,-.08,-.43,-.14,.91,-.25,.36,.17,-.55,-.45,.74)*f12_0+ + mat4(-1.65,.79,.74,1.19,-.35,-2.25,.86,-1.03,-.83,-2.19,2.55,-.97,1.27,.35,-.22,-2.03)*f12_1+ + mat4(-.60,1.17,1.09,1.95,.15,-.60,-.20,-1.08,-.63,-1.34,.25,.51,-.46,-1.43,.10,.77)*f12_2+ + mat4(-.68,.63,1.06,1.21,2.24,-.45,-1.35,-.40,-.74,-.10,.38,1.39,-.72,.99,.22,.51)*f12_3+ + vec4(-1.49,.97,-2.02,-1.49))/3.61+f12_1; +vec4 f13_2=sin(mat4(-.09,.05,-.01,.68,.22,1.09,.83,-.44,.17,1.37,-.62,.20,-.57,.31,-1.13,-.65)*f12_0+ + mat4(-.79,.39,-.59,-.71,.36,-2.12,-.28,-.64,.79,.58,-.94,1.56,1.12,-.60,1.04,.54)*f12_1+ + mat4(4.10,-.21,.99,-.87,-2.04,.34,-1.10,-1.31,.25,.07,2.21,-.37,1.19,.25,.88,.04)*f12_2+ + mat4(-.91,-.02,-.70,-1.22,1.01,-1.12,.12,-.33,-.21,.38,-1.09,-.22,-.12,-.45,.66,.84)*f12_3+ + vec4(1.10,-1.22,.90,-1.90))/3.61+f12_2; +vec4 f13_3=sin(mat4(-.06,1.03,.11,-.37,.11,-.38,-.21,.74,.31,.12,-.61,-.64,-.78,.48,-.80,-1.34)*f12_0+ + mat4(.13,.28,-.92,-.56,-.73,-1.21,1.08,-.78,.07,.05,-.66,.78,.52,-.48,-.06,-.97)*f12_1+ + mat4(.80,-.44,.50,.83,.62,.05,-.83,-.29,-1.14,-.68,.60,.98,-.06,.52,-.18,-.20)*f12_2+ + mat4(1.65,.33,-1.90,.63,.65,1.62,.67,-.53,1.07,1.32,-2.49,.55,-.07,.43,-.91,-.70)*f12_3+ + vec4(-1.85,-1.23,1.27,-.69))/3.61+f12_3; +vec4 f14_0=sin(mat4(1.29,-1.49,.86,-1.25,-1.34,1.78,-.60,-1.12,1.04,-1.25,-3.14,-1.56,-1.12,-.75,-1.75,-1.54)*f13_0+ + mat4(-.61,-.14,-.03,.13,-.60,-.46,.27,.89,.21,-.97,-.15,.78,.18,.37,.72,.90)*f13_1+ + mat4(1.34,.07,.51,-1.21,-1.15,.80,-1.41,.25,.73,-.68,.42,-.04,.48,1.50,-.79,.08)*f13_2+ + mat4(-1.06,-.75,1.04,-1.78,2.46,1.12,-.10,1.23,.91,-.35,-.42,-1.51,.50,-.64,-.63,-.90)*f13_3+ + vec4(-.76,-1.14,.65,1.02))/3.74+f13_0; +vec4 f14_1=sin(mat4(-1.63,.29,1.55,-.84,1.70,-.81,-1.79,-.42,.37,.15,.91,-.74,-.55,-.00,-.37,1.27)*f13_0+ + mat4(.00,.51,.51,.27,1.29,2.16,-.22,-.35,-.42,1.60,1.00,-.73,-1.24,.75,1.13,-.18)*f13_1+ + mat4(.69,.40,1.65,-1.47,.61,.85,-.37,1.24,1.40,-.08,-1.10,-1.27,.34,.01,.20,.66)*f13_2+ + mat4(-1.39,.75,.50,1.25,.88,.48,-1.44,-1.04,.78,.04,2.27,-.61,-1.38,.94,.80,.47)*f13_3+ + vec4(2.14,-1.22,-2.07,.02))/3.74+f13_1; +vec4 f14_2=sin(mat4(.22,.24,1.22,.47,1.30,.01,-1.18,.51,1.96,.43,-.91,.16,1.07,.45,1.51,-.65)*f13_0+ + mat4(-.57,-.15,-.69,.38,.09,1.03,.44,1.22,-1.15,.07,1.82,.17,2.16,.12,.88,1.31)*f13_1+ + mat4(-1.37,-2.16,-2.09,1.48,1.65,1.60,.73,.01,-.08,-.80,-1.47,-.32,.21,-.75,.08,1.61)*f13_2+ + mat4(.03,.17,-.26,.16,.57,-.23,1.68,-1.51,.89,1.84,-.88,-.81,-.22,.47,1.69,1.74)*f13_3+ + vec4(2.29,-1.20,-3.67,.61))/3.74+f13_2; +vec4 f14_3=sin(mat4(.48,.15,.20,-.13,.53,-.91,-.53,-.31,-.48,.66,-.18,.35,-1.50,1.31,-.15,.27)*f13_0+ + mat4(-.97,-.13,-.16,-.11,-.03,2.59,-.49,-.16,.31,1.29,1.00,1.56,-.27,.38,-.36,-.53)*f13_1+ + mat4(1.22,-.24,.35,.51,.04,1.95,.24,.27,.25,.24,-.26,1.08,1.23,.73,.33,-.30)*f13_2+ + mat4(-2.77,.19,-.11,.18,-1.07,-.49,.83,-1.64,-1.05,1.07,1.95,2.07,-.18,1.30,-.73,-.26)*f13_3+ + vec4(-2.23,.38,2.54,.25))/3.74+f13_3; +vec4 f15_0=sin(mat4(-1.54,-.71,-1.35,.29,.54,.75,1.07,-.92,-.11,-.71,4.73,.02,-1.70,.84,1.68,.34)*f14_0+ + mat4(.77,.04,-.45,-.18,1.56,5.57,1.33,.27,.26,3.60,-.73,-1.24,.60,.10,.39,-.16)*f14_1+ + mat4(-2.52,.46,3.16,-1.27,2.41,1.15,.29,-.50,-.47,.95,.53,-1.71,1.00,.54,-.31,-.17)*f14_2+ + mat4(-1.07,.33,-.95,.99,-1.06,.57,-2.50,1.59,-1.14,-1.93,1.45,-.37,.49,-.23,.85,1.79)*f14_3+ + vec4(-.60,-.80,.15,1.57))/3.87+f14_0; +vec4 f15_1=sin(mat4(.71,-.08,.64,2.09,-.70,.07,1.00,-.88,1.22,-.30,.59,.36,.94,-.59,-.01,1.10)*f14_0+ + mat4(-.40,.52,.01,-.22,1.23,-2.65,-2.56,.31,-.23,-1.01,-2.42,-.13,-.95,-1.10,.56,3.05)*f14_1+ + mat4(-.65,-2.13,.09,-1.12,.16,.23,-1.06,-1.67,.92,-.50,-.36,-.87,-.49,-.56,-.40,-.95)*f14_2+ + mat4(-1.59,.33,-.20,1.19,-.44,.81,1.68,.70,1.33,.62,-.82,-2.43,-1.86,-.32,.06,1.29)*f14_3+ + vec4(2.71,.58,-.12,-.61))/3.87+f14_1; +vec4 f15_2=sin(mat4(-1.28,.46,.51,2.41,.70,2.56,-1.05,1.00,-.90,.55,.05,-1.54,-.59,-.66,.63,2.07)*f14_0+ + mat4(.39,-.46,.60,-.43,3.05,-.75,2.54,-1.79,.63,-.23,-1.39,-1.32,-1.16,.91,-.50,2.37)*f14_1+ + mat4(-1.15,1.24,-1.07,-7.74,2.07,-.79,2.53,5.22,-.51,-.05,.88,-2.27,.45,.61,-.68,.87)*f14_2+ + mat4(-.81,.09,-1.74,-1.28,-.33,-.79,-1.27,1.84,-.83,-2.11,-1.07,-.22,-.39,-.03,1.09,-.21)*f14_3+ + vec4(1.61,-.69,.85,.44))/3.87+f14_2; +vec4 f15_3=sin(mat4(-.43,.28,.11,2.05,2.92,-.14,.22,-1.33,-.33,-1.06,-.09,-.78,-.28,.55,.16,-.06)*f14_0+ + mat4(-.69,-.40,.15,-.52,-1.83,-.75,-1.01,-1.23,-.88,.62,-.08,-.10,-.01,.38,-.13,2.20)*f14_1+ + mat4(-1.86,.16,.61,-3.00,1.08,-1.02,.50,1.45,.62,-.93,-.44,-2.99,.50,.10,-.35,.12)*f14_2+ + mat4(-2.29,-.62,.09,-1.04,-.69,-.73,-.11,2.85,-.92,-.10,2.25,-2.49,-1.39,.17,-.61,1.64)*f14_3+ + vec4(.48,.19,-3.00,-.68))/3.87+f14_3; +vec4 f16_0=sin(mat4(-1.61,-.78,2.06,-.75,-.63,-.09,-2.66,.38,.22,-.17,-13.77,-1.09,-.53,.33,-5.48,-.27)*f15_0+ + mat4(-1.02,-1.68,1.38,-.77,.01,2.00,7.48,-2.17,-1.43,1.02,.60,-1.65,-.30,-.83,-4.41,3.58)*f15_1+ + mat4(-2.62,-1.50,-7.05,-1.90,.99,.87,4.03,-.37,1.71,4.17,2.01,-.15,-.05,.95,5.35,-1.98)*f15_2+ + mat4(-1.59,-1.20,-.43,-2.08,.68,1.09,9.15,-.48,-1.69,-1.21,-2.80,-3.66,-.29,-.85,-.03,.83)*f15_3+ + vec4(-1.71,-1.42,-.66,1.08))/4.00+f15_0; +vec4 f16_1=sin(mat4(-.09,.64,-.82,-.42,-1.23,-.04,.96,.74,-.91,-.71,-1.37,-.57,-1.24,-.61,-1.24,-2.03)*f15_0+ + mat4(1.85,1.00,-.94,-.42,-7.01,-.52,-.50,-1.80,-2.97,.45,.22,-.67,-1.56,.07,1.04,-.51)*f15_1+ + mat4(-2.11,.59,.61,-.50,-2.09,-1.31,2.47,.87,-1.04,-1.00,.46,.37,-2.93,-.58,.69,.36)*f15_2+ + mat4(1.82,.64,-1.27,-3.65,1.46,-.32,-1.55,-1.16,2.58,-.48,3.32,-1.00,-1.06,-.27,-1.61,.51)*f15_3+ + vec4(1.08,-1.12,.40,.11))/4.00+f15_1; +vec4 f16_2=sin(mat4(.32,1.60,-.38,1.19,-1.98,-.25,-.65,-1.14,.95,-.17,.17,.23,.46,.85,-.06,.86)*f15_0+ + mat4(1.26,1.22,-.54,.44,-5.70,1.42,1.62,-2.76,-3.14,2.32,.22,-3.90,-2.81,-.33,.39,.05)*f15_1+ + mat4(-2.04,2.00,-.78,-.47,-3.22,-1.12,-.18,-1.67,-.55,-1.16,-.08,-1.25,-3.48,-.40,-.04,-2.09)*f15_2+ + mat4(2.96,2.04,-.91,1.97,.83,-.07,.67,3.54,-1.89,1.46,-3.28,-1.07,1.95,-.19,.32,1.06)*f15_3+ + vec4(1.66,-1.28,1.46,-1.12))/4.00+f15_2; +vec4 f16_3=sin(mat4(-.22,1.02,.09,-.14,.26,.02,-.03,-.36,-.18,.08,.03,.34,-2.24,1.07,.18,.70)*f15_0+ + mat4(-.27,.10,.25,.32,1.39,-.63,-2.15,3.63,.92,-.96,-.25,2.26,.80,.64,-.70,-.74)*f15_1+ + mat4(-.08,-.37,-.10,.53,.33,-.46,.54,.89,-.11,-2.32,-.08,.29,1.65,-.43,-.12,-.13)*f15_2+ + mat4(-2.15,1.31,.95,.69,-1.38,1.92,.35,-1.19,-2.68,2.27,4.30,-1.01,.31,1.42,-1.68,-.06)*f15_3+ + vec4(-1.50,1.85,2.09,2.78))/4.00+f15_3; +return vec4(dot(f16_0,vec4(-.26,-.04,.04,-.04)) + dot(f16_1,vec4(-.20,-.01,-.00,-.06)) + dot(f16_2,vec4(-.10,.36,.32,.17)) + dot(f16_3,vec4(-.23,-.30,.42,-.20)) + -0.04, +dot(f16_0,vec4(-.21,-.06,.06,-.06)) + dot(f16_1,vec4(-.26,.14,-.14,.06)) + dot(f16_2,vec4(-.13,.24,.12,.16)) + dot(f16_3,vec4(-.21,.01,.01,.08)) + -0.04, +dot(f16_0,vec4(-.21,-.04,.05,-.06)) + dot(f16_1,vec4(-.23,.24,-.11,.07)) + dot(f16_2,vec4(-.12,.21,.20,.16)) + dot(f16_3,vec4(-.25,-.10,-.19,.12)) + 0.04, +1.0); +} + +const float pi = 3.14159265359; + + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + + vec2 uv = fragCoord/iResolution.xy; + + //vec2 pn = (iMouse.xy/iResolution.xy)*vec2(2.0,-2.0)+vec2(-1.,1.0)+vec2(cos(iTime),sin(iTime))*0.2; + //vec2 pn = uv.yx+vec2(cos(iAmplifiedTime),sin(iAmplifiedTime))*0.2; + //vec2 pn = uv.yx+vec2(cos(iAmplifiedTime/2.)+sin(iAmplifiedTime/3.),sin(iTime))*0.42; + //vec2 pn = uv.yx+vec2(cos(iAmplifiedTime/2.)+sin(iAmplifiedTime/3.),sin(iTime))*1.+snd*2.; + //vec2 pn = uv.yx+vec2(cos(iAmplifiedTime/2.)+.5+snd,sin(iTime));//*1.+snd*2.; + vec2 pn = uv.yx+vec2(snd*cos(iAmplifiedTime/2.),sin(iTime/3.));//*1.+snd*2.; + pn.y -= 0.2; + fragColor = r(( (uv)*vec2(2.0,-2.0)+vec2(-1.,1.0))*vec2(iResolution.x/iResolution.y,1.0),iAmplifiedTime,pn) *.2+snd; + +} + +void main() { + vec2 fragCoord = vUv * iResolution; + mainImage(gl_FragColor, fragCoord); +} diff --git a/dist/shaders/CallOfThesiren.frag.meta b/dist/shaders/CallOfThesiren.frag.meta new file mode 100644 index 0000000..e0e50a5 --- /dev/null +++ b/dist/shaders/CallOfThesiren.frag.meta @@ -0,0 +1,9 @@ +{ + "author": "Quasimondo", + "modifiedBy": "ArthurTent", + "shaderName": "Call of the Siren ", + "url": "https://www.shadertoy.com/view/7sSSDd", + "license": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License", + "licenseURL": "https://creativecommons.org/licenses/by-nc-sa/3.0/", + "shaderSpeed": 0.8 +} diff --git a/dist/shaders/Christmas_tree.frag b/dist/shaders/Christmas_tree.frag new file mode 100644 index 0000000..0176f3f --- /dev/null +++ b/dist/shaders/Christmas_tree.frag @@ -0,0 +1,132 @@ +// https://www.shadertoy.com/view/MfGBWm +// Modified by ArthurTent +// Created by vanshika +// Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +// https://creativecommons.org/licenses/by-nc-sa/3.0/ +// Modified source on shadertoy.com: https://www.shadertoy.com/view/4cVBDw + +uniform float iAmplifiedTime; +uniform float iTime; +uniform sampler2D iAudioData; +uniform vec2 iResolution; +uniform vec2 iMouse; +varying vec2 vUv; + +#define EYES 80. +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} + + +float Eye(vec2 p, vec2 offs, float s1, float s2, float size){ + float c1 = smoothstep(s1, s1-.01, length(size*p)); + float c2 = smoothstep(s2, s2-.01, length(size*p-offs)); + c1 += .003/length(p); // for brightness + c1/=(0.2+snd); + return c1-c2; +} + +mat2 Rot(float a){ + float c = cos(a), s = sin(a); + return mat2(c, -s, s, c); +} + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + + vec2 uv = (fragCoord-.5*iResolution.xy)/iResolution.y; + vec3 cam = normalize(vec3(1.5,uv)); + vec2 cam_uv = (fragCoord-.5*iResolution.xy)/iResolution.y; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(cam_uv,-1.5)); + mat3 t3 = mat3(1.0); + camera(uv, ro, rd, t3); + vec3 bg = stars(rd)*(1.+30.*snd); + + uv *= 5.5; + uv *= Rot(3.1415/2.); + //vec3 col = vec3(0); + vec3 col = bg; + float f = atan(uv.y, uv.x+2.3)/6.28318; + + + float a = smoothstep(.37, .36, length(uv))-smoothstep(.28, .27, length(uv-vec2(.1, -.05))); + float fade = sin(uv.x+.5)*.5+.5; + + for(float i=0.; i<1.; i+=1./EYES){ + vec2 coord = uv-vec2(4.*i-2.2, i*sin(iAmplifiedTime*i)+i*cos(iAmplifiedTime*i)); + float t = smoothstep(i, 0., abs(length(coord))); + col += t*.15*vec3(.1, .4, .3); + float eye = Eye(coord, vec2(-.3*sin(iAmplifiedTime),.3*cos(iAmplifiedTime)), .6, .45, 5./i)*FFT(i*2.); + vec3 color = sin(.2*iAmplifiedTime*vec3(3., 5., 2.)*i)*.5+.5; + color.z *= .3; + col += eye * color; + } + + fragColor = vec4(col,1.0); +} +void main() { + vec2 fragCoord = vUv * iResolution; + mainImage(gl_FragColor, fragCoord); +} + diff --git a/dist/shaders/Christmas_tree.frag.meta b/dist/shaders/Christmas_tree.frag.meta new file mode 100644 index 0000000..7fdf5ee --- /dev/null +++ b/dist/shaders/Christmas_tree.frag.meta @@ -0,0 +1,9 @@ +{ + "author": "vanshika", + "modifiedBy": "ArthurTent", + "shaderName": "Christmas tree ::)", + "url": "https://www.shadertoy.com/view/MfGBWm", + "license": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License", + "licenseURL": "https://creativecommons.org/licenses/by-nc-sa/3.0/", + "shaderSpeed": 0.8 +} diff --git a/dist/shaders/DodecaIcosaAndStellations.frag b/dist/shaders/DodecaIcosaAndStellations.frag new file mode 100644 index 0000000..57f405f --- /dev/null +++ b/dist/shaders/DodecaIcosaAndStellations.frag @@ -0,0 +1,213 @@ +// https://www.shadertoy.com/view/McsXz8 +// Modified by ArthurTent +// Created by ChunderFPV +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +// https://creativecommons.org/licenses/by-nc-sa/3.0/ +uniform float iAmplifiedTime; +uniform float iTime; +uniform sampler2D iAudioData; +uniform sampler2D iVideo; +uniform sampler2D iChannel0; +uniform sampler2D iChannel1; +uniform vec2 iResolution; +uniform vec2 iMouse; +varying vec2 vUv; + +float MAX = 0.5; +// wireframe code from FabriceNeyret2: https://www.shadertoy.com/view/XfS3DK +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +#define O(x,a,b) smoothstep(0., 1., cos(x*6.2832)*.5+.5)*(a-b)+b // oscillate between a & b +#define A(v) mat2(cos((v*3.1416) + vec4(0, -1.5708, 1.5708, 0))) // rotate +#define s(p1, p2) c += .02/abs(L( u, K(p1, v, h), K(p2, v, h) )+.01)*k; // segment +float snd = 0.; +float snd2 = 0.; +const float PI = 3.1415926; +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} +// line +float L(vec2 p, vec3 A, vec3 B) +{ + vec2 a = A.xy, + b = B.xy - a; + p -= a; + float h = clamp(dot(p, b) / dot(b, b), 0., 1.); + if(snd2>MAX)snd2=MAX; + return length(p - b*h)*(0.9-snd2*1.9) + .01*mix(A.z, B.z, h)*(1.+snd2); + //return length(p - b*h)*(0.8-snd2*1.9+FFT(25)+(FFT(1))) + .01*mix(A.z, B.z, h)*(1.+snd2); +} + + +// colormap +vec3 palette(float t) { + if(t <1.)t+=1.; + vec3 a = vec3(0.5); + vec3 b = vec3(0.5); + vec3 c = vec3(1.); + //vec3 d = vec3(0.563,0.416,0.457 + .2); + vec3 d = vec3(0.563,0.416,0.257 + .2); + + //return a + b*cos( 6.28 * c * (t+d)); // A + B * cos ( 2pi * (Cx + D) ) + return a + b*cos( 6.28 * c * (t+d)); // A + B * cos ( 2pi * (Cx + D) ) +} +// cam +vec3 K(vec3 p, mat2 v, mat2 h) +{ + p.zy *= v; // pitch + p.zx *= h; // yaw + if (texelFetch(iChannel0, ivec2(80, 2), 0).x < 1.) // P key + p *= 6. / (p.z+6.); // perspective view + return p; +} + +void mainImage( out vec4 C, in vec2 U ) +{ + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + //snd +=FFT(i); + } + snd /=float(max_freq*20); + //snd /=float(max_freq); + //snd*=2.8; + //snd*=1.8; + //snd*=1.6; + snd2 = snd*1.3; + //snd*=2.; + vec2 cam_uv = -1.0 + 2.0 *vUv; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(cam_uv,-1.5)); + mat3 t3 = mat3(1.0); + camera(cam_uv, ro, rd, t3); + + vec2 R = iResolution.xy, + u = (U+U-R)/R.y*2., + m = (iMouse.xy*2.-R)/R.y; + + float t = iTime/60., + o = t*6., + //o = t*3.*snd2, + j = (u.x > 0.) ? 1.: -1.; // screen side + /* + if (iMouse.z < 1.) // not clicking + m = vec2(sin(t*6.2832)*2., sin(t*6.2832*2.)); // fig-8 movement + */ + mat2 v = A(m.y), // pitch + h = A(m.x); // yaw + + vec3 c = vec3(0), p, + k = vec3(2,1,4)/40. + .05; + + //u.x -= j + j*.7; // split screen + u.x+=sin(iTime/4.)/10.; + u.y+=sin(iTime/4.)/10.; + //u*=.5+(sin(iTime/10.))/2.; + u*=1.-(sin(iTime/10.))/2.; + snd2*=1.1; + { + //p = vec3(0, .618, 1); // stellated dodecahedron + //p = vec3(0, 1, -.618); // icosahedron + + // stella dodeca to icosa + p = vec3(0, O(o, .618, 1.), O(o, 1., -.618)); + //p.z+=(1.+FFT(1)); + p.x+=sin(iTime); + s( vec3(-p.y+FFT(1), p.z+snd2, 0), vec3( 0, -p.y+FFT(1), -p.z) ) + s( vec3(-p.y+FFT(1), p.z+snd2, 0), vec3( 0, -p.y+FFT(1), p.z+snd2) ) + s( vec3(-p.y+FFT(1), p.z+snd2, 0), vec3( p.z+snd2, 0, -p.y+FFT(1)) ) + s( vec3(-p.y+FFT(1), p.z+snd2, 0), vec3( p.z+snd2, 0, p.y*snd2) ) + s( vec3( p.y*snd2, p.z+snd2, 0), vec3( p.y*snd2, -p.z, 0) ) + s( vec3( p.y*snd2, p.z+snd2, 0), vec3( 0, -p.y+FFT(1), -p.z) ) + s( vec3( p.y*snd2, p.z+snd2, 0), vec3( 0, -p.y+FFT(1), p.z+snd2) ) + s( vec3( p.y*snd2, p.z+snd2, 0), vec3(-p.z, 0, -p.y+FFT(1)) ) + s( vec3( p.y*snd2, p.z+snd2, 0), vec3(-p.z, 0, p.y*snd2) ) + s( vec3(-p.y+FFT(1), -p.z, 0), vec3(-p.y+FFT(1), p.z+snd2, 0) ) + s( vec3(-p.y+FFT(1), -p.z, 0), vec3( 0, p.y*snd2, -p.z) ) + s( vec3(-p.y+FFT(1), -p.z, 0), vec3( 0, p.y*snd2, p.z+snd2) ) + s( vec3(-p.y+FFT(1), -p.z, 0), vec3( p.z+snd2, 0, -p.y+FFT(1)) ) + s( vec3(-p.y+FFT(1), -p.z, 0), vec3( p.z+snd2, 0, p.y*snd2) ) + s( vec3( p.y*snd2, -p.z, 0), vec3( 0, p.y*snd2, -p.z) ) + s( vec3( p.y*snd2, -p.z, 0), vec3( 0, p.y*snd2, p.z+snd2) ) + s( vec3( p.y*snd2, -p.z, 0), vec3(-p.z, 0, -p.y+FFT(1)) ) + s( vec3( p.y*snd2, -p.z, 0), vec3(-p.z, 0, p.y*snd2) ) + s( vec3( 0, p.y*snd2, -p.z), vec3( 0, p.y*snd2, p.z+snd2) ) + s( vec3( 0, p.y*snd2, -p.z), vec3( p.z+snd2, 0, p.y*snd2) ) + s( vec3( 0, p.y*snd2, -p.z), vec3(-p.z, 0, p.y*snd2) ) + s( vec3( 0, -p.y+FFT(1), -p.z), vec3( 0, -p.y+FFT(1), p.z+snd2) ) + s( vec3( 0, -p.y+FFT(1), -p.z), vec3( p.z+snd2, 0, p.y*snd2) ) + s( vec3( 0, -p.y+FFT(1), -p.z), vec3(-p.z, 0, p.y*snd2) ) + s( vec3(-p.z, 0, -p.y+FFT(1)), vec3( p.z+snd2, 0, -p.y+FFT(1)) ) + s( vec3(-p.z, 0, p.y*snd), vec3( p.z+snd2, 0, p.y*snd2) ) + s( vec3(-p.z, 0, -p.y+FFT(1)), vec3( 0, p.y*snd2, p.z+snd2) ) + s( vec3(-p.z, 0, -p.y+FFT(1)), vec3( 0, -p.y+FFT(1), p.z+snd2) ) + s( vec3( p.z+snd2, 0, -p.y+FFT(1)), vec3( 0, p.y*snd2, p.z+snd2) ) + s( vec3( p.z+snd2, 0, -p.y+FFT(1)), vec3( 0, -p.y+FFT(1), p.z+snd2) ) + } + snd2/=1.1; + //c*=palette(snd*2.); + c*=palette(snd2*1.5+(sin(iAmplifiedTime))); + C = vec4(c, 1.); + + rd.x+=sin(iTime/1000.); + vec3 bg = stars(rd);//*(1.+30.*snd); + C+=vec4(bg,1.); + + //C = vec4(c + c*c, 1); +} + +void main() { + vec2 fragCoord = vUv * iResolution; + mainImage(gl_FragColor, fragCoord); +} + diff --git a/dist/shaders/DodecaIcosaAndStellations.frag.meta b/dist/shaders/DodecaIcosaAndStellations.frag.meta new file mode 100644 index 0000000..c75a9d7 --- /dev/null +++ b/dist/shaders/DodecaIcosaAndStellations.frag.meta @@ -0,0 +1,9 @@ +{ + "author": "ChunderFPV", + "modifiedBy": "ArthurTent", + "shaderName": "Dodeca, icosa & stellations", + "url": "https://www.shadertoy.com/view/McsXz8", + "license": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License", + "licenseURL": "https://creativecommons.org/licenses/by-nc-sa/3.0/", + "shaderSpeed": 1.0 +} diff --git a/dist/shaders/ElectricDream.frag b/dist/shaders/ElectricDream.frag new file mode 100644 index 0000000..421389b --- /dev/null +++ b/dist/shaders/ElectricDream.frag @@ -0,0 +1,193 @@ +// https://www.shadertoy.com/view/ld23Wd +// Modified by ArthurTent +// Created by mu6k +// Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License +// https://creativecommons.org/licenses/by-nc-sa/3.0/ +uniform float iAmplifiedTime; +uniform float iTime; +uniform sampler2D iVideo; +uniform sampler2D iAudioData; +uniform sampler2D iChannel0; +uniform sampler2D iChannel1; +uniform sampler2D iChannel2; +uniform sampler2D iChannel3; +uniform vec2 iResolution; +uniform vec2 iMouse; +varying vec2 vUv; + +#define VIDEO + +/*by mu6k, Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + +2016-02-02: + + Bugfix, and set a tune from soundcloud to which it reacts better :) + + +2014-03-21: + + An audio visualizer I've been working on... enjoy!!!! + +*/ + +#define s(x) smoothstep(0.15, 0.3, x * 1.1 - 0.1) +vec3 chromaKey(vec3 x, vec3 y){ + vec2 c = s(vec2(x.g - x.r * x.y, x.g)); + + return mix(x, y, c.x * c.y); +} +vec3 getTexture(vec2 p){ + vec4 s = texture(iVideo, p); + return s.xyz * s.w; +} +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + vec2 tuv = fragCoord.xy / iResolution.xy; + vec2 uv = fragCoord.xy / iResolution.yy-vec2(.9,.5); + + float acc = .0; + float best = .0; + float best_acc = .0; + + for (float i = .0; i<0.5; i+=.008) + { + acc+=texture(iAudioData,vec2(i,1.0)).x-.5; + if (acc>best_acc) + { + best_acc = acc; + best = i; + } + } + + vec3 colorize = vec3(.2); + + for (float i = .0; i< 1.0; i+=.05) + { + colorize[int(i*3.0)]+=texture(iAudioData,vec2(i,0.0)).y*pow(i+.5,.9); + } + + colorize = normalize(colorize); + + float offset = best; + + float osc = texture(iAudioData,vec2(offset+tuv.x*.4 +.1,1.0)).x-.5; + osc += texture(iAudioData,vec2(offset+tuv.x*.4 -.01,1.0)).x-.5; + osc += texture(iAudioData,vec2(offset+tuv.x*.4 +.01,1.0)).x-.5; + osc*=.333; + float boost = texture(iAudioData,vec2(.0)).x; + float power = pow(boost,2.0); + + vec3 color = vec3(.0); + + //color += colorize*vec3((power*.9+.1)*0.02/(abs((power*1.4+.2)*osc-uv.y))); + //color += colorize*vec3((power*.9+.1)*0.02/(abs((power*1.4+.2)*osc-uv.y)),osc*power,osc*boost); + color += colorize*vec3((power*.9+.1)*0.02/(abs((power*1.4+.2)*osc-uv.y)),osc*power,osc*boost); + color += colorize*.2*((1.0-power)*.9+.1); + + vec2 buv = uv*(1.0+power*power*power*.25); + //buv.y+=s(power)/10.; + //was drifting to much away + //buv += vec2(pow(power,12.0)*.1,iTime*.05); + + vec2 blocks = mod(buv,vec2(.1))-vec2(.05); + vec2 blocksid = sin((buv - mod(buv,vec2(.1)))*412.07); + float blockint = texture(iChannel0,blocksid,-48.0).y; + float oint = blockint = + - texture(iAudioData,vec2(blockint-.02,.0)).x + +2.0*texture(iAudioData,vec2(blockint,.0)).x + - texture(iAudioData,vec2(blockint+.02,.0)).x; + blockint = pow(blockint*blockint,2.80)*111.0; + //blockint = 1.0; + color += +2.0*blockint*max(.0,min(1.0,(.04+oint*0.05-max(abs(blocks.x),abs(blocks.y)))*500.0))*colorize; + + + color -= length(uv)*.1; + + + //color += texture(iChannel0,fragCoord.xy/256.0).xyz*.01; + color += texture(iChannel0,fragCoord.xy/256.0).xyz*.01; + color = pow(max(vec3(.0),color),vec3(.6)); + + + fragColor = vec4(color,1.0); + + #ifdef VIDEO + vec4 vid = texture(iVideo, buv); + //fragColor+=vid; + + fragColor *= vec4(texture(iVideo,vUv).rgb, .1); + + //tuv.x -=.5; + tuv.x -=.25; + tuv.y-=.20; + //tuv*=best_acc/10.; + //tuv/=best_acc/10.; + //tuv/=best*2.; + /* + if(tuv.x>-0.135 && tuv.x <.1 && tuv.y <.1){ + vid = texture(iVideo, .5+2.*tuv); + //fragColor *=vid*(.1+best*2.); + vec4 greenScreen = vec4(0.,1.,0.,1.); + vec3 diff = vid.xyz-greenScreen.xyz; + float fac = smoothstep(.55-.05,.55+.05,dot(diff,diff)); + + if(iTime <4.5) { + fragColor = mix(vid, fragColor, 1.-fac); + fragColor*=vid; + } + else if(iTime>=4.5 && iTime <7.4){ + vec4 greenScreen = vec4(0.,1.,0.,1.); + vec3 diff = vid.xyz-greenScreen.xyz; + fragColor+=vid*fac; + } + else if(iTime>7.4 && iTime < 11.2) { + float gray = dot(vid.rgb, vec3(0.2126, 0.7152, 0.0722)); + vid = vec4(vec3(gray), vid.a); + fragColor = mix(vid, fragColor, 1.-fac); + fragColor *= vid; + } + else{ + if(best>.35 && best < 0.4){ + vec4 greenScreen = vec4(0.,1.,0.,1.); + vec3 diff = vid.xyz-greenScreen.xyz; + fragColor+=vid*fac; + }else if (best >.4) { + float gray = dot(vid.rgb, vec3(0.2126, 0.7152, 0.0722)); + vid = vec4(vec3(gray), vid.a); + fragColor = mix(vid, fragColor, 1.-fac); + fragColor *= vid; + + } + else{ + fragColor = mix(vid, fragColor, 1.-fac); + fragColor*=vid; + } + } + } + */ + #endif + /*vec3 col0 = vec3(0.0, 0.0, 2.8); + vec3 col1 = vec3(sin(iAmplifiedTime)/1.5 + 10.8 * best_acc, 0.3 + 0.2 * best_acc, 0.2 + 0.3 * best_acc) * pow(best_acc, 2.0) * 3.0; + vec3 col2 = vec3(best_acc, best_acc*2.5, best_acc*5.); + vec3 col_greenscreen = getTexture(.5+2.*tuv); + col0 = chromaKey(col_greenscreen, col0); + col1 = chromaKey(col_greenscreen, col1); + col2 = chromaKey(col_greenscreen, col2); + + fragColor.xyz *= col2; + */ + + /*vid.r *=best_acc*10.*sin(iTime/10.); + vid.g *=best_acc*cos(iTime/5.);; + vid.b *=best_acc*(.5+sin(iTime/20.)); + */ + //fragColor *=vid+fragColor; + + //fragColor *=vid*10.+fragColor; + //fragColor +=vid; +} +void main(){ + vec2 fragCoord = vUv * iResolution; + mainImage(gl_FragColor, fragCoord); +} + diff --git a/dist/shaders/ElectricDream.frag.meta b/dist/shaders/ElectricDream.frag.meta new file mode 100644 index 0000000..fd93541 --- /dev/null +++ b/dist/shaders/ElectricDream.frag.meta @@ -0,0 +1,11 @@ +{ + "author": "mu6k", + "modifiedBy": "ArthurTent", + "shaderName": "Electric Dream", + "url": "https://www.shadertoy.com/view/ld23Wd", + "license": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License", + "licenseURL": "https://creativecommons.org/licenses/by-nc-sa/3.0/", + "iChannel0": "images/sky-night-milky-way-star-a7d722848f56c2013568902945ea7c1b.jpg", + "video": "media/pexels_videos_3931(1080p).mp4", + "shaderSpeed": 1.0 +} diff --git a/dist/shaders/EyeOfHajiSauron.frag b/dist/shaders/EyeOfHajiSauron.frag new file mode 100644 index 0000000..a4dd692 --- /dev/null +++ b/dist/shaders/EyeOfHajiSauron.frag @@ -0,0 +1,291 @@ +// https://www.shadertoy.com/view/X3jcWR +// Modified by ArthurTent +// Created by arminkz +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +// https://creativecommons.org/licenses/by-nc-sa/3.0/ +uniform float iAmplifiedTime; +uniform float iTime; +uniform sampler2D iAudioData; +uniform sampler2D iVideo; +uniform sampler2D iChannel0; +uniform sampler2D iChannel1; +uniform vec2 iResolution; +uniform vec2 iMouse; +varying vec2 vUv; + +// one beat to rule them all +#define MULTI_COLOR +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} + +// colormap +vec3 palette(float t) { + if(t <1.)t+=1.; + vec3 a = vec3(0.5); + vec3 b = vec3(0.5); + vec3 c = vec3(1.); + vec3 d = vec3(0.563,0.416,0.457 + .2); + + return a + b*cos( 6.28 * c * (t+d)); // A + B * cos ( 2pi * (Cx + D) ) +} + +float rand(vec2 n) { + return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453); +} + +float noise(vec2 p){ + vec2 ip = floor(p); + vec2 u = fract(p); + u = u*u*(3.0-2.0*u); + + float res = mix( + mix(rand(ip),rand(ip+vec2(1.0,0.0)),u.x), + mix(rand(ip+vec2(0.0,1.0)),rand(ip+vec2(1.0,1.0)),u.x),u.y); + return res*res; +} + +// used to rotate domain of noise function +const mat2 rot = mat2( 0.80, 0.60, -0.60, 0.80 ); + +// fast implementation of fBM +float fbm( vec2 p ) +{ + float f = 0.0; + f += 0.500000*noise( p + 0.1 * sin(iTime ) + 0.2 * iTime); p = rot*p*2.02; + f += 0.031250*noise( p ); p = rot*p*2.01; + f += 0.250000*noise( p ); p = rot*p*2.03; + f += 0.125000*noise( p + 0.1 * sin(iTime) + 0.2 * iTime ); p = rot*p*2.01; + f += 0.062500*noise( p + 0.3 * sin(iTime) ); p = rot*p*2.04; + f += 0.015625*noise( p ); + return f/0.96875; +} + +float fbm2( vec2 p ) +{ + float f = 0.0; + f += 0.500000*noise( p ); p = rot*p*2.02; + f += 0.031250*noise( p ); p = rot*p*2.01; + f += 0.250000*noise( p ); p = rot*p*2.03; + f += 0.125000*noise( p ); p = rot*p*2.01; + f += 0.062500*noise( p ); p = rot*p*2.04; + f += 0.015625*noise( p ); + return f/0.96875; +} + +float fbm3(vec2 uv) +{ + float f; + mat2 m = mat2( 1.6, 1.2, -1.2, 1.6 ); + f = 0.5000*noise( uv ); uv = m*uv; + f += 0.2500*noise( uv ); uv = m*uv; + f += 0.1250*noise( uv ); uv = m*uv; + f += 0.0625*noise( uv ); uv = m*uv; + f = 0.5 + 0.5*f; + return f*(.8+snd*5.); +} + + +// nested fBM +float pattern( vec2 p ) { + return fbm( p + fbm( p + fbm(p) ) )*snd*10.; +} + + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + /* + //snd = (FFT(1)+FFT(25)+FFT(50)+FFT(75))/4.; + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + //snd*=2.8; + //snd*=1.8; + snd*=1.6; + */ + vec2 cam_uv = -1.0 + 2.0 *vUv; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(cam_uv,-1.5)); + mat3 t3 = mat3(1.0); + camera(cam_uv, ro, rd, t3); + + vec2 uv = (fragCoord - .5*iResolution.xy)/iResolution.y; + /* + float scale = 2.; + uv = (uv-0.5)*scale+1.; + */ + + vec2 uv2 = uv; + uv2.x *= 2.0; + uv.x = abs(uv.x); + + float smooth_view = 0.5; + + + + + float d1 = length(uv2-vec2(-0.5,0.)); + float d2 = length(uv2-vec2(0.5,0.)); + + //float smoothd2 = .4+clamp((sin(iTime) - 0.45)/ (0.55 - 0.45), 0.0, 1.0); + + float dc = length(uv); + + + float r = sqrt(dot(uv,uv)); + float a = atan(uv.y,uv.x); + + + if(smooth_view >0.){ + }else{ + } + vec3 around_eye = smoothstep(0.1,-0.1,abs(max(d1,d2)-0.5) - 0.2)*(.8+5.*snd) * vec3(0.99, 0.81, 0.27); + //vec3 around_eye = smoothstep(0.1,-0.1,abs(max(d1+.2,d2)-0.5) - 0.2)*(.8+5.*snd) * vec3(0.99, 0.81, 0.27); + #ifdef MULTI_COLOR + around_eye *= 0.5+ palette(snd*2.); + //around_eye = smoothstep(0.1,-0.1,abs(max(d1+.2,d2)-0.5) - 0.2)*(.8+5.*snd) * vec3(0.99, 0.81, 0.27); + //around_eye*=10.; + #endif + + vec3 strs = normalize(vec3(uv2,-1.5)); + vec3 col = vec3(0.); + //vec3 rd = normalize(vec3(uv2,-1.5)); + vec3 p1 = mix(vec3(1.,.25,0.1),vec3(0.2,0.2,0.3), fbm(3.*uv)); + #ifdef MULTI_COLOR + //p2=vec3(1.5*flame*(1.+FFT(25)*1.5), 2.*pow(flame*(1.+FFT(50)*1.5),3.), pow(flame*(1.+snd*1.5),6.) ); + p1 *= 0.5+ palette(snd*2.); + //p1 *=palette(snd*20.); + #endif + + float sa = abs(fract(a/6.)-0.5); + float n = fbm2(2. * vec2(r - 0.5*iTime, sa)); + float n2 = fbm3(7. * vec2(r - 0.7*iTime, a)); + + float flame = (0.5*n + 0.8*n2) * (1. - 1.5*r); + //flame*=snd*1.; + if(smooth_view >0.){ + + }else{ + } + + vec3 p2 = vec3(1.5*flame, 2.*pow(flame,3.), pow(flame,6.) ); + + #ifdef MULTI_COLOR + //p2=vec3(1.5*flame*(1.+FFT(25)*1.5), 2.*pow(flame*(1.+FFT(50)*1.5),3.), pow(flame*(1.+snd*1.5),6.) ); + p2 *= 0.5+ palette(snd*2.); + #endif + + vec3 p3 = mix(around_eye, p2, max(d1,d2)*(.5+smooth_view)); + #ifdef MULTI_COLOR + //p2=vec3(1.5*flame*(1.+FFT(25)*1.5), 2.*pow(flame*(1.+FFT(50)*1.5),3.), pow(flame*(1.+snd*1.5),6.) ); + p3 *= 0.5+ palette(snd*2.); + #endif + //p3 *= mix(p3,vec3(0.75),r); + //p3*=FFT(25); + + //if(dc > 0.45) { + // col = mix(p1,p3,r); + //} + //else{ + // + //} + + col = p3; + col *= smoothstep(0.6,0.65,max(d1,d2)); + + // eye + col += smoothstep(0.03,-0.1,abs(max(d1,d2)-0.6) - 0.05) * vec3(0.99, 0.81, 0.27)*snd; + #ifdef MULTI_COLOR + col*=0.5+palette(snd*2.); + #endif + + + // the ring + //col += smoothstep(0.01,-0.1,abs(dc-0.45) - 0.05)*(.8+5.*snd) * vec3(0.99, 0.81, 0.27); + #ifndef MULTI_COLOR + col += smoothstep(0.01,-0.1,abs(dc-0.45) - 0.05)*(.8+5.*snd) * vec3(0.99, 0.81, 0.27) *palette(snd*2.); + #endif + #ifdef MULTI_COLOR + //p2=vec3(1.5*flame*(1.+FFT(25)*1.5), 2.*pow(flame*(1.+FFT(50)*1.5),3.), pow(flame*(1.+snd*1.5),6.) ); + col += smoothstep(0.01,-0.1,abs(dc-0.45) - 0.05)*(.8+5.*snd) * vec3(0.99, 0.81, 0.27) *palette(snd*2.); + #endif + + //where does all the blue color come from :-/ + //col.b=0.; + //col.b/=snd*2.; + //if(max(d1,d2) < 0.6) { + // col = vec3(0.); + //} + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + //col = mix(bg, col, step(0.01, length(col))); + col+=bg; + fragColor = vec4(col,1.0); +} + +void main() { + vec2 fragCoord = vUv * iResolution; + mainImage(gl_FragColor, fragCoord); +} diff --git a/dist/shaders/EyeOfHajiSauron.frag.meta b/dist/shaders/EyeOfHajiSauron.frag.meta new file mode 100644 index 0000000..a67a7de --- /dev/null +++ b/dist/shaders/EyeOfHajiSauron.frag.meta @@ -0,0 +1,9 @@ +{ + "author": "arminkz", + "modifiedBy": "ArthurTent", + "shaderName": "Eye of Haji Sauron", + "url": "https://www.shadertoy.com/view/X3jcWR", + "license": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License", + "licenseURL": "https://creativecommons.org/licenses/by-nc-sa/3.0/", + "shaderSpeed": 1.0 +} diff --git a/dist/shaders/FontDemo.frag.meta b/dist/shaders/FontDemo.frag.meta index 615c14a..632a3df 100644 --- a/dist/shaders/FontDemo.frag.meta +++ b/dist/shaders/FontDemo.frag.meta @@ -6,9 +6,9 @@ "license": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License", "licenseURL": "https://creativecommons.org/licenses/by-nc-sa/3.0/", "iChannel0": "images/otaviogood_shader_fontgen.png", - "iChannel1": "images/Marvin.png", + "iChannel1": "images/arthurtent.jpeg", "iChannel2": "images/sky-night-milky-way-star-a7d722848f56c2013568902945ea7c1b.jpg", - "iChannel3": "images/Shaker.png", + "iChannel3": "images/38c3_visuals.png", "video": "media/c-base-full-loop-blue-green.mp4", "shaderSpeed": 0.8 } diff --git a/dist/shaders/ForkPixelRickRadiantMusicVis.frag b/dist/shaders/ForkPixelRickRadiantMusicVis.frag index fd1dcab..4041634 100644 --- a/dist/shaders/ForkPixelRickRadiantMusicVis.frag +++ b/dist/shaders/ForkPixelRickRadiantMusicVis.frag @@ -19,8 +19,64 @@ uniform sampler2D iChannel1; uniform vec2 iResolution; uniform vec2 iMouse; varying vec2 vUv; -#define PI 3.14 #define TWO_PI 6.28 +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} + // This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. http://creativecommons.org/licenses/by-nc-sa/4.0/ // Merged Pixel Rick with Radiant Music Visualiser // https://www.shadertoy.com/view/4sVBWy @@ -512,9 +568,20 @@ vec3 brow(vec3 color, vec2 p) void main() { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + vec2 cam_uv = -1.0 + 2.0 *vUv; + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(cam_uv,-1.5)); + mat3 t = mat3(1.0); + camera(cam_uv, ro, rd, t); vec2 fragCoordFromUV = vUv * iResolution; vec2 uv = (2.0*fragCoordFromUV-iResolution.xy)/iResolution.y; - + uv.y+=.25; // TODO shared rotated uv vec2 uvRot = Rotate2D(-0.15) * uv; @@ -545,7 +612,10 @@ void main() uv.y +=0.25; // Hair Outline2 if(iTime>33.5){ - col = drawHair(col, vec2(-uvRot.x, uvRot.y)*(.5+sin(iAmplifiedTime)/2.)); + // going to full screen with the hair + //col = drawHair(col, vec2(-uvRot.x, uvRot.y)*(.5+sin(iAmplifiedTime)/2.)); + // or not + col = drawHair(col, vec2(-uvRot.x, uvRot.y)); }else{ col = drawHair(col, vec2(-uvRot.x, uvRot.y)); } @@ -574,4 +644,7 @@ void main() //col2.a = 1.; gl_FragColor += vec4(col,1.0); -} \ No newline at end of file + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + gl_FragColor+=vec4(bg, 1.); +} diff --git a/dist/shaders/Foxie.frag b/dist/shaders/Foxie.frag index 5bbcb63..53b619a 100644 --- a/dist/shaders/Foxie.frag +++ b/dist/shaders/Foxie.frag @@ -22,12 +22,66 @@ uniform vec2 iMouse; varying vec2 vUv; #define sat(a) clamp(a, 0., 1.) -#define PI 3.141592653 #define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) float beat = 0.0; mat2 r2d(float a) { float c= cos(a), s = sin(a); return mat2(c,-s,s,c);} float lenny(vec2 v) { return abs(v.x)+abs(v.y)*beat*.5; } +float snd = 0.; +const float PI = 3.1415926; +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} + float _cir(vec2 uv, float r) { return length(uv)-r; @@ -132,6 +186,18 @@ vec3 rdr(vec2 uv) void main() { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + vec2 cam_uv = -1.0 + 2.0 *vUv; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(cam_uv,-1.5)); + mat3 t3 = mat3(1.0); + camera(cam_uv, ro, rd, t3); beat = 0.7+FFT(25)*3.; //vec2 uv = (fragCoord-vec2(.5)*iResolution.xy)/iResolution.xx; vec2 uv = -1.+2.*vUv; @@ -142,4 +208,7 @@ void main() col = sat(col); gl_FragColor = vec4(col,1.0); + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + gl_FragColor+=vec4(bg, 1.); } diff --git a/dist/shaders/Informer.frag b/dist/shaders/Informer.frag index 444b7b5..de0321f 100644 --- a/dist/shaders/Informer.frag +++ b/dist/shaders/Informer.frag @@ -12,6 +12,62 @@ uniform vec2 iResolution; uniform vec2 iMouse; varying vec2 vUv; +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} + //-----------------CONSTANTS MACROS----------------- #define PI 3.14159265359 @@ -613,6 +669,19 @@ void save_stance(float factor) } void main() { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + + vec2 uv = -1.0 + 2.0 *vUv; + + //camera + rd for stars + vec3 ro2 = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd2 = normalize(vec3(uv,-1.5)); + mat3 t = mat3(1.0); + camera(uv, ro2, rd2, t); //float height = max(lowAverage(), last_height)-1.0/60.0; float height = max(lowAverage(), last_height)-300.0/60.0; @@ -639,7 +708,7 @@ void main() { //coordinate system //vec2 uv = fragCoord.xy / iResolution.xy; - vec2 uv = -1.0 + 2.0 *vUv+.5; + uv = -1.0 + 2.0 *vUv+.5; uv = uv * 2.0 - 1.0; uv.x *= iResolution.x / iResolution.y; @@ -655,6 +724,11 @@ void main() { //*/ eye = ro; - - gl_FragColor = vec4(marchScene(ro, rd), 1.0); + + rd2.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd2)*(1.+30.*snd); + + vec3 scene = marchScene(ro, rd); + scene +=bg; + gl_FragColor = vec4(scene, 1.0); } diff --git a/dist/shaders/MerryChristmasKishimisu.frag b/dist/shaders/MerryChristmasKishimisu.frag new file mode 100644 index 0000000..7ec82be --- /dev/null +++ b/dist/shaders/MerryChristmasKishimisu.frag @@ -0,0 +1,114 @@ +// https://www.shadertoy.com/view/4fs3WS +// Modified by ArthurTent +// Created by kishimisu +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +// https://creativecommons.org/licenses/by-nc-sa/3.0/ + +uniform float iAmplifiedTime; +uniform float iTime; +uniform sampler2D iAudioData; +uniform sampler2D iVideo; +uniform sampler2D iChannel0; +uniform sampler2D iChannel1; +uniform vec2 iResolution; +uniform vec2 iMouse; +varying vec2 vUv; + +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} + +/* + Merry Christmas! by @kishimisu (2023) +*/ +#define s smoothstep(.3, 1., M.y + +void mainImage( out vec4 E, vec2 F ) { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + vec2 cam_uv = -1.0 + 2.0 *vUv; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(cam_uv,-1.5)); + mat3 t3 = mat3(1.0); + camera(cam_uv, ro, rd, t3); + + vec2 X = iResolution.xy; + vec2 M = (F+F-X) / X.y / .45, + A ; float + S = length(M), + + T = iTime * .5, + R ; + for ( E *= R, M.x = abs(M.x); R++ < 8.; + E += .004/abs(sin(length( A = fract((M-vec2(0,1))*(1.5 + R*.1) + * mat2(cos(vec4(0,33,11,0) - T*.05))) -.5 ) + * exp(length(A)*1.5 - S) * 7. + sin(T)*.05) / 8. + - .3 * s*.6 + M.x + 1.4 + sin(M.y*13.+3.)*.1 - 2.*s + 2.2))) + //* (1. + cos(R*.5 + S*5. -T*4. + vec4(0,1,2,0)))*(.2+(FFT(25)+FFT(1)+FFT(50))*2.)); + * (1. + cos(R*.5 + S*5. -T*4. + vec4(0,1,2,0)))*(snd*2.)); + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + E+=vec4(bg, 1.); +} + +void main() { + vec2 fragCoord = vUv * iResolution; + mainImage(gl_FragColor, fragCoord); +} diff --git a/dist/shaders/MerryChristmasKishimisu.frag.meta b/dist/shaders/MerryChristmasKishimisu.frag.meta new file mode 100644 index 0000000..6c3bd1c --- /dev/null +++ b/dist/shaders/MerryChristmasKishimisu.frag.meta @@ -0,0 +1,9 @@ +{ + "author": "kishimisu", + "modifiedBy": "ArthurTent", + "shaderName": "Merry Christmas! [388 chars]", + "url": "https://www.shadertoy.com/view/4fs3WS", + "license": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License", + "licenseURL": "https://creativecommons.org/licenses/by-nc-sa/3.0/", + "shaderSpeed": 0.5 +} diff --git a/dist/shaders/ModifiedBear.frag b/dist/shaders/ModifiedBear.frag index d5c7ef9..9f88c44 100644 --- a/dist/shaders/ModifiedBear.frag +++ b/dist/shaders/ModifiedBear.frag @@ -21,7 +21,62 @@ varying vec2 vUv; #define saturate2(x) clamp(x, 0., 1.) #define rot(a) mat2(cos(a), -sin(a), sin(a), cos(a)) -#define PI 3.14159265359 +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} float spikes(float x, float t) { x = abs(fract(x) - .5) * 1. - .5 + t; @@ -126,8 +181,18 @@ float fbm(vec2 uv) { void main() { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); //vec2 uv = fragCoord.xy / iResolution.xy * 2. - 1.; vec2 uv = -1.0 + 2.0 *vUv; + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(uv,-1.5)); + mat3 t = mat3(1.0); + camera(uv, ro, rd, t); uv.x *= iResolution.x / iResolution.y; vec2 p = vec2(abs(uv.x), uv.y + .13) * 1.3; @@ -175,5 +240,8 @@ void main() gl_FragColor = pow(gl_FragColor, vec4(.4545)); #endif #endif + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + gl_FragColor+=vec4(bg, 1.); -} \ No newline at end of file +} diff --git a/dist/shaders/MusicalHeart.frag b/dist/shaders/MusicalHeart.frag index 8a35e15..72fe116 100644 --- a/dist/shaders/MusicalHeart.frag +++ b/dist/shaders/MusicalHeart.frag @@ -4,6 +4,7 @@ // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. // https://creativecommons.org/licenses/by-nc-sa/3.0/ uniform float iAmplifiedTime; +uniform float iTime; uniform sampler2D iAudioData; uniform sampler2D iChannel0; uniform sampler2D iChannel1; @@ -11,6 +12,63 @@ uniform vec2 iResolution; uniform vec2 iMouse; varying vec2 vUv; +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} + +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} float heartRadius(float theta) { return 2. - 2.*sin(theta) + sqrt(abs(cos(theta)))*sin(theta)/(1.4 + sin(theta)); @@ -18,7 +76,20 @@ float heartRadius(float theta) void main() { - vec2 uv = -1.0 + 2.0 *vUv; + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + + vec2 uv = -1.0 + 2.0 *vUv; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(uv,-1.5)); + mat3 t = mat3(1.0); + camera(uv, ro, rd, t); + float v = texture( iAudioData, vec2(1/510,0.25) ).x; float red = texture( iAudioData, vec2(1/510,0.25) ).x; @@ -33,9 +104,15 @@ void main() float theta = atan(pos.y, pos.x); float r = heartRadius(theta); + + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + + bgColor+=vec4(bg, 1.); gl_FragColor = mix(bgColor, heartColor, smoothstep(0.0, length(pos) * 0.5, r * v * 0.125 )); gl_FragColor *= pow(max(gl_FragColor - .2, 0.), vec4(1.4)) * 5.; - -} \ No newline at end of file + + +} diff --git a/dist/shaders/NeonOctagonalAudioVisualizer.frag b/dist/shaders/NeonOctagonalAudioVisualizer.frag index 971b96a..a39822d 100644 --- a/dist/shaders/NeonOctagonalAudioVisualizer.frag +++ b/dist/shaders/NeonOctagonalAudioVisualizer.frag @@ -6,6 +6,7 @@ // line antialiasing using smoothstep technique by FabriceNeyret2 (https://www.shadertoy.com/view/4dcfW8) uniform float iAmplifiedTime; +uniform float iTime; uniform sampler2D iAudioData; uniform sampler2D iChannel0; uniform sampler2D iChannel1; @@ -13,11 +14,67 @@ uniform vec2 iResolution; uniform vec2 iMouse; varying vec2 vUv; - #define freq(f) texture(iAudioData, vec2(f, 0.25)).x * 0.8 #define wave(f) texture(iAudioData, vec2(f, 0.75)).x float rand(float n){return fract(sin(n) * 43758.5453123);} +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} + float sdLine( in vec2 p, in vec2 a, in vec2 b ) { @@ -43,9 +100,19 @@ float avgFreq(float start, float end, float step) { void main() { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); vec2 R = iResolution.xy; //vec2 uv = fragCoord / iResolution.xy - 0.5; vec2 uv = -1.0 + 2.0 *vUv; + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(uv,-1.5)); + mat3 t = mat3(1.0); + camera(uv, ro, rd, t); uv *= vec2(1.0, iResolution.y / iResolution.x); vec3 col = vec3(0.0); @@ -118,4 +185,7 @@ void main() gl_FragColor = vec4(col,1.0); gl_FragColor *= pow(max(gl_FragColor - .2, 0.), vec4(1.4)) * 5.5*topFreq; -} \ No newline at end of file + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + gl_FragColor+=vec4(bg, 1.); +} diff --git a/dist/shaders/PlasmaGlobe.frag b/dist/shaders/PlasmaGlobe.frag index 7266a74..f178d71 100644 --- a/dist/shaders/PlasmaGlobe.frag +++ b/dist/shaders/PlasmaGlobe.frag @@ -10,17 +10,72 @@ uniform sampler2D iChannel0; uniform vec2 iResolution; uniform vec2 iMouse; varying vec2 vUv; +//looks best with around 25 rays +#define NUM_RAYS 25. #define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) #define S(a,b,t) smoothstep(a,b,t) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} // Plasma Globe by nimitz (twitter: @stormoid) // https://www.shadertoy.com/view/XsjXRm // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License // Contact the author for other licensing options -//looks best with around 25 rays -#define NUM_RAYS 50. #define VOLUMETRIC_STEPS 19 @@ -50,7 +105,7 @@ mat3 m3 = mat3( 0.00, 0.80, 0.60, -0.80, 0.36, -0.48, -0.60, -0.48, 0.64 ); -float snd(){ +float fsnd(){ s = vec4(texture(iAudioData, vec2(0.0, 0.0)).r, texture(iAudioData, vec2(0.25, 0.0)).r, texture(iAudioData, vec2(0.50, 0.0)).r, @@ -174,13 +229,13 @@ vec3 vmarch(in vec3 ro, in vec3 rd, in float j, in vec3 orig) p += rd*.03; float lp = length(p); - vec3 col = sin(vec3(1.05,2.5,1.52)*3.94+r.y)*.85+0.4*snd(); + vec3 col = sin(vec3(1.05,2.5,1.52)*3.94+r.y)*.85+0.4*fsnd(); col.rgb *= smoothstep(.0,.015,-r.x); col *= smoothstep(0.04,.2,abs(lp-1.1)); col *= smoothstep(0.1,.34,lp); sum += abs(col)*5. * (1.2-noise(lp*2.+j*13.+time*5.)*1.1) / (log(distance(p,orig)-2.)+.75); } - return sum*snd(); + return sum*fsnd(); //return sum; } @@ -197,14 +252,28 @@ vec2 iSphere2(in vec3 ro, in vec3 rd) void main( ) { - vec2 fragCoord = vUv * iResolution; + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + vec2 uv = -1.0 + 2.0 *vUv; + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(uv,-1.5)); + mat3 t = mat3(1.0); + camera(uv, ro, rd, t); + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + + vec2 fragCoord = vUv * iResolution; vec2 p = fragCoord.xy/iResolution.xy-0.5; p.x*=iResolution.x/iResolution.y; vec2 um = iMouse.xy / iResolution.xy-.5; //camera - vec3 ro = vec3(0.,0.,5.); - vec3 rd = normalize(vec3(p*.7,-1.5)); + ro = vec3(0.,0.,5.); + rd = normalize(vec3(p*.7,-1.5)); mat2 mx = mm2(time*.4+um.x*6.); mat2 my = mm2(time*0.3+um.y*6.); ro.xz *= mx;rd.xz *= mx; @@ -251,4 +320,5 @@ void main( ) col *= (.3+bg_col*10.5); col += bg_col; gl_FragColor = vec4(col*1.3, 1.0); -} \ No newline at end of file + gl_FragColor+=vec4(bg, 1.); +} diff --git a/dist/shaders/RadarMusicVisualizer.frag b/dist/shaders/RadarMusicVisualizer.frag index ee520d7..cc847cc 100644 --- a/dist/shaders/RadarMusicVisualizer.frag +++ b/dist/shaders/RadarMusicVisualizer.frag @@ -13,11 +13,78 @@ uniform sampler2D iChannel3; uniform vec2 iResolution; uniform vec2 iMouse; varying vec2 vUv; -const float PI = 3.14159265359; const float TAU = 6.28318530718; +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} void main( ) { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + vec2 cam_uv = -1.0 + 2.0 *vUv; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(cam_uv,-1.5)); + mat3 t = mat3(1.0); + camera(cam_uv, ro, rd, t); vec2 points[15]; points[0] = vec2(.1, .1); points[1] = vec2(.15, -.2); @@ -98,4 +165,7 @@ void main( ) //color.g += clippedGreen * clipToRadius + container; //gl_FragColor = color; gl_FragColor = vec4(0., clippedGreen * clipToRadius + container, 0., 1.); -} \ No newline at end of file + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + gl_FragColor+=vec4(bg, 1.); +} diff --git a/dist/shaders/RainbowSoundviz.frag b/dist/shaders/RainbowSoundviz.frag index 87fa111..04745c7 100644 --- a/dist/shaders/RainbowSoundviz.frag +++ b/dist/shaders/RainbowSoundviz.frag @@ -15,13 +15,80 @@ uniform vec2 iResolution; uniform vec2 iMouse; varying vec2 vUv; -#define PI 3.1415926 #define PI2 6.2831852 +#define S(a,b,t) smoothstep(a,b,t) +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} #define hue(h)clamp(abs(fract(h + vec4(3, 2, 1, 0) / 3.0) * 6.0 - 3.0) - 1.0 , 0.0, 1.0) void main() { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + vec2 cam_uv = -1.0 + 2.0 *vUv; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(cam_uv,-1.5)); + mat3 t3 = mat3(1.0); + camera(cam_uv, ro, rd, t3); //vec2 uv = (fragCoord - iResolution.xy * 0.5) / iResolution.y; vec2 uv = -1.0 + 2.0 *vUv; @@ -74,4 +141,7 @@ void main() col = mix(backCol, col, m); gl_FragColor = vec4(col, 1.0); + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + gl_FragColor+=vec4(bg, 1.); } diff --git a/dist/shaders/SoapBubbleMusicVisualizerNumber1.frag b/dist/shaders/SoapBubbleMusicVisualizerNumber1.frag index d2e09fd..81747b9 100644 --- a/dist/shaders/SoapBubbleMusicVisualizerNumber1.frag +++ b/dist/shaders/SoapBubbleMusicVisualizerNumber1.frag @@ -13,6 +13,62 @@ uniform vec2 iResolution; uniform vec2 iMouse; varying vec2 vUv; +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} + mat3 rotateYmat(float ang) { return mat3(cos(ang), 0.0, sin(ang), @@ -48,6 +104,18 @@ float map( vec3 p, vec3 origin, float s ) } void main() { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + vec2 cam_uv = -1.0 + 2.0 *vUv; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(cam_uv,-1.5)); + mat3 t3 = mat3(1.0); + camera(cam_uv, ro, rd, t3); //vec2 uv = fragCoord.xy/iResolution.xy; vec2 uv = vUv; uv = uv*2.0-1.0; @@ -93,5 +161,8 @@ void main() } float fog = 1.0/(1.0+t*t*0.1); gl_FragColor = vec4(finalColor+color*vec3(fog), fog); + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + gl_FragColor+=vec4(bg, 1.); -} \ No newline at end of file +} diff --git a/dist/shaders/SonicPulse.frag b/dist/shaders/SonicPulse.frag index 8d8f1cf..ac66e9e 100644 --- a/dist/shaders/SonicPulse.frag +++ b/dist/shaders/SonicPulse.frag @@ -4,6 +4,7 @@ // Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. // https://creativecommons.org/licenses/by-nc-sa/3.0/ uniform float iAmplifiedTime; +uniform float iTime; uniform sampler2D iAudioData; uniform sampler2D iChannel0; uniform sampler2D iChannel1; @@ -11,6 +12,62 @@ uniform vec2 iResolution; uniform vec2 iMouse; varying vec2 vUv; +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} float circle(vec2 p, float r){ return r-length(p); @@ -28,12 +85,24 @@ float scene(vec2 p){ void main( ) { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); const float cinematicAspect = 2.35; float currAspect = iResolution.x/iResolution.y; //vec2 uv = fragCoord/iResolution.xy-.5; vec2 uv = -1.0 + 2.0 *vUv; - vec4 wave = texture(iAudioData,uv/256.); + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(uv,-1.5)); + mat3 t = mat3(1.0); + camera(uv, ro, rd, t); + + vec4 wave = texture(iAudioData,uv/256.); uv.x *= currAspect; float d = scene(uv); @@ -57,4 +126,7 @@ void main( ) gl_FragColor = gl_FragColor * (length(uv)*-.5+1.); gl_FragColor *= pow(max(gl_FragColor - .2, 0.), vec4(1.4)) * (wave.r*100.); } -} \ No newline at end of file + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + gl_FragColor+=vec4(bg, 1.); +} diff --git a/dist/shaders/SoundBlob.frag b/dist/shaders/SoundBlob.frag index 2f178c5..bfb2e20 100644 --- a/dist/shaders/SoundBlob.frag +++ b/dist/shaders/SoundBlob.frag @@ -4,6 +4,7 @@ // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. // https://creativecommons.org/licenses/by-nc-sa/3.0/ uniform float iAmplifiedTime; +uniform float iTime; uniform sampler2D iAudioData; uniform sampler2D iChannel0; uniform sampler2D iChannel1; @@ -15,8 +16,62 @@ varying vec2 vUv; 05/2016 seb chevrel */ -#define PI 3.14159 #define TWO_PI 6.2831 +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} // rotations vec3 rotateX(vec3 p, float a) { float c = cos(a), s = sin(a); return vec3(p.x, c*p.y - s*p.z, s*p.y + c*p.z); } @@ -102,8 +157,19 @@ vec3 rayMarch(in vec3 from, // ray origin void main( ) { - //vec2 uv = (fragCoord.xy / iResolution.xx) -vec2( 0.5,0.5*iResolution.y/iResolution.x); - vec2 uv = -1.0 + 2.0* vUv; + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + + vec2 uv = -1.0 + 2.0 *vUv; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(uv,-1.5)); + mat3 t = mat3(1.0); + camera(uv, ro, rd, t); float time=iAmplifiedTime*1.5; float dist=0.8; @@ -122,7 +188,10 @@ void main( ) vec4 color=vec4( vec3(0.3,0.9,1.0)*amp*0.1/length(uv),1.0); //vec4 color=vec4( vec3(20.3*amp,10.0*amp,20.0*amp)*amp*0.1/length(uv),1.0); - if (result.x!=0.0) { + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + + if (result.x!=0.0) { vec3 position = camera_position+(ray_direction*result.x); vec3 normal = calcNormal(position,0.001); vec3 light = normalize(vec3(-1.0,1.0,-0.5)); @@ -132,7 +201,9 @@ void main( ) float iterations = (1.-result.y); color=vec4( vec3(specular*diffuse)*vec3(1.,1.,1.)+ vec3(diffuse*0.4+0.6)*vec3(0.9,0.5-(result.y)*0.5,(1.0/result.x)*0.1),1.0); + color -=vec4(bg,1.); } gl_FragColor = color; + gl_FragColor+=vec4(bg, 1.); } diff --git a/dist/shaders/ThunderEye.frag b/dist/shaders/ThunderEye.frag index 11e788e..d487692 100644 --- a/dist/shaders/ThunderEye.frag +++ b/dist/shaders/ThunderEye.frag @@ -48,6 +48,15 @@ void compressFft(){ //compress sound in iChannel0 to simple frequency-range ampl fft /= vec4(2,8,7,4); ffts /= vec4(2,3,3,21); //normalize //fft.x = step(.7,fft.x); //weaken weaker sounds, hard limit } +vec3 palette(float t) { + if(t <1.)t+=1.; + vec3 a = vec3(0.5); + vec3 b = vec3(0.5); + vec3 c = vec3(1.); + vec3 d = vec3(0.563,0.416,0.457 + .2); + + return a + b*cos( 6.28 * c * (t+d)); // A + B * cos ( 2pi * (Cx + D) ) +} void main(){ // General initializations @@ -71,7 +80,8 @@ void main(){ amp += sphere(uv-vec2(rand(n,.456*sTime),rand(.254*sTime,n)),.1+rand(.5*n,.5*sTime)*aFrac)*smoothstep(1.,.33,aFrac)*smoothstep(.0,.66,aFrac); } //vec3 col = vec3(.1*fft.z*amp); //add fog - vec3 col = vec3(.1*fft.z*amp*.2); // add scaled fog + //vec3 col = vec3(.1*fft.z*amp*.2); // add scaled fog + vec3 col = vec3(0.); // Lightning float lightn = 0.; @@ -103,5 +113,6 @@ void main(){ // Output col = pow(col, vec3(.4545)); //gamma correction + col *=palette(fft.x*2.+sin(iAmplifiedTime/10.)*2.); gl_FragColor = vec4(col,1.0); } diff --git a/dist/shaders/[SH18]BabyToy.frag b/dist/shaders/[SH18]BabyToy.frag index e33c1ac..5884762 100644 --- a/dist/shaders/[SH18]BabyToy.frag +++ b/dist/shaders/[SH18]BabyToy.frag @@ -12,8 +12,63 @@ uniform vec2 iResolution; uniform vec2 iMouse; varying vec2 vUv; -#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) #define S(a,b,t) smoothstep(a,b,t) +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} // https://iquilezles.org/articles/smin float smin( float a, float b, float k ) { @@ -603,6 +658,18 @@ vec3 Render(vec2 uv, vec3 ro, vec3 rd) { void main() { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + vec2 cam_uv = -1.0 + 2.0 *vUv; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(cam_uv,-1.5)); + mat3 t3 = mat3(1.0); + camera(cam_uv, ro, rd, t3); //vec2 uv = (fragCoord-.5*iResolution.xy)/iResolution.y; vec2 uv = -1.+2.*vUv; float t = iTime*2.; @@ -625,8 +692,13 @@ void main() vec3 up = vec3(0, 1, 0); vec3 eyeRay = GetRay(uv, cPos, cLookat, up, zoom); + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); vec3 col = Render(uv, cPos, eyeRay); col += -0.25+FFT(50); - + //rd.x+=sin(iTime/1000.)*2.; + //vec3 bg = stars(rd)*(1.+30.*snd); gl_FragColor = vec4(col,1.0); + gl_FragColor+=vec4(bg, 1.); +// gl_FragColor*=vec4(col+bg, 1.); } diff --git a/dist/shaders/cloned_RainbowSpectrum.frag b/dist/shaders/cloned_RainbowSpectrum.frag index ec0da7a..7bb0808 100644 --- a/dist/shaders/cloned_RainbowSpectrum.frag +++ b/dist/shaders/cloned_RainbowSpectrum.frag @@ -4,6 +4,7 @@ // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. // https://creativecommons.org/licenses/by-nc-sa/3.0/ uniform float iAmplifiedTime; +uniform float iTime; uniform sampler2D iAudioData; uniform sampler2D iChannel0; uniform sampler2D iChannel1; @@ -11,12 +12,81 @@ uniform vec2 iResolution; uniform vec2 iMouse; varying vec2 vUv; +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} float bump(float x) { return abs(x) > 1.0 ? 0.0 : 1.0 - x * x; } void main( ) { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + vec2 cam_uv = -1.0 + 2.0 *vUv; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(cam_uv,-1.5)); + mat3 t = mat3(1.0); + camera(cam_uv, ro, rd, t); + //vec2 uv = (fragCoord.xy / iResolution.xy); vec2 uv = -1.0 + 3.0* vUv;// + vec2(0.0, sin(iAmplifiedTime * 0.1)*0.04); //besser als ganz ok... vec4 soundWave = texture( iAudioData, vec2(abs(0.5-uv.x)+0.005, uv.y) ).rrrr; @@ -33,4 +103,7 @@ void main( ) color *= line * (1.0 - 2.0 * abs( 0.5 - uv.xxx ) + pow( soundWave.y, 10.0 ) * 30.0 ); gl_FragColor = vec4(color, 0.0); -} \ No newline at end of file + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + gl_FragColor+=vec4(bg, 1.); +} diff --git a/dist/shaders/danagas-wingman.frag b/dist/shaders/danagas-wingman.frag index fd06a8a..2ab69d9 100644 --- a/dist/shaders/danagas-wingman.frag +++ b/dist/shaders/danagas-wingman.frag @@ -15,6 +15,62 @@ uniform vec2 iMouse; varying vec2 vUv; #define TAU 6.28318530718 #define saturate2(x) clamp(x, 0., 1.) +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} float hash(vec2 uv) { float f = fract(cos(sin(dot(uv, vec2(.009123898, .00231233))) * 48.512353) * 1111.5452313); @@ -77,8 +133,18 @@ vec4 circle(vec2 uv) { void main() { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); //vec2 uv = fragCoord.xy / iResolution.xy * 2. - 1.; vec2 uv = vUv * 2. -1.; + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(uv,-1.5)); + mat3 t = mat3(1.0); + camera(uv, ro, rd, t); uv.x *= iResolution.x / iResolution.y; //gl_FragColor = blend(vec4(.86, .86, .79, 1.), spiral(uv)); gl_FragColor = blend(vec4(0., .0, .0, 1.), spiral(uv)); @@ -90,4 +156,7 @@ void main() gl_FragColor.g += (hash(uv) - .5) * amount; uv += 100.; gl_FragColor.b += (hash(uv) - .5) * amount; -} \ No newline at end of file + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + gl_FragColor+=vec4(bg, 1.); +} diff --git a/dist/shaders/echappatoire.frag b/dist/shaders/echappatoire.frag new file mode 100644 index 0000000..c155966 --- /dev/null +++ b/dist/shaders/echappatoire.frag @@ -0,0 +1,243 @@ +// https://www.shadertoy.com/view/7lBXRG +// Modified by ArthurTent +// Created by sukupaper +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +// https://creativecommons.org/licenses/by-nc-sa/3.0/ +uniform float iAmplifiedTime; +uniform float iTime; +uniform sampler2D iAudioData; +uniform sampler2D iVideo; +uniform sampler2D iChannel0; +uniform sampler2D iChannel1; +uniform vec2 iResolution; +uniform vec2 iMouse; +varying vec2 vUv; + +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; + +#define P 6.283185307 +#define PI 3.141592654 +#define TAU (2.0*PI) +const float div = 4.9, spiralspeed = P/35.; +vec3 c, map; +float t, roomId; +int matid=0, doorpart=0; + +mat2 rot(in float a) { return mat2(cos(a),sin(a),-sin(a),cos(a)); } + +float box(in vec3 p, in vec3 s, in float r) { return length(max(abs(p) - s,0.)) - r; } +float box(in vec2 p, in vec2 s) { p = abs(p) - s; return max(p.x,p.y); } +float cyl(in vec3 p, in float h, in float r) { + vec2 d = abs(vec2(length(p.xz),p.y)) - vec2(h,r); + return min(max(d.x,d.y),0.) + length(max(d,0.)); +} +// colormap +vec3 palette(float t) { + if(t <1.)t+=1.; + vec3 a = vec3(0.5); + vec3 b = vec3(0.5); + vec3 c = vec3(1.); + vec3 d = vec3(0.563,0.416,0.457 + .2); + + return a + b*cos( 6.28 * c * (t+d)); // A + B * cos ( 2pi * (Cx + D) ) +} +// used to rotate domain of noise function +const mat2 rot2 = mat2( 0.80, 0.60, -0.60, 0.80 ); + +float rand(vec2 n) { + return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453); +} +float noise(vec2 p){ + vec2 ip = floor(p); + vec2 u = fract(p); + u = u*u*(3.0-2.0*u); + + float res = mix( + mix(rand(ip),rand(ip+vec2(1.0,0.0)),u.x), + mix(rand(ip+vec2(0.0,1.0)),rand(ip+vec2(1.0,1.0)),u.x),u.y); + return res*res; +} +// fast implementation of fBM +float fbm( vec2 p ) +{ + float iter = mod(iAmplifiedTime, 3.); + float f = 0.0; + f += 0.500000*noise( p + 0.1 * sin(iAmplifiedTime ) + 0.2 * iAmplifiedTime); p = rot2*p*2.02; + f += 0.031250*noise( p ); p = rot2*p*2.01; + + float whichroom = step(.5,fract(roomId/2.)); + //f += 0.28*noise(p);p=rot2*p*whichroom; + + f += 0.250000*noise( p ); p = rot2*p*2.03; + f += 0.125000*noise( p + 0.1 * sin(iAmplifiedTime) + 0.2 * iAmplifiedTime ); p = rot2*p*2.01; + f += 0.062500*noise( p + 0.3 * sin(iAmplifiedTime) ); p = rot2*p*2.04; + f += 0.015625*noise( p ); + return f/0.96875; +} + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} + +// nested fBM +float pattern( vec2 p ) { + if(step(.5, fract(roomId/2.))<1.){ + } + return fbm( p*snd*2. + fbm( p + fbm(p*(.5+sin(iAmplifiedTime))) ) )*snd*10.; +} + + +float door(in vec3 p, in vec3 s, in float opened) { + p.x -= s.x; p.xz *= rot(opened); p.x += s.x; + float ddbis = -max(box(vec3(p.x, mod(abs(p.y + .2) - .2, 1.285) - .6425, abs(p.z) - .03), s*vec3(1.,.5,1.), .01), box(p, s*vec3(.725,.85,1.), .02)); + float dd = box(p, s, .01); + p.z = abs(p.z); p.x += .435; + float ddd = min(length(max(abs(vec2(length(p.xy) - .012, p.z - .075)) - vec2(.01,.0),0.)) - .015, length(max(abs(vec2(length(p.xy) - .01, p.z - .012)) - vec2(.02,.0),0.)) - .015); + ddd = min(ddd, cyl(p.yzx, .015, .075)); + float d = min(max(dd, ddbis), ddd); + doorpart = d == dd ? 1 : 0; + return d; +} + +float df(in vec3 p) { + p.xy *= rot(cos(p.z*spiralspeed)*1.75); + + float pz = p.z; + float Pz = floor(p.z/div + .4)*div; + roomId = floor(p.z/div + .5); + p.z = mod(pz, div) - div*.5; + + float pz2 = pz/(div*2.) + 0.24 ; + p.xy = mix(p.xy,p.yx,mod(floor(pz2),2.))*sign(mod(floor(pz2 + .5),2.) - .5); + map = p; + + const vec3 doorSize = vec3(.5, 1.125, .01); + float wall = box(p.xy, vec2(1.5)); + p.y += doorSize.y/3.; + + float dap = abs(Pz - c.z + div/2.); + float door = door(p, doorSize, P*.35*(cos(clamp( (dap*dap*dap)*.0125 ,-3.14,3.14))*.5 + .5)); + + float endwall = abs(p.z) - .01; + + float plaintesFond = max(endwall, p.y + 1.05) - .025; + float doorShape = box(p.xy, doorSize.xy); + float doorShapeExtr = max(doorShape - .05, abs(p.z) - .035); + float walls = min(abs(wall) - .01, max(max(wall, min(min(endwall, doorShapeExtr), plaintesFond)), -doorShape)); + + float plaintes = max(-wall, p.y + 1.02) - .025; + + float d = min(min(walls, door), plaintes); + + matid = d == plaintesFond || d == doorShapeExtr ? 3 : d == door ? 1 : d == walls ? 2 : 3; + + return d; +} + +#define LIM .001 +#define MAX_D 20. +#define MAX_IT 50 +struct rmRes { vec3 pos; int it; bool hit; }; +rmRes rm(in vec3 c, in vec3 r) { + vec3 p = c; + int it; + bool hit = false; + for(int i = 0; i < MAX_IT; i++) { + float d = df(p); + if(d < LIM) { hit = true; break; } + if(distance(c,p) > MAX_D) break; + p += d*r; + it = i; + } + rmRes res; + res.pos = p; + res.it = it; + res.hit = hit; + return res; +} + +vec3 plane2sphere(in vec2 p) { + float t = -4./(dot(p,p) + 4.); + return vec3(-p*t, 1. + 2.*t); +} + +void mainImage(out vec4 fragColor, in vec2 fragCoord) { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + snd*=1.6; + + vec2 st = (fragCoord.xy - iResolution.xy*.5)/iResolution.x; + t = iAmplifiedTime < 0.01 ? 98. : iAmplifiedTime*5. ; + + c = vec3(0.,0.,t); + vec3 r = -plane2sphere(st*5.); + r.xz *= rot(cos(t*spiralspeed/3.)*.75); + r.xy *= rot(-cos(t*spiralspeed)*1.75); + + rmRes res = rm(c,r); + + vec3 n = vec3(0.), b = vec3(.88); + float whichroom = step(.5,fract(roomId/2.)); + vec3 c1 = mix(n,b,whichroom), c2 = mix(b,n,whichroom); + c2*=palette(pattern(st)); + + vec3 rd = normalize(vec3(st,-1.5)); + vec3 bg = stars(rd)*(1.+30.*snd); + //c2+=bg; + + if(whichroom>0.5){ + c2+=bg; + }else{ + } + + vec3 color = c2; + if(res.hit) + if(matid == 1) color = doorpart == 1 ? c2/palette(pattern(st)) : c1; + else if(matid == 2) color = c2; + else { + if(map.y < -1.45) { + if(map.z > .1 || map.z < 0.) { + map.xz *= rot(3.14*.25); + map.xz *= 10.; + color = mix(c1,c2/palette(pattern(st)),step(0.,cos(map.x)*cos(map.z)));//*palette(snd*2.); + } else + color = c2/palette(pattern(st));//*palette(snd*2.); + } else color = c1;//*palette(snd*2.); + } + + float l = length(st); + fragColor = vec4(color - l*l*.5,1.0); +} + + +void main() { + vec2 fragCoord = vUv * iResolution; + mainImage(gl_FragColor, fragCoord); +} diff --git a/dist/shaders/echappatoire.frag.meta b/dist/shaders/echappatoire.frag.meta new file mode 100644 index 0000000..1d86589 --- /dev/null +++ b/dist/shaders/echappatoire.frag.meta @@ -0,0 +1,10 @@ +{ + "author": "sukupaper", + "modifiedBy": "ArthurTent", + "shaderName": "échappatoire", + "url": "https://www.shadertoy.com/view/7lBXRG", + "license": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License", + "licenseURL": "https://creativecommons.org/licenses/by-nc-sa/3.0/", + "video": "media/pexels_videos_3931(1080p).mp4", + "shaderSpeed": 0.3 +} diff --git a/dist/shaders/echappatoire_with_heart.frag b/dist/shaders/echappatoire_with_heart.frag new file mode 100644 index 0000000..688308e --- /dev/null +++ b/dist/shaders/echappatoire_with_heart.frag @@ -0,0 +1,410 @@ +// https://www.shadertoy.com/view/7lBXRG +// Modified by ArthurTent +// Created by sukupaper +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +// https://creativecommons.org/licenses/by-nc-sa/3.0/ +uniform float iAmplifiedTime; +uniform float iTime; +uniform sampler2D iAudioData; +uniform sampler2D iVideo; +uniform sampler2D iChannel0; +uniform sampler2D iChannel1; +uniform vec2 iResolution; +uniform vec2 iMouse; +varying vec2 vUv; + +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +vec3 getTexture(vec2 p){ + p.x*=.5; + p.x+=.25; + p.y+=sin(iTime/10.)/100.; + p.x+=sin(iTime/10.)/100.; + vec4 s = texture(iVideo, p); + return s.xyz * s.w; +} + +#define P 6.283185307 +#define PI 3.141592654 +#define TAU (2.0*PI) +const float div = 4.9, spiralspeed = P/35.; +vec3 c, map; +float t, roomId; +int matid=0, doorpart=0; + +mat2 rot(in float a) { return mat2(cos(a),sin(a),-sin(a),cos(a)); } + +float box(in vec3 p, in vec3 s, in float r) { return length(max(abs(p) - s,0.)) - r; } +float box(in vec2 p, in vec2 s) { p = abs(p) - s; return max(p.x,p.y); } +float cyl(in vec3 p, in float h, in float r) { + vec2 d = abs(vec2(length(p.xz),p.y)) - vec2(h,r); + return min(max(d.x,d.y),0.) + length(max(d,0.)); +} +// colormap +vec3 palette(float t) { + if(t <1.)t+=1.; + vec3 a = vec3(0.5); + vec3 b = vec3(0.5); + vec3 c = vec3(1.); + vec3 d = vec3(0.563,0.416,0.457 + .2); + + return a + b*cos( 6.28 * c * (t+d)); // A + B * cos ( 2pi * (Cx + D) ) +} +// used to rotate domain of noise function +const mat2 rot2 = mat2( 0.80, 0.60, -0.60, 0.80 ); + +float rand(vec2 n) { + return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453); +} +float noise(vec2 p){ + vec2 ip = floor(p); + vec2 u = fract(p); + u = u*u*(3.0-2.0*u); + + float res = mix( + mix(rand(ip),rand(ip+vec2(1.0,0.0)),u.x), + mix(rand(ip+vec2(0.0,1.0)),rand(ip+vec2(1.0,1.0)),u.x),u.y); + return res*res; +} +// fast implementation of fBM +float fbm( vec2 p ) +{ + float iter = mod(iAmplifiedTime, 3.); + float f = 0.0; + f += 0.500000*noise( p + 0.1 * sin(iAmplifiedTime ) + 0.2 * iAmplifiedTime); p = rot2*p*2.02; + f += 0.031250*noise( p ); p = rot2*p*2.01; + + f += 0.250000*noise( p ); p = rot2*p*2.03; + f += 0.125000*noise( p + 0.1 * sin(iAmplifiedTime) + 0.2 * iAmplifiedTime ); p = rot2*p*2.01; + f += 0.062500*noise( p + 0.3 * sin(iAmplifiedTime) ); p = rot2*p*2.04; + f += 0.015625*noise( p *(1.+snd*2.)); + return f/0.96875; +} + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +// test pattern +float heartRadius(float theta) +{ + //return 2. - 2.*sin(theta) + sqrt(abs(cos(theta)))*sin(theta)/(1.4 + sin(theta)); + return 2. - 2.*sin(theta) + sqrt(abs(cos(theta)))*sin(theta)/(1.4 + sin(theta)); +} +#define TWO_PI 2.*PI +#define penta_or_heartgon(uv) polygon(uv, 5.) + +mat2 r2d(float a) { + float c = cos(a), s = sin(a); + return mat2(c, s, -s, c); +} + +// from: https://thndl.com/square-shaped-shaders.html +float polygon(vec2 uv, float n) { + float a = atan(uv.x, uv.y) + PI; + float r = TWO_PI / n; + return cos(floor(.5 + a / r) * r - a) * length(uv); +} + +float inner(float dist, float radius, float size) { + return abs(dist - radius) * size; +} +float testPattern(vec2 p) { + p/=(1.+snd); + p*=2.5; + p*= r2d(sin(iAmplifiedTime)); + float pen1 = penta_or_heartgon(p * vec2(1, -1)); + float pen2 = penta_or_heartgon(p); + float d = inner((pen1 - pen2 * .619) * 4.2, .3, .8); + + // circle + d = min(d, inner(length(p), .35, 2.)); + + // penta_or_heartgon + d = min(d, inner(pen2, .123, 2.5)); + return smoothstep(.1,.11,d); +} +/* +vec2 path(float t) { + float a = sin(t*.2+1.5),b=sin(t*.2); + return vec2(a*2., a*b); +} +mat2 r2d(float a) { + float c=cos(a),s=sin(a); + return mat2(c, s, -s, c); +} + +void mo(inout vec2 p, vec2 d) { + p.x = abs(p.x) - d.x; + p.y = abs(p.y) - d.y; + if(p.y>p.x)p=p.yx; +} +float g=0.; +float de(vec3 p) { + + vec3 q = p; + q.x += q.z*.1; + q.z += iTime*.1; + q = mod(q-1., 2.)-1.; + float s = length(q) - .001 + sin(iTime*30.)*.005; + + p.xy -= path(p.z); + + p.xy *= r2d(p.z*.9); + mo(p.xy, vec2(.6, .12)); + mo(p.xy, vec2(.9, .2)); + + p.xy *= r2d(p.z*.5); + + mo(p.zy, vec2(.1, .2)); + p.x = abs(p.x) - .4; + float d = length(p.xy) - .02 - (.5+.5*sin(p.z))*.05; + + d = min(d, s); + + + g+=.01/(.01+d*d); + return d*snd; +} +float testPattern( vec2 p ) { + float dt = iAmplifiedTime * 6.; + vec3 ro = vec3(0,0, -3. + dt); + vec3 ta = vec3(0, 0, dt); + + ro.xy += path(ro.z); + ta.xy += path(ta.z); + + vec3 fwd = normalize(ta -ro); + vec3 left = cross(vec3(0,1,0),fwd); + vec3 up = cross(fwd, left); + + vec3 rd = normalize(fwd + left*p.x+up*p.y); + + vec3 p3; + float ri,t=0.; + for(float i=0.;i<1.;i+=.01) { + ri = i; + p3=ro+rd*t; + float d = de(p3); + if(d<.001) break; + t+=d*.2; + } + return ri+t; +} +*/ +float theta = 0.; +float h_lenght=0.; +float penta_or_heart = 0.; +// end of test pattern +// nested fBM +float pattern( vec2 p ) { + float bla = penta_or_heart+fbm( p*snd*2. + fbm( p + fbm(p*(.5+sin(iAmplifiedTime))*(1.+snd*2.)) ) )*snd*10.; + //float bla = fbm( p*snd*2. + fbm( p + fbm(p*(.5+sin(iAmplifiedTime))) ) );//*snd*10.; + //penta_or_heart = testPattern(p); + penta_or_heart = heartRadius(theta); + if(penta_or_heart>0.){ + //return bla * smoothstep(0.0, h_lenght, 1.5*penta_or_heart*.0125)*4.*(1.+snd*5.); + return 2.*(1.+snd)*bla * smoothstep(0.0, h_lenght, 1.5*penta_or_heart*.0125)*10.; + } + + return 0.; + /* + //return fbm(p)+testPattern(p); + //float theta = atan(p.y, p.x); + //p.x+=sin(iTime/10.)/20.; + //p.y+=sin(iTime/10.)/20.; + //float penta_or_heart = testPattern(p); + //float penta_or_heart = heartRadius(theta); + //float bla = testPattern(p)+fbm( p*snd*2. + fbm( p + fbm(p*(.5+sin(iAmplifiedTime))) ) )*snd*10.; + //float bla = penta_or_heart+fbm( p*snd*2. + fbm( p + fbm(p*(.5+sin(iAmplifiedTime))) ) )*snd*10.; + //float bla = penta_or_heart+fbm( p*snd*2. + fbm( p + fbm(p*(.5+sin(iAmplifiedTime))) ) );//*snd*10.; + float bla = penta_or_heart+fbm( p*snd*2. + fbm( p + fbm(p*(.5+sin(iAmplifiedTime))) ) );//*snd*10.; + //if(penta_or_heart==0.){ + //if(mod(iAmplifiedTime, 5.)>2.){ + float whichroom = step(.5,fract(roomId/2.)); + if(mod(iAmplifiedTime, 4.) >2.) { + penta_or_heart = testPattern(p); + if(penta_or_heart==0.){ + return fbm(p)+penta_or_heart; + }else{ + return 0.; + } + }else{ + } + //} + if(penta_or_heart>0.){ + //return smoothstep(0.0, length(p)*.5, .5*penta_or_heart*.0125); + //return smoothstep(0.0, h_lenght, .5*penta_or_heart*.0125*(1.+snd*10.)); + //return bla * smoothstep(0.0, h_lenght, 1.5*penta_or_heart*.0125*(1.+snd*10.)); + return bla * smoothstep(0.0, h_lenght, 1.5*penta_or_heart*.0125)*(1.+snd*2.); + return bla; + } + + return 0.; + */ + //return fbm( p*snd*2. + fbm( p + fbm(p*(.5+sin(iAmplifiedTime))) ) )*snd*10.; +} + + +float door(in vec3 p, in vec3 s, in float opened) { + p.x -= s.x; p.xz *= rot(opened); p.x += s.x; + float ddbis = -max(box(vec3(p.x, mod(abs(p.y + .2) - .2, 1.285) - .6425, abs(p.z) - .03), s*vec3(1.,.5,1.), .01), box(p, s*vec3(.725,.85,1.), .02)); + float dd = box(p, s, .01); + p.z = abs(p.z); p.x += .435; + float ddd = min(length(max(abs(vec2(length(p.xy) - .012, p.z - .075)) - vec2(.01,.0),0.)) - .015, length(max(abs(vec2(length(p.xy) - .01, p.z - .012)) - vec2(.02,.0),0.)) - .015); + ddd = min(ddd, cyl(p.yzx, .015, .075)); + float d = min(max(dd, ddbis), ddd); + doorpart = d == dd ? 1 : 0; + return d; +} + +float df(in vec3 p) { + p.xy *= rot(cos(p.z*spiralspeed)*1.75); + + float pz = p.z; + float Pz = floor(p.z/div + .4)*div; + roomId = floor(p.z/div + .5); + p.z = mod(pz, div) - div*.5; + + float pz2 = pz/(div*2.) + 0.24 ; + p.xy = mix(p.xy,p.yx,mod(floor(pz2),2.))*sign(mod(floor(pz2 + .5),2.) - .5); + map = p; + + const vec3 doorSize = vec3(.5, 1.125, .01); + float wall = box(p.xy, vec2(1.5)); + p.y += doorSize.y/3.; + + float dap = abs(Pz - c.z + div/2.); + float door = door(p, doorSize, P*.35*(cos(clamp( (dap*dap*dap)*.0125 ,-3.14,3.14))*.5 + .5)); + + float endwall = abs(p.z) - .01; + + float plaintesFond = max(endwall, p.y + 1.05) - .025; + float doorShape = box(p.xy, doorSize.xy); + float doorShapeExtr = max(doorShape - .05, abs(p.z) - .035); + float walls = min(abs(wall) - .01, max(max(wall, min(min(endwall, doorShapeExtr), plaintesFond)), -doorShape)); + + float plaintes = max(-wall, p.y + 1.02) - .025; + + float d = min(min(walls, door), plaintes); + + matid = d == plaintesFond || d == doorShapeExtr ? 3 : d == door ? 1 : d == walls ? 2 : 3; + + return d; +} + +#define LIM .001 +#define MAX_D 20. +#define MAX_IT 50 +struct rmRes { vec3 pos; int it; bool hit; }; +rmRes rm(in vec3 c, in vec3 r) { + vec3 p = c; + int it; + bool hit = false; + for(int i = 0; i < MAX_IT; i++) { + float d = df(p); + if(d < LIM) { hit = true; break; } + if(distance(c,p) > MAX_D) break; + p += d*r; + it = i; + } + rmRes res; + res.pos = p; + res.it = it; + res.hit = hit; + return res; +} + +vec3 plane2sphere(in vec2 p) { + float t = -4./(dot(p,p) + 4.); + return vec3(-p*t, 1. + 2.*t); +} + +void mainImage(out vec4 fragColor, in vec2 fragCoord) { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + snd*=1.6; + + vec2 uv = -1.0 + 2.0 *vUv; + uv.y-=.5; + vec2 st = (fragCoord.xy - iResolution.xy*.5)/iResolution.x; + theta = atan(uv.y, uv.x); + h_lenght = length(uv); + penta_or_heart = heartRadius(theta); + t = iAmplifiedTime < 0.01 ? 98. : iAmplifiedTime*5. ; + + c = vec3(0.,0.,t); + vec3 r = -plane2sphere(st*5.); + r.xz *= rot(cos(t*spiralspeed/3.)*.75); + r.xy *= rot(-cos(t*spiralspeed)*1.75); + + rmRes res = rm(c,r); + + vec3 n = vec3(0.), b = vec3(.88); + float whichroom = step(.5,fract(roomId/2.)); + vec3 c1 = mix(n,b,whichroom), c2 = mix(b,n,whichroom); + + c2*=palette(pattern(st)); + //c2*=palette(pattern(st*2.5+.5)); + //c2*=palette(pattern(st*.5+.5)); + + vec3 rd = normalize(vec3(st,-1.5)); + vec3 bg = stars(rd)*(1.+30.*snd); + //c2+=bg; + + if(whichroom>0.5){ + c2+=bg; + }else{ + //c2+=getTexture(st*1.5+.5); + } + + vec3 color = c2; + if(res.hit) + if(matid == 1) color = doorpart == 1 ? c2/palette(pattern(st)) : c1; + else if(matid == 2) color = c2; + else { + if(map.y < -1.45) { + if(map.z > .1 || map.z < 0.) { + map.xz *= rot(3.14*.25); + map.xz *= 10.; + color = mix(c1,c2/palette(pattern(st)),step(0.,cos(map.x)*cos(map.z)));//*palette(snd*2.); + } else{ + color = c2/palette(pattern(st));//*palette(snd*2.); + } + } else color = c1;//*palette(snd*2.); + } + + float l = length(st); + fragColor = vec4(color - l*l*.5,1.0); +} + + +void main() { + vec2 fragCoord = vUv * iResolution; + mainImage(gl_FragColor, fragCoord); +} diff --git a/dist/shaders/echappatoire_with_heart.frag.meta b/dist/shaders/echappatoire_with_heart.frag.meta new file mode 100644 index 0000000..1d86589 --- /dev/null +++ b/dist/shaders/echappatoire_with_heart.frag.meta @@ -0,0 +1,10 @@ +{ + "author": "sukupaper", + "modifiedBy": "ArthurTent", + "shaderName": "échappatoire", + "url": "https://www.shadertoy.com/view/7lBXRG", + "license": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License", + "licenseURL": "https://creativecommons.org/licenses/by-nc-sa/3.0/", + "video": "media/pexels_videos_3931(1080p).mp4", + "shaderSpeed": 0.3 +} diff --git a/dist/shaders/glxyEpilogue.frag b/dist/shaders/glxyEpilogue.frag index de66894..9147f52 100644 --- a/dist/shaders/glxyEpilogue.frag +++ b/dist/shaders/glxyEpilogue.frag @@ -19,6 +19,45 @@ const vec3 wireColor1 = vec3(0.7,0.8,0.6); const vec3 wireColor2 = vec3(0.1,0.2,0.7); const float contrast = 0.5; const float PI = 3.1415926; +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} + +// colormap +vec3 palette(float t) { + vec3 a = vec3(0.5); + vec3 b = vec3(0.5); + //vec3 b = vec3(snd); + vec3 c = vec3(1.); + vec3 d = vec3(0.563,0.416,0.457 + .2*sin(0.4*iTime)); + + return a + b*cos( 6.28 * c * (t+d)); // A + B * cos ( 2pi * (Cx + D) ) +} //David Hoskins' hash from https://www.shadertoy.com/view/4djSRW @@ -57,7 +96,7 @@ float fbm(vec2 p) texture(iAudioData, vec2(0.75, 0.0)).r); p += vec2(s.x - s.w, s.z - s.y); - float h = vnoise(p) * s.x; + float h = vnoise(p) * s.x/2.; // added the "/2." devider h += vnoise(p * 2.0) * s.y * 0.5; h += vnoise(p * 4.0) * s.z * 0.3; h += vnoise(p * 8.0) * s.w * 0.2 ; @@ -102,6 +141,8 @@ vec3 traverse_mesh( vec3 ro, vec3 re, vec3 rd) float r1 = 0.0, r2 = 0.0; vec3 a = vec3(0.0); for( int s = 0; s < 20; ++s ){ + + i = floor(o); vec2 m = (i - o) * id; @@ -173,12 +214,14 @@ void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) ro = vec3(0.0, 0.0, -15.); - float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); //m.y = -m.y; m.y = sin(m.y*0.5)*0.3 + 0.5; - vec2 sm = sin(m), cm = cos(m); + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); @@ -204,22 +247,37 @@ bool iRayAABox(in vec3 ro, in vec3 rd, in vec3 invrd, in vec3 b, p0 = ro + rd*fmin; p1 = ro + rd*fmax; n = -sign(rd)*step(tmin.yzx, tmin.xyz)*step(tmin.zxy, tmin.xyz); - return fmax >= fmin; } void main() { + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + //camera + rd for stars vec3 ro = vec3(0.0), rd = vec3( 0.0 ); mat3 t = mat3(1.0); vec2 uv = -1. +2.*vUv; - camera(uv, ro, rd, t); + camera(uv, ro, rd, t); + + uv.x+=sin(iTime/4.)/10.; + uv.y+=sin(iTime/4.)/10.; + //uv*=.5+(sin(iTime/10.))/2.; + uv*=1.-(sin(iTime/10.))/2.; vec3 p0 = vec3(0.0), p1 = vec3(0.0), n = vec3(0.0); vec3 c = vec3(0.1); if( iRayAABox(ro, rd, 1.0/rd, vec3(5.0), p0, p1, n) ) { c = traverse_mesh(p0 + rd*0.01, p1 - rd*0.01, rd); } - + if(snd>0.2){ + c*=.8+palette(1.5+sin(iAmplifiedTime)+snd*2.)*.5; + } + vec3 bg = stars(rd)*(1.+30.*snd); + c+=bg; + c+=snd; gl_FragColor = vec4(pow(c, vec3(0.94545)),1.0); -} \ No newline at end of file +} diff --git a/dist/shaders/new_colorful_galaxy.frag b/dist/shaders/new_colorful_galaxy.frag new file mode 100644 index 0000000..1a5ddfe --- /dev/null +++ b/dist/shaders/new_colorful_galaxy.frag @@ -0,0 +1,253 @@ +// https://www.shadertoy.com/view/lcjfzW +// Modified by ArthurTent +// Created by nayk +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +// https://creativecommons.org/licenses/by-nc-sa/3.0/ +uniform float iAmplifiedTime; +uniform float iTime; +uniform sampler2D iAudioData; +uniform sampler2D iVideo; +uniform sampler2D iChannel0; +uniform sampler2D iChannel1; +uniform vec2 iResolution; +uniform vec2 iMouse; +varying vec2 vUv; +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) + + +#define iterations 13 +#define formuparam 0.53 + +#define volsteps 20 +#define stepsize 0.1 + +#define zoom 0.800 +#define tile 0.850 +#define speed 0.010 + +#define brightness 0.0015 +#define darkmatter 0.300 +#define distfading 0.730 +#define saturation 0.850 + +#define time iAmplifiedTime + +#define PI 3.141592 +#define TWOPI 6.283184 + +#define R2D 180.0/PI* +#define D2R PI/180.0* + +mat2 rotMat(in float r){float c = cos(r);float s = sin(r);return mat2(c,-s,s,c);} + +//fract -> -0.5 -> ABS : coordinate absolute Looping +float abs1d(in float x){return abs(fract(x)-0.5);} +vec2 abs2d(in vec2 v){return abs(fract(v)-0.5);} +float cos1d(float p){ return cos(p*TWOPI)*0.25+0.25;} +float sin1d(float p){ return sin(p*TWOPI)*0.25+0.25;} + +#define OC 15.0 +vec3 Oilnoise(in vec2 pos, in vec3 RGB) +{ + vec2 q = vec2(0.0); + float result = 0.0; + + float s = 2.2; + float gain = 0.44; + vec2 aPos = abs2d(pos)*0.5;//add pos + + for(float i = 0.0; i < OC; i++) + { + pos *= rotMat(D2R 30.); + float time = (sin(iAmplifiedTime)*0.5+0.5)*0.2+iAmplifiedTime*0.8; + q = pos * s + time; + q = pos * s + aPos + time; + q = vec2(cos(q)); + + result += sin1d(dot(q, vec2(0.3))) * gain; + + s *= 1.07; + aPos += cos(smoothstep(0.0,0.15,q)); + aPos*= rotMat(D2R 5.0); + aPos*= 1.232; + } + + result = pow(result,4.504); + return clamp( RGB / abs1d(dot(q, vec2(-0.240,0.000)))*.5 / result, vec3(0.0), vec3(1.0)); +} + + +float easeFade(float x) +{ + return 1.-(2.*x-1.)*(2.*x-1.)*(2.*x-1.)*(2.*x-1.); +} +float holeFade(float t, float life, float lo)//lifeOffset +{ + return easeFade(mod(t-lo,life)/life); +} +vec2 getPos(float t, float life, float offset, float lo) +{ + return vec2(cos(offset+floor((t-lo)/life)*life)*iResolution.x/2., + sin(2.*offset+floor((t-lo)/life)*life)*iResolution.y/2.); + +} + +void mainVR( out vec4 fragColor, in vec2 fragCoord, in vec3 ro, in vec3 rd ) +{ + //get coords and direction + vec3 dir=rd; + vec3 from=ro; + + //volumetric rendering + float s=0.1,fade=1.; + vec3 v=vec3(0.); + for (int r=0; r6) fade*=1.3-dm; // dark matter, don't render near + //v+=vec3(dm,dm*.5,0.); + v+=fade; + v+=vec3(s,s*s,s*s*s*s)*a*brightness*fade; // coloring based on distance + fade*=distfading; // distance fading + s+=stepsize; + } + v=mix(vec3(length(v)),v,saturation); //color adjust + fragColor = vec4(v*.01,1.); +} +float happy_star(vec2 uv, float anim) +{ + uv = abs(uv); + vec2 pos = min(uv.xy/uv.yx, anim); + float p = (2.0 - pos.x - pos.y); + return (2.0+p*(p*p-1.5)) / (uv.x+uv.y); +} +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + vec4 o =fragColor; + vec2 u =fragCoord; + vec2 uv=fragCoord.xy/iResolution.xy-.5; + + vec2 st = (fragCoord/iResolution.xy); + st.x = ((st.x - 0.5) *(iResolution.x / iResolution.y)) + 0.5; + float stMask = step(0.0, st.x * (1.0-st.x)); + + + //st-=.5; //st move centor. Oil noise sampling base to 0.0 coordinate + st*=3.; + + vec3 rgb = vec3(0.30, .8, 1.200); + + + //berelium, 2024-06-07 - anti-aliasing + float AA = 1.0; + vec2 pix = 1.0 / iResolution.xy; + vec2 aaST = vec2(0.0); + vec3 col; + for(float i = 0.0; i < AA; i++) + { + for(float j = 0.0; j < AA; j++) + { + aaST = st + pix * vec2( (i+0.5)/AA, (j+0.5)/AA ); + col += Oilnoise(aaST, rgb); + } + + } + + col /= AA * AA; + uv.y*=iResolution.y/iResolution.x; + vec2 v = iResolution.xy, + w, + k = u = .2*(u+u-v)/v.y; + + o = vec4(1,2,3,0); + + for (float a = .5, t = iAmplifiedTime*0.21, i; + ++i < 19.; + o += (1.+ cos(vec4(0,1,3,0)+t)) + / length((1.+i*dot(v,v)) * sin(w*3.-9.*u.yx+t)) + ) + v = cos(++t - 7.*u*pow(a += .03, i)) - 5.*u, + u *= mat2(cos(i+t*.02 - vec4(0,11,33,0))), + u += .005 * tanh(40.*dot(u,u)*cos(1e2*u.yx+t)) + + .2 * a * u + + .003 * cos(t+4.*exp(-.01*dot(o,o))), + w = u / (1. -2.*dot(u,u)); + + o = pow(o = 1.-sqrt(exp(-o*o*o/2e2)), .3*o/o) + - dot(k-=u,k) / 250.; + vec3 dir=vec3(uv*zoom,1.); + +vec2 resolution = iResolution.xy; + + // Initialize color and texture accumulators + vec4 color = vec4(1.0, 2.0, 3.0, 0.0); + vec4 baseColor = color; + + // Initialize time and amplitude variables + + float amplitude = 0.5; + vec2 coord = fragCoord * 2. - iResolution.xy; + // Normalized pixel coordinates (from 0 to 1) + + + + float holeSize = iResolution.y/10.; + float holeLife = 2.; + + + vec3 final; + float audio_avg = 0.; + for (int i = 0; i<45; i++) { + audio_avg +=FFT((1.+float(i)*2.)); + float audio = FFT((1.+float(i)*2.)) * 7.; + vec3 col = 0.5 + 0.5*cos(iAmplifiedTime+uv.xyx+vec3(float(i),2.*float(i)+4.,4.*float(i)+16.));// * audio; + + float s = holeSize; + float lifeOffset = float(i)/2.; + + vec2 pos = getPos(iAmplifiedTime, holeLife, float(i)*4.5,lifeOffset); + + float d = distance(coord,pos)/s; + d = 1./d-.1; + + final += mix(vec3(0),col, d)*holeFade(iAmplifiedTime,holeLife,lifeOffset)*audio; + } + audio_avg/=45.; + + //if(FFT(25) >.2) { + /* + if(audio_avg >.2) { + //final = 1.0 - final.rgb+final*audio_avg*10.; + //final = 1.0 - final.rgb+final*audio_avg*14.; + //final = 1.0 - final.rgb+final*audio_avg*14.*(vec3(FFT(0), FFT(25), FFT(50))*.5); + //final = 1.0 - final.rgb+final*audio_avg*14.*(vec3(FFT(0)*.5, FFT(25)*.75, FFT(50)*2.)*2.5); + final = 1.0 - final.rgb+final*audio_avg*14.*(vec3(FFT(0)*.75, FFT(25), FFT(50)*1.5*audio_avg)*1.2); + }*/ + + vec2 uv2 = tanh(uv); + uv2*=10.; + + // Final color adjustment for visual output + + vec3 from=vec3(1.,.5,0.5); + + mainVR(fragColor, fragCoord, from, dir); + + fragColor*=vec4(final*vec3(0.4,1.,1.)+o.xyz,1.); + +} + +void main() { + vec2 fragCoord = vUv * iResolution; + mainImage(gl_FragColor, fragCoord); +} + diff --git a/dist/shaders/new_colorful_galaxy.frag.meta b/dist/shaders/new_colorful_galaxy.frag.meta new file mode 100644 index 0000000..8602709 --- /dev/null +++ b/dist/shaders/new_colorful_galaxy.frag.meta @@ -0,0 +1,12 @@ +{ + "author": "nayk", + "modifiedBy": "ArthurTent", + "shaderName": "new colorful galaxy", + "url": "https://www.shadertoy.com/view/l3fczr", + "license": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License", + "licenseURL": "https://creativecommons.org/licenses/by-nc-sa/3.0/", + "iChannel0": "images/don_t_panic_wallpaper_by_roguexunited_d1k2arg-fullview.jpg", + "iChannel1": "images/ritayan_2878d35a-809a-4517-b8da-759003ea716a.jpeg", + "video": "media/gwarn-madmadmad.mp4", + "shaderSpeed": 1.0 +} diff --git a/dist/shaders/nn_c.frag b/dist/shaders/nn_c.frag new file mode 100644 index 0000000..487572a --- /dev/null +++ b/dist/shaders/nn_c.frag @@ -0,0 +1,260 @@ + +// https://www.shadertoy.com/view/7sSSDd +// Modified by ArthurTent +// Created by Quasimondo +// Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +// https://creativecommons.org/licenses/by-nc-sa/3.0/ + +uniform float iAmplifiedTime; +uniform float iTime; +uniform sampler2D iAudioData; +uniform vec2 iResolution; +uniform vec2 iMouse; +varying vec2 vUv; + + +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} +vec3 palette(float t) { + return vec3(1.,0.314,0.325); + if(t <1.)t+=1.; + vec3 a = vec3(0.5); + vec3 b = vec3(0.5); + vec3 c = vec3(1.); + vec3 d = vec3(0.563,0.416,0.457 + .2); + + return a + b*cos( 6.28 * c * (t+d)); // A + B * cos ( 2pi * (Cx + D) ) +} + + +//Parts of this shader code are based on the work of Blackle Mori / https://www.shadertoy.com/view/wtVyWK +//Siren model trained and customized by Mario Klingemann / @Quasimondo + +float scene(vec3 p) { + //sdf is undefined outside the unit sphere, uncomment to witness the abominations + if (length(p) > 1.) { + return length(p)-.8; + } + p/=1.+snd; + //neural networks can be really compact... when they want to be + vec4 f0_0=sin(p.y*vec4(1.156,-3.750,2.845,-2.527)+p.z*vec4(3.318,2.539,3.444,3.581)+p.x*vec4(1.420,-.720,-2.169,-3.904)+vec4(3.138,-6.996,-1.817,-6.071));vec4 f0_1=sin(p.y*vec4(-1.034,-3.190,1.984,.150)+p.z*vec4(-.681,.224,-3.607,-1.679)+p.x*vec4(-2.620,2.564,.914,1.100)+vec4(6.420,7.633,6.514,-6.156));vec4 f0_2=sin(p.y*vec4(-2.525,-2.077,-.105,2.368)+p.z*vec4(-2.740,-.308,-3.426,3.077)+p.x*vec4(-.250,-3.015,-.405,-2.133)+vec4(8.175,-1.500,-4.482,3.107));vec4 f0_3=sin(p.y*vec4(1.760,-3.716,3.247,-2.239)+p.z*vec4(-3.538,3.612,-3.709,1.414)+p.x*vec4(2.326,-.225,.661,-.430)+vec4(6.375,-4.431,7.926,-.077));vec4 f1_0=sin(mat4(-.179,.198,-.280,-.434,.515,-.156,.034,-.188,-.123,.039,.160,.090,-.292,-.149,-.132,.167)*f0_0+ + mat4(.009,.482,-.105,.158,.145,-.087,.133,.308,.233,.697,-.162,-.722,.015,.397,.181,-.266)*f0_1+ + mat4(-.352,-.242,-.270,.523,.228,.472,.439,-.325,.557,-.409,-.365,.142,.477,.092,-.288,.244)*f0_2+ + mat4(-.305,-.181,.109,-.158,.101,-.031,.027,-.114,.241,.109,-.389,.127,-.451,.441,-.310,.574)*f0_3+ + vec4(-.651,.709,1.644,-1.978))/1.0+f0_0;vec4 f1_1=sin(mat4(-.362,-.671,.077,-.496,.066,.038,.183,-.028,-.139,.447,.077,-.288,.041,.365,-.068,.304)*f0_0+ + mat4(.078,-.177,.561,-.185,.226,-.325,.384,-.331,-.074,.253,.134,-.221,-.015,.261,-.022,.566)*f0_1+ + mat4(-.027,.240,.303,.097,-.266,.450,-.175,.415,.281,.112,-.102,.195,.258,.210,.338,-.060)*f0_2+ + mat4(.234,-.365,-.137,.605,.183,-.208,.465,-.202,-.084,.515,-.095,.516,-.428,-.111,.344,.521)*f0_3+ + vec4(1.968,2.600,2.090,-2.312))/1.0+f0_1;vec4 f1_2=sin(mat4(.386,.007,-.068,.194,.016,.089,.230,.241,-.203,.190,.144,-.087,-.063,-.042,.390,.176)*f0_0+ + mat4(-.072,-.601,-.229,-.175,-.059,-.147,-.354,.063,.024,-.349,.134,-.114,-.546,-.121,.329,.249)*f0_1+ + mat4(-.541,.044,-.186,-.159,.115,.370,-.291,.090,.391,-.271,-.039,-.303,.129,.317,.151,.376)*f0_2+ + mat4(-.021,.112,-.572,.407,.090,-.109,.269,-.296,-.250,-.240,-.470,-.077,-.498,-.085,-.745,.077)*f0_3+ + vec4(.601,1.699,1.774,.915))/1.0+f0_2;vec4 f1_3=sin(mat4(-.284,-.425,-.185,.393,.162,.028,-.079,.119,-.548,.015,.075,-.314,-.276,.326,.280,.402)*f0_0+ + mat4(-.235,.441,-.310,.005,.031,.408,-.283,-.200,-.116,.177,.263,-.259,-.463,.596,.215,-.183)*f0_1+ + mat4(-.246,.229,.161,-.211,.564,-.201,-.031,.014,-.272,.252,-.147,-.289,-.263,.090,-.231,-.343)*f0_2+ + mat4(-.075,-.346,.451,.157,-.176,.033,-.151,.018,.047,.219,-.171,-.282,.181,.416,.549,-.615)*f0_3+ + vec4(-2.201,-2.098,1.318,3.074))/1.0+f0_3;vec4 f2_0=sin(mat4(-.087,-.528,-.534,.243,-.406,.016,.181,-.599,.468,.183,-.393,-.192,-.260,.273,-.164,.254)*f1_0+ + mat4(-.573,-.493,-.386,-.271,.181,-.157,-.491,.121,-.065,.346,-.164,-.828,-.411,.465,-.584,-.349)*f1_1+ + mat4(.071,-.258,-.098,-.290,.252,.723,-.275,-.451,-.052,-.247,-.458,.367,-.105,-.163,.101,-.308)*f1_2+ + mat4(-.047,.018,-.192,.396,-.169,-.267,-.543,-.200,-.377,.100,-.084,.155,-.282,.659,.039,.059)*f1_3+ + vec4(2.769,-1.008,.665,-.082))/1.4+f1_0;vec4 f2_1=sin(mat4(-.038,.189,-.247,.441,.217,-.349,-.057,-.632,-.135,-.589,.642,-.189,.154,-.448,-.669,-.125)*f1_0+ + mat4(.396,-.118,.572,.180,-.054,-.479,.457,-.027,.034,.339,.176,-.075,-.210,-.152,-.700,.480)*f1_1+ + mat4(-.438,.696,.387,.767,-.251,.423,-.233,.322,.126,-.170,-.343,.042,.097,-.153,.038,.054)*f1_2+ + mat4(-.524,.307,-.510,.171,.289,-.312,-.403,-.118,-.175,.435,.126,.249,.420,.133,-.409,.499)*f1_3+ + vec4(.414,.338,-1.860,-2.853))/1.4+f1_1;vec4 f2_2=sin(mat4(-.080,.330,.104,.330,.256,-.710,.237,-.411,-.743,-.552,.375,.551,.028,.325,-.344,-.367)*f1_0+ + mat4(-.062,-.177,-.539,-.330,-.133,-.127,.333,-.221,.056,-.277,.822,.015,.397,-.241,.090,-.203)*f1_1+ + mat4(.047,.320,-.150,.040,.095,.071,.512,-.277,.067,.127,.037,.121,.401,.403,.290,-.045)*f1_2+ + mat4(.399,.132,-.431,-.136,.492,.241,.179,-.266,-.487,-.148,.000,.358,.246,.257,.439,-.276)*f1_3+ + vec4(2.299,-.927,2.089,2.020))/1.4+f1_2;vec4 f2_3=sin(mat4(-.045,.390,.272,.165,-.377,-.268,.148,.336,-.341,.151,.060,.063,-.293,-.089,.367,.465)*f1_0+ + mat4(.017,-.228,-.422,.917,-.360,-.245,.228,-.591,-.346,.514,.272,.439,.343,.206,.251,.092)*f1_1+ + mat4(.223,.424,-.232,-.078,-.898,-.407,.112,.377,-.201,-.035,.014,.228,-.521,.419,.216,-.041)*f1_2+ + mat4(.214,.410,.425,.008,-.038,-.320,-.119,-.348,-.416,.042,.372,.410,.230,-.306,.118,.213)*f1_3+ + vec4(-.155,1.978,1.477,3.064))/1.4+f1_3;vec4 f3_0=sin(mat4(.117,.343,.314,-.490,-.481,-.077,.174,.262,.132,.131,.468,.375,.115,.295,-.491,-.366)*f2_0+ + mat4(-.378,-.662,.046,.325,-.082,.186,-.615,-.395,.425,-.163,.225,.138,-.298,-.295,-.685,.304)*f2_1+ + mat4(-.431,-.467,.184,.468,-.548,-.141,.436,.336,-.733,-.238,.440,-.139,.379,.710,.028,-.382)*f2_2+ + mat4(-.082,-.584,-.305,-.316,-.059,-.111,-.324,-.083,-.449,-.281,.234,-.281,1.090,.852,-.703,-.056)*f2_3+ + vec4(1.641,-2.816,.667,-2.008))/1.7+f2_0;vec4 f3_1=sin(mat4(-.490,.313,.302,.439,-.252,.399,-.335,.273,.087,-.157,.053,-.046,-.161,-.000,.353,.434)*f2_0+ + mat4(-.527,-.552,-.317,.631,-.120,1.029,.055,.000,.428,-.226,-.209,.486,.279,-.428,-.418,-.520)*f2_1+ + mat4(.544,-.358,.465,.502,.094,-.596,.313,.157,-.236,.300,.022,-.263,.302,.189,-.157,.161)*f2_2+ + mat4(-.403,-.259,.220,-.157,-.036,.168,.096,-.131,.335,-.059,.133,-.268,-.202,.382,.221,.108)*f2_3+ + vec4(-.070,-3.009,2.858,-.167))/1.7+f2_1;vec4 f3_2=sin(mat4(.134,.458,-.211,.315,.323,-.006,.154,.440,.121,.381,.349,-.540,.116,-.608,-.310,-.062)*f2_0+ + mat4(-.458,-.094,-.247,.231,.144,-.361,.318,.023,-.218,.578,-.406,.389,.233,.430,.368,-.027)*f2_1+ + mat4(-.355,.437,-.235,-.010,-.314,.571,.333,-.038,.331,-.276,.285,.481,-.223,.022,-.140,-.478)*f2_2+ + mat4(-.657,-.176,-.200,-.123,-.053,.308,.649,.010,-.028,-.363,-.409,-.461,-.459,-.335,-.045,.020)*f2_3+ + vec4(-.052,-.209,-2.461,1.112))/1.7+f2_2;vec4 f3_3=sin(mat4(.582,.319,.250,.204,.190,.123,.256,.247,-.043,-.044,.214,-.312,-.059,.337,-.274,.351)*f2_0+ + mat4(-.183,-.330,.369,-.249,-.048,-.051,.557,.342,-.051,.104,-.174,-.182,.499,.234,-.575,.491)*f2_1+ + mat4(.139,-.589,.022,-.257,.347,-.274,.190,-.152,.377,-.559,.185,.402,-.579,-.418,.759,-.014)*f2_2+ + mat4(.412,.152,-.535,-.216,-.213,-.091,-.095,-.058,-.105,-.191,.428,-.001,-.234,.259,-.410,.785)*f2_3+ + vec4(.489,-2.836,-2.306,-1.655))/1.7+f2_3;vec4 f4_0=sin(mat4(-.511,-.422,.204,-.500,-.220,-1.008,-.101,-1.014,.005,.910,.121,.322,.112,.529,-.178,.255)*f3_0+ + mat4(.399,.436,-.428,.189,.199,-.838,.127,.503,-.257,.896,-.284,-.005,-.244,-.276,.219,1.019)*f3_1+ + mat4(.830,.009,.226,-.033,-.012,.648,-.001,-.007,.477,-.440,.228,-.552,-.149,-.147,-.181,.450)*f3_2+ + mat4(.328,.095,-.179,.640,-.187,-.979,-.605,.621,-.067,.113,.372,-.417,-.131,-.140,.196,.026)*f3_3+ + vec4(-.619,.452,1.854,-2.583))/2.0+f3_0;vec4 f4_1=sin(mat4(.411,.447,-.106,-.119,.560,-.612,-.089,.115,-.579,.405,.089,.063,.532,.094,.373,-.226)*f3_0+ + mat4(-.529,.524,-.123,-.554,-.059,-.059,-.222,-.096,.283,.560,-.370,.258,.313,.610,-.225,-.032)*f3_1+ + mat4(.094,-.682,.282,.574,.837,.067,.056,.591,-.018,.224,.051,-.053,-.309,.078,-.190,-.395)*f3_2+ + mat4(.453,-.059,.220,-.299,.216,-.262,-.243,.508,.396,-.114,.300,-.301,.269,.413,-.240,-.306)*f3_3+ + vec4(-.840,1.873,2.871,.968))/2.0+f3_1;vec4 f4_2=sin(mat4(.464,-.310,.243,-.436,.002,-.570,-.075,-.529,-.130,.799,-.206,.294,.123,-.597,-.690,-.285)*f3_0+ + mat4(-.153,.755,-.161,.142,-.563,-.200,-.176,-.301,.336,-.407,.400,.182,.186,-.257,.466,-.041)*f3_1+ + mat4(.047,.258,-.137,-.070,.536,.489,-.218,-.470,.226,-.166,-.004,.167,-.541,.121,.263,.163)*f3_2+ + mat4(-.237,.211,-.191,.333,-.375,-.108,-.119,.096,.465,-.363,.311,.367,.532,-.101,-.242,-.450)*f3_3+ + vec4(2.407,-1.463,2.104,1.302))/2.0+f3_2;vec4 f4_3=sin(mat4(-.107,.285,.070,-.185,.828,.374,-.686,.667,.055,-.523,.173,.025,-.096,-.162,.293,-.033)*f3_0+ + mat4(.470,-.375,.144,.219,.556,.104,.301,-.511,.163,.360,-.543,-.276,.272,.247,-.318,.147)*f3_1+ + mat4(-.254,1.086,.465,.306,-.262,.100,-.817,.793,-.311,-.184,-.029,.286,-.027,.100,.002,-.360)*f3_2+ + mat4(-.123,-.834,.231,.458,-.020,-.160,-.318,-.334,.152,.257,-.570,.413,-.410,.248,.717,-.470)*f3_3+ + vec4(1.907,.195,-1.477,2.936))/2.0+f3_3; +//vec4 f5_0=sin(mat4(.322,-.253,-.188,-.484,.558,.381,-.494,-.248,-.588,.015,.271,-.704,.113,.611,.137,-.035)*f4_0+ +vec4 f5_0=sin(mat4(snd,-.253,-.188,-.484,.558,.381,-.494,-.248,-.588,.015,.271,-.704,.113,.611,.137,-.035)*f4_0+ + mat4(-.165,-.033,-.332,1.088,-.583,-.025,.459,.152,-.570,-.504,.150,.194,-.969,.100,-.223,.355)*f4_1+ + mat4(-.382,.205,.213,.482,-.123,.056,.536,-.372,-.138,-.187,-.354,.528,-.158,-.135,-.216,.572)*f4_2+ + mat4(-.059,.198,-.390,-.371,-.190,-.575,-.473,-.268,.154,-.100,.116,.306,-.636,-.233,-.369,-.366)*f4_3+ + vec4(.895,.829,-3.441,2.067))/2.2+f4_0;vec4 f5_1=sin(mat4(.900,.675,-.463,.024,.092,.298,.313,-.017,-.154,.099,.478,-.016,.279,.504,.039,.468)*f4_0+ + mat4(-.028,.505,-.046,.580,.712,.179,-.260,-.210,-.257,-.360,.350,-.303,.313,-.455,-.260,-.488)*f4_1+ + mat4(.022,-.312,.894,.011,.078,.283,-.413,-.043,.420,.197,.141,-.421,.284,.544,.164,.685)*f4_2+ + mat4(.743,-.752,.310,.333,-.488,-.097,-.040,.121,.342,-.027,-.207,.457,.344,.779,-.839,.025)*f4_3+ + //vec4(-1.182,-1.671,-.700,.627))/2.2+f4_1;vec4 f5_2=sin(mat4(-.423,-.377,-.033,-1.017,.159,-.316,.223,-.258,.456,.041,-.394,.004,-.044,.591,-.343,.339)*f4_0+ + vec4(-snd*10.,-1.671,-.700,.627))/2.2+f4_1;vec4 f5_2=sin(mat4(-.423,-.377,-.033,-1.017,.159,-.316,.223,-.258,.456,.041,-.394,.004,-.044,.591,-.343,.339)*f4_0+ + mat4(.266,.080,-.053,.636,-.048,.181,-.194,.441,.056,-.482,.563,-.455,-.202,-.556,-.369,.359)*f4_1+ + mat4(.182,.642,-.124,-.355,.363,.512,-.058,.000,.154,-.294,.454,.356,.066,.485,-.288,.003)*f4_2+ + mat4(-.529,.462,.137,1.002,-.268,.712,.172,-.543,-.549,.404,.124,-.046,.672,-.008,-.262,-.252)*f4_3+ + vec4(-1.098,-1.607,-.949,.544))/2.2+f4_2; +//vec4 f5_3=sin(mat4(.310,.531,.582,-.231,-.250,.384,-.405,-.709,-.240,-.367,-.238,.268,.848,.141,.263,-.085)*f4_0+ +vec4 f5_3=sin(mat4(.310,.531,.582,-.231,-.250,.384,-.405,-snd*20.,-.240,-.367,-.238,.268,.848,.141,.263,-.085)*f4_0+ + mat4(-.109,.048,-.010,-.165,.725,-.283,-.558,-.355,.004,.656,-.435,-.327,-.419,.561,.799,-.052)*f4_1+ + mat4(.617,.596,.250,.030,.014,.994,1.168,.056,-.165,-.370,-.027,-.303,-.130,-.037,-.437,-.191)*f4_2+ + mat4(.816,.938,-.258,-.081,.417,.099,.151,-.440,.423,.343,.223,.236,-.085,-.169,-.532,.334)*f4_3+ + vec4(.531,-.095,-.536,.989))/2.2+f4_3;return dot(f5_0,vec4(-.045,.002,.051,-.013))+ + dot(f5_1,vec4(.040,-.012,.062,.061))+ + dot(f5_2,vec4(.062,.037,-.048,.045))+ + dot(f5_3,vec4(-.032,.033,.046,-.005))+ + 0.083; +} + +vec3 norm(vec3 p) { + mat3 k = mat3(p,p,p)-mat3(0.001); + return normalize(scene(p) - vec3(scene(k[0]),scene(k[1]),scene(k[2]))); +} + +vec3 erot(vec3 p, vec3 ax, float ro) { + return mix(dot(p,ax)*ax,p,cos(ro))+sin(ro)*cross(ax,p); +} + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); + + + vec2 uv = (fragCoord-0.5*iResolution.xy)/iResolution.y; + vec2 mouse = (iMouse.xy-0.5*iResolution.xy)/iResolution.y; + vec3 cam = normalize(vec3(1.5,uv)); + vec2 cam_uv = (fragCoord-.5*iResolution.xy)/iResolution.y; + + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(cam_uv,-1.5)); + mat3 t3 = mat3(1.0); + camera(uv, ro, rd, t3); + + vec3 init = vec3(-3.,0,0); + //vec3 rd = normalize(vec3(cam_uv,-1.5)); + rd.x+=sin(iAmplifiedTime/1000.)*2.; + + float yrot = 0.5; + float zrot = -iAmplifiedTime*1.42; + /* + if (iMouse.z > 0.) { + yrot += -4.*mouse.y; + zrot = 4.*mouse.x; + } + */ + cam = erot(cam, vec3(0,1,0), yrot); + init = erot(init, vec3(0,1,0), yrot); + cam = erot(cam, vec3(0,0,1), zrot); + init = erot(init, vec3(0,0,1), zrot); + + vec3 p = init; + bool hit = false; + for (int i = 0; i < 150 && !hit; i++) { + float dist = scene(p); + hit = dist*dist < 1e-6; + p+=dist*cam; + if (distance(p,init)>5.) break; + } + vec3 n = norm(p); + vec3 r = reflect(cam,n); + //don't ask how I stumbled on this texture + vec3 nz = p - erot(p, vec3(1), 2.) + erot(p, vec3(1), 4.); + float spec = length(sin(r*3.5+sin(nz*120.)*.15)*.4+.6)/sqrt(3.); + spec *= smoothstep(-.3,.2,scene(p+r*.2)); + vec3 col = vec3(.1,.1,.12)*spec + pow(spec,8.); + float bgdot = length(sin(cam*8.)*.4+.6)/2.; + //vec3 bg = vec3(.1,.1,.11) * bgdot + pow(bgdot, 10.); + vec3 bg = stars(rd)*(1.+30.*snd); + //fragColor.xyz = hit ? col *.75+palette(snd*2.+sin(iAmplifiedTime/10.)): bg; + fragColor.xyz = hit ? col *palette(snd*2.+sin(iAmplifiedTime/10.))*2.: bg; + fragColor = smoothstep(-.02,1.05,sqrt(fragColor)) * (1.- dot(uv,uv)*.5); +} + +void main() { + vec2 fragCoord = vUv * iResolution; + mainImage(gl_FragColor, fragCoord); +} + + diff --git a/dist/shaders/nn_c.frag.meta b/dist/shaders/nn_c.frag.meta new file mode 100644 index 0000000..2368a5c --- /dev/null +++ b/dist/shaders/nn_c.frag.meta @@ -0,0 +1,11 @@ +{ + "author": "ArthurTent", + "modifiedBy": "ArthurTent", + "shaderName": "Fork: Neural Stanford c-base", + "url": "https://www.shadertoy.com/view/4fyfzK", + "license": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License", + "licenseURL": "https://creativecommons.org/licenses/by-nc-sa/3.0/", + "iChannel0": "images/38c3-c-base1.png", + "iChannel1": "images/38c3-c-base2.png", + "shaderSpeed": 0.3 +} diff --git a/dist/shaders/pantera_rosa_CRT.frag b/dist/shaders/pantera_rosa_CRT.frag new file mode 100644 index 0000000..0e69c07 --- /dev/null +++ b/dist/shaders/pantera_rosa_CRT.frag @@ -0,0 +1,630 @@ +// https://www.shadertoy.com/view/l3GGRW +// Modified by ArthurTent +// Created by jorge2017a2 +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +// https://creativecommons.org/licenses/by-nc-sa/3.0/ +uniform float iAmplifiedTime; +uniform float iTime; +uniform sampler2D iVideo; +uniform sampler2D iAudioData; +uniform sampler2D iChannel0; +uniform sampler2D iChannel1; +uniform vec2 iResolution; +uniform vec2 iMouse; +varying vec2 vUv; + + +// Common + +//iq +float dot2( in vec2 v ) { return dot(v,v); } +float dot2( in vec3 v ) { return dot(v,v); } +float ndot( in vec2 a, in vec2 b ) { return a.x*b.x - a.y*b.y; } + +// from arminkz in Mario World 1-1 shader +vec2 CRTCurveUV( vec2 uv ) +{ + uv = uv * 2.0 - 1.0; + vec2 offset = abs( uv.yx ) / vec2( 6.0, 4.0 ); + uv = uv + uv * offset * offset; + uv = uv * 0.5 + 0.5; + return uv; +} + +void DrawVignette( inout vec3 color, vec2 uv ) +{ + float vignette = uv.x * uv.y * ( 1.0 - uv.x ) * ( 1.0 - uv.y ); + vignette = clamp( pow( 16.0 * vignette, 0.3 ), 0.0, 1.0 ); + color *= vignette; +} + +void DrawScanline( inout vec3 color, vec2 uv ) +{ + float scanline = clamp( 0.95 + 0.05 * cos( 3.14 * ( uv.y + 0.008 * iAmplifiedTime ) * 240.0 * 1.0 ), 0.0, 1.0 ); + float grille = 0.85 + 0.15 * clamp( 1.5 * cos( 3.14 * uv.x * 640.0 * 1.0 ), 0.0, 1.0 ); + color *= scanline * grille * 1.2; +} + +float sdEllipse( in vec2 p, in vec2 ab ) +{ + p = abs(p); if( p.x > p.y ) {p=p.yx;ab=ab.yx;} + float l = ab.y*ab.y - ab.x*ab.x; + float m = ab.x*p.x/l; float m2 = m*m; + float n = ab.y*p.y/l; float n2 = n*n; + float c = (m2+n2-1.0)/3.0; float c3 = c*c*c; + float q = c3 + m2*n2*2.0; + float d = c3 + m2*n2; + float g = m + m*n2; + float co; + if( d<0.0 ) + { + float h = acos(q/c3)/3.0; + float s = cos(h); + float t = sin(h)*sqrt(3.0); + float rx = sqrt( -c*(s + t + 2.0) + m2 ); + float ry = sqrt( -c*(s - t + 2.0) + m2 ); + co = (ry+sign(l)*rx+abs(g)/(rx*ry)- m)/2.0; + } + else + { + float h = 2.0*m*n*sqrt( d ); + float s = sign(q+h)*pow(abs(q+h), 1.0/3.0); + float u = sign(q-h)*pow(abs(q-h), 1.0/3.0); + float rx = -s - u - c*4.0 + 2.0*m2; + float ry = (s - u)*sqrt(3.0); + float rm = sqrt( rx*rx + ry*ry ); + co = (ry/sqrt(rm-rx)+2.0*g/rm-m)/2.0; + } + vec2 r = ab * vec2(co, sqrt(1.0-co*co)); + return length(r-p) * sign(p.y-r.y); +} + + + + + +//Quadratic Bezier - exact (https://www.shadertoy.com/view/MlKcDD) + +float sdBezier( in vec2 pos, in vec2 A, in vec2 B, in vec2 C ) +{ + vec2 a = B - A; + vec2 b = A - 2.0*B + C; + vec2 c = a * 2.0; + vec2 d = A - pos; + float kk = 1.0/dot(b,b); + float kx = kk * dot(a,b); + float ky = kk * (2.0*dot(a,a)+dot(d,b)) / 3.0; + float kz = kk * dot(d,a); + float res = 0.0; + float p = ky - kx*kx; + float p3 = p*p*p; + float q = kx*(2.0*kx*kx-3.0*ky) + kz; + float h = q*q + 4.0*p3; + if( h >= 0.0) + { + h = sqrt(h); + vec2 x = (vec2(h,-h)-q)/2.0; + vec2 uv = sign(x)*pow(abs(x), vec2(1.0/3.0)); + float t = clamp( uv.x+uv.y-kx, 0.0, 1.0 ); + res = dot2(d + (c + b*t)*t); + } + else + { + float z = sqrt(-p); + float v = acos( q/(p*z*2.0) ) / 3.0; + float m = cos(v); + float n = sin(v)*1.732050808; + vec3 t = clamp(vec3(m+m,-n-m,n-m)*z-kx,0.0,1.0); + res = min( dot2(d+(c+b*t.x)*t.x), + dot2(d+(c+b*t.y)*t.y) ); + // the third root cannot be the closest + // res = min(res,dot2(d+(c+b*t.z)*t.z)); + } + return sqrt( res ); +} + +// Image + +// Fork of "pantera rosa" by jorge2017a2. https://shadertoy.com/view/l3GGRW +// 2024-08-05 11:06:26 + +//por jorge2017a2 +//pantera rosa +//referencia +//https://iquilezles.org/articles/distfunctions2d +///2-jun-2024- +#define antialiasing(n) n/min(iResolution.y,iResolution.x) + +#define S(d,b) smoothstep(antialiasing(1.5),0. , d - (b) ) +#define S2(d,b) smoothstep(8.0*antialiasing(1.5),0.,d - (b) ) +#define S3(d,b) smoothstep(1.0/antialiasing(0.5),0. , d - (b) ) + +#define PI 3.14159265 +#define TWO_PI 6.28318530 +float Sdf_I(float distA, float distB) + { return max(distA, distB);} +float Sdf_U(float distA, float distB) + { return min(distA, distB);} +float Sdf_D(float distA, float distB) + { return max(distA, -distB);} + + + +vec3 DFB(vec3 pColObj, vec3 colOut, float distObj ) +{ colOut = mix(colOut,pColObj ,S3( distObj,0.0)); + colOut = mix(colOut,vec3(0.0),S3(abs( distObj)-0.005,0.0)); + return colOut; +} + + +///oneshade +vec2 Rotate(in vec2 p, in vec2 o, in float r) +{ float c = cos(r), s = sin(r); + return (p - o) * mat2(c, -s, s, c) + o; +} + + +float sdBox( in vec2 p, in vec2 b ) +{ vec2 d = abs(p)-b; return length(max(d,0.0)) + min(max(d.x,d.y),0.0); } + +float sdCircle( vec2 p, float r ) +{ return length(p) - r;} + +float divf(float a, float b) +{ + //evita crash por 1/0.0 =Infinito=error, en compilar + if(b==0.0) + {b=0.00001;} + return a/b; +} + + +float sdSegment( in vec2 p, in vec2 a, in vec2 b ) +{ vec2 pa = p-a, ba = b-a; + float h = clamp( divf( dot(pa,ba),dot(ba,ba)), 0.0, 1.0 ); + return length( pa - ba*h ); +} + +// signed distance to an equilateral triangle +float sdEquilateralTriangle( in vec2 p, in float r ) +{ + const float k = sqrt(3.0); + p.x = abs(p.x) - r; + p.y = p.y + r/k; + if( p.x+k*p.y>0.0 ) p=vec2(p.x-k*p.y,-k*p.x-p.y)/2.0; + p.x -= clamp( p.x, -2.0*r, 0.0 ); + return -length(p)*sign(p.y); +} + + +float sdUnevenCapsule( vec2 p, float r1, float r2, float h ) +{ + p.x = abs(p.x); + float b = (r1-r2)/h; + float a = sqrt(1.0-b*b); + float k = dot(p,vec2(-b,a)); + if( k < 0.0 ) return length(p) - r1; + if( k > a*h ) return length(p-vec2(0.0,h)) - r2; + return dot(p, vec2(a,b) ) - r1; +} + + +vec3 pantera(vec2 p, vec3 colout) +{ + +vec2 A,B, med,pr; +float dfin; +float r1 ; + +A=vec2(0.52098,0.56294); +med=vec2(0.4021,0.19231); +float d1=sdEllipse(p-A,med); + +A=vec2(0.52098,0.52448); +med=vec2(0.41958,0.15734); +float d2=sdEllipse(p-A,med); + +A=vec2(0.98601,0.65231); +med=vec2(0.08741,0.12238); +float ang=50.000 * PI / 180.0; + pr = Rotate(p-A, med/2.0, ang); +float d3=sdEllipse(pr,med); + +A=vec2(0.08392,0.752); +med=vec2(0.08741,0.12238); + ang=-50.000 * PI / 180.0; + pr = Rotate(p-A, med/2.0, ang); +float d4=sdEllipse(pr,med); + + dfin=999.9; + dfin=d1; + dfin=Sdf_U(dfin,d2); + dfin=Sdf_U(dfin,d3); //oreja der + dfin=Sdf_U(dfin,d4); //oreja izq + vec3 colc=vec3(0.97,0.61,0.7); + colout= DFB(colc, colout, dfin); + return colout; + +} + +vec3 ojos(vec2 p, vec3 colout) +{ + + float audio = texture(iAudioData,vec2(p.y, 0.)).r/2.; + + p.y-=.67; + p.x-=.56; + float l = length(p)/length(iResolution.xy/iResolution.y); + float a = atan(p.x,p.y)+iTime; + float s = texture(iAudioData,vec2(abs(fract(5.*a/6.283)*2.-1.),.75)).r; + float A_ =.4; + float B_ =.45; + p.y+=.67; + p.x+=.56; + A_*=A_; + B_*=B_; + + + vec2 A,B, med,pr; + float dfin; + float r1 ; + + vec3 colc=vec3(0.99,0.93,0.07); + + //der + A=vec2(0.63636,0.6958); + A=vec2(0.60636,0.6958); + med=vec2(0.08741,0.10839); + float ang=-40.000 * PI / 180.0; + pr = Rotate(p-A, med/2.0, ang); + // right outlines + float d1=sdEllipse(pr,med); + + //izq + A=vec2(0.45105,0.67832); + A=vec2(0.5105,0.67832); + med=vec2(0.09091,0.10839); + ang=40.000 * PI / 180.0; + pr = Rotate(p-A, med/2.0, ang); + // outlines from the left eye + float d2=sdEllipse(pr,med); + + dfin=Sdf_U(d1,d2); + //colc *=audio; + + if(l>d2*20. || l>d1*20.){ + + colc.r = 1.-texture(iAudioData,vec2(pow(mix(mix(l,.0,A_), s ,B_),2.),.25)).r/1.25; + colc.g = 1.-texture(iAudioData,vec2(pow(mix(mix(l,.5,A_),(1.-s),B_),2.),.25)).r/1.35; + colc.b = 1.-texture(iAudioData,vec2(pow(mix(mix(l,1.,A_), s ,B_),2.),.25)).r/1.5; + + colc.rgb = smoothstep(.05,1., colc.rgb+.2*l); + colc.rgb = pow(colc.rgb, vec3(s)); + //colc.rgb =colc.rgb*0.5; + } + colout= DFB(colc, colout,dfin); + + + //pupila + //p.x+=(sin(iTime)/10.)-0.005; + p.x-=-0.01+smoothstep(0.005, 0.02, (sin(iAmplifiedTime/2.)/2.)-0.005)/20.-0.005; + A=vec2(0.47203,0.66783); + r1=0.02448; + float d3=sdCircle(p-A,r1)*(1.+audio*4.); + //d3+=nivel*2.0; + vec3 pupil_inner = vec3(0.); + //pupil_inner.r = texture(iAudioData,vec2(pow(mix(mix(l,.0,A_), s ,B_),2.),.25)).r/1.25; + //pupil_inner.g = texture(iAudioData,vec2(pow(mix(mix(l,.5,A_), s ,B_),2.),.25)).r/1.25; + //pupil_inner.b = 1.- texture(iAudioData,vec2(pow(mix(mix(l,1.0,A_), s ,B_),2.),.25)).r/1.25; + //colout= DFB(vec3(0.0), colout, d3); + colout= DFB(pupil_inner, colout, d3); + + //pupila + A=vec2(0.61888,0.67483); + r1=0.02448; + + float d4=sdCircle(p-A,r1)*(1.+audio*4.); + //colout= DFB(vec3(0.0), colout, d4); + colout= DFB(pupil_inner, colout, d4); + //p.x-=(sin(iTime)/20.)-0.05; + p.x+=-0.01+smoothstep(0.005, 0.02, (sin(iTime)/10.)-0.005)/20.-0.005; + return colout; +} + + +vec3 nariz(vec2 p, vec3 colout) +{ + +vec2 A,B, med,pr; +float dfin; +float r1,ang ; + +vec3 colc=vec3(0.96,0.6,0.82); //rosa +vec3 colb=vec3(0.99,0.51,0.7); + +A=vec2(0.55245,0.57552); +med=vec2(0.0744,0.05944); +float d1=sdEquilateralTriangle(p-A,med.x); +colout= DFB(colc, colout, d1); + +A=vec2(0.55245,0.6042); +med=vec2(0.0744,0.05944); +float d2=sdEquilateralTriangle(vec2(p.x, -p.y+1.09)-A,med.x); +colout= DFB(colb, colout, d2); +return colout; +} + + +vec3 boca(vec2 p, vec3 colout) +{ +vec2 A,B, med,pr; +float dfin; +float r1 ; + +vec3 colc=vec3(0.97,0.76,0.82); + +A=vec2(0.55944,0.3951); +med=vec2(0.24126,0.16084); +float ang=-5.000 * PI / 180.0; + pr = Rotate(p-A, med/2.0, ang); +float d1=sdEllipse(pr,med); + +A=vec2(0.55245,0.20979); +med=vec2(0.24126,0.16084); + ang=-5.000 * PI / 180.0; + pr = Rotate(p-A, med/2.0, ang); +float d2=sdEllipse(pr,med); + +A=vec2(0.55545,0.32867); +med=vec2(0.15385,0.16084); + ang=15.000 * PI / 180.0; + pr = Rotate(p-A, med/2.0, ang); +float d3=sdEllipse(pr,med); + +colout= DFB(colc, colout, d3); + + dfin=Sdf_D(d1,d2); + colout= DFB(colc, colout, dfin); + + return colout; +} + +vec3 cuello(vec2 p, vec3 colout) +{ +vec2 A,B, med,pr; +float dfin; +float r1 ; + +vec3 colc=vec3(0.97,0.61,0.7); + +A=vec2(0.53147,0.14336); +med=vec2(0.06643,0.15734); +float d1=sdBox(p-A,med); +colout= DFB(colc, colout, d1); + return colout; +} + +//skin ? +vec3 pestana(vec2 p, vec3 colout) +{ + +vec2 A,B, med,pr; +float dfin; +float r1 ; +p.x+=0.7; +p.y+=0.6; + +A=vec2(0.48657,0.78469); +med=vec2(0.03147,0.08741); +float ang=15.000 * PI / 180.0; + pr = Rotate(p-A, med/2.0, ang); +float d1=sdBox(pr-A,med); +colout= DFB(vec3(0.0), colout, d1); + +A=vec2(0.75734,0.62517); +med=vec2(0.03147,0.06993); + ang=-15.000 * PI / 180.0; + pr = Rotate(p-A, med/2.0, ang); +float d2=sdBox(pr-A,med); +colout= DFB(vec3(0.0), colout, d2); + return colout; +} + +vec3 Lineaboca(vec2 p, vec3 colout) +{ + +vec2 A,B, med,pr; +float dfin; +float r1 ; + +A=vec2(0.54196,0.37063); +B=vec2(0.54196,0.41259); +float d1=sdSegment(p,A,B); +colout= DFB(vec3(0.0), colout, d1); +return colout; +} + +vec3 figOreja(vec2 p, vec3 colout) +{ + +vec2 A,B, med,pr; +float dfin; +float r1 ; + + +vec3 colc=vec3(0.97,0.76,0.82); //rosa + +A=vec2(0.14042,0.7182); +r1=0.02098; +float d1=sdUnevenCapsule(vec2(p.x,-p.y+1.45)-A,r1,r1-0.05,0.1); +colout= DFB(colc, colout, d1); + +A=vec2(0.97902,0.70483); +r1=0.02098; +float d2=sdUnevenCapsule(vec2(p.x, -p.y+1.45)-A,r1,r1-0.05,0.1); +colout= DFB(colc, colout, d2); + return colout; +} + + +vec3 figrostro(vec2 p, vec3 colout) +{ +vec2 A,B, med,pr; +float dfin; +float r1 ; + +A=vec2(0.38811,0.55944); +B=vec2(0.44056,0.56993); +float d1=sdSegment(p,A,B); +colout= DFB(vec3(0.0), colout, d1); + +A=vec2(0.32168,0.57343); +B=vec2(0.38112,0.55944); +float d2=sdSegment(p,A,B); +colout= DFB(vec3(0.0), colout, d2); + +A=vec2(0.67832,0.57692); +B=vec2(0.61888,0.6014); +float d3=sdSegment(p,A,B); +colout= DFB(vec3(0.0), colout, d3); + +A=vec2(0.67832,0.57692); +B=vec2(0.73776,0.58741); +float d4=sdSegment(p,A,B); +colout= DFB(vec3(0.0), colout, d4); + return colout; +} + +vec3 bigote(vec2 uv, vec3 col) +{ +//float audio = texture(iAudioData,vec2(uv.y, 0.)).r/2.; +//float audio = texture(iAudioData,uv).r/2.; +float audio = texture(iAudioData,vec2(sin(iTime),0.)).r/2.; + +uv.x-=0.05; +vec2 pc1p1=vec2(.634,.434); +vec2 pc1p2=vec2(.820,.406); +vec2 pc1p3=vec2(.969,.329); + +vec2 pc2p1=vec2(.634,.392); +vec2 pc2p2=vec2(.814,.325); +vec2 pc2p3=vec2(.963,.206); + +vec2 pc3p1=vec2(.016,.297); +vec2 pc3p2=vec2(.199,.406); +vec2 pc3p3=vec2(.363,.413); + +vec2 pc4p1=vec2(.022,.168); +vec2 pc4p2=vec2(.193,.336); +vec2 pc4p3=vec2(.376,.381); + + +float d1= sdBezier(uv,pc1p1,pc1p2,pc1p3*(1.+audio/10.)); +float d2= sdBezier(uv,pc2p1,pc2p2,pc2p3*(1.+audio/10.)); +float d3= sdBezier(uv,pc3p1*(1.+audio/5.),pc3p2,pc3p3); +float d4= sdBezier(uv,pc4p1*(1.+audio/5.),pc4p2,pc4p3); + +vec3 C1=vec3(0.0); +col=DFB(C1,col,d1); +col=DFB(C1,col,d2); +col=DFB(C1,col,d3); +col=DFB(C1,col,d4); +//if( audio>d1 && audio >d2 && audio>d3 && audio > d4){ +// col*=audio; +//} + return col; +} + +// cosine based palette, 4 vec3 params +vec3 palette( in float t, in vec3 a, in vec3 b, in vec3 c, in vec3 d ) +{ + return a + b*cos( 6.283185*(c*t+d) ); +} +// colormap +vec3 palette(float t) { + if(t <1.)t+=1.; + vec3 a = vec3(0.5); + vec3 b = vec3(0.5); + vec3 c = vec3(1.); + //vec3 d = vec3(0.563,0.416,0.457 + .2); + vec3 d = vec3(0.,0.3,0.67); + + /* + vec3 a = vec3(.5); + vec3 b = vec3(.5); + vec3 c = vec3(2.0, 1.0, 0.0); + vec3 d = vec3(0.50, 0.20, 0.25); + */ + //return a + b*cos( 6.28 * c * (t+d)); // A + B * cos ( 2pi * (Cx + D) ) + //return palette(t, a,b,c,d); + return palette(t, vec3(0.8,0.5,0.4),vec3(0.2,0.4,0.2),vec3(2.0,1.0,1.0),vec3(0.0,0.25,0.25) ); +} + + +vec3 tdo_pantera(vec2 p, vec3 colout) +{ + //float audio = texture(iAudioData,vec2(abs(fract(5.*length(p)/6.283)*2.-1.),.75)).r/2.; + //float audio = texture(iAudioData,vec2(abs(fract(length(p)/length(p.x))),.75)).r/2.; + //float audio = texture(iAudioData,p/2.).r/2.; + float audio = texture(iAudioData,p).r/2.; + float audio2 = texture(iAudioData,vec2(p.y, 0.)).r/2.; + //vec3(0.97,0.61,0.7) + //colout = vec3(audio, audio2/2., (audio+audio2)/2.+.1 ); + //colout = vec3(audio, audio2/2., (audio+audio2)/2.+.1 )*(.4+palette(sin(iTime))); + //colout = vec3(audio, audio2/2., (audio+audio2)/2.+.1 )*(.4+palette(p.x+sin(iTime))); + //colout = vec3(audio, audio2/2., (audio+audio2)/2.+.1 )*(.3+palette((p.x+p.y)/2.)+sin(iTime)); + //colout = vec3(audio, audio2/2., (audio+audio2)/2.+.1 )*(.3+palette((p.x+p.y)/2.)); + //colout = vec3(audio, audio2, (audio+audio2)/2.+.1 )*(.3+palette((p.x+p.y+sin(iTime*audio))/2.)); + colout = vec3(audio, audio2, (audio+audio2)/2.+.1 )*(.3+palette((p.y))*1.5); + colout=cuello(p,colout); // nacken + colout=pantera(p, colout); + colout=pestana(p,colout); // wimper + colout=ojos(p, colout); // augen + colout=boca(p,colout); + colout= nariz(p,colout); + colout= Lineaboca(p,colout); // *audio; + colout=figOreja(p,colout); + colout=figrostro(p,colout); + colout=bigote(p,colout); + + return colout; +} + +void main() +{ + vec2 fragCoord = vUv * iResolution; + vec2 uv = ( 2. * fragCoord - iResolution.xy ) / iResolution.y; + uv-=vec2(-1.,-1.); + float esc=0.6; + uv*=esc; + //uv.x+=0.3; + //uv+=vec2(0.25*cos(-iTime), 0.25*sin(-iTime)); + vec2 uv0=uv; + vec3 col = vec3(0.5,0.1,1.0); + //vec3 col=vec3(0.5,0.1,1.0)-uv.y*0.5; + //col= tdo_pantera(uv*0.5,col); + + float rnd = 0.5 + 0.2*sin(iTime*0.25); + float multiplier = 0.9 + 0.2 * rnd; + uv *= multiplier; + + + col= tdo_pantera(uv,col); + //col= tdo_pantera(uv*2.0+vec2(0.25,0.5),col); + //col= tdo_pantera(uv*2.0+vec2(-1.20,0.5),col); + col=pow(col, vec3(0.54545)); + + uv = fragCoord.xy / iResolution.xy; + vec2 crtUV = CRTCurveUV(uv); + if ( crtUV.x < 0.0 || crtUV.x > 1.0 || crtUV.y < 0.0 || crtUV.y > 1.0 ) + { + col = vec3( 0.0, 0.0, 0.0 ); + } + DrawVignette( col, crtUV ); + DrawScanline( col, uv ); + + gl_FragColor = vec4(col,1.0); +} + + + diff --git a/dist/shaders/pantera_rosa_CRT.frag.meta b/dist/shaders/pantera_rosa_CRT.frag.meta new file mode 100644 index 0000000..a044aaf --- /dev/null +++ b/dist/shaders/pantera_rosa_CRT.frag.meta @@ -0,0 +1,10 @@ +{ + "author": "jorge2017a2", + "modifiedBy": "ArthurTent", + "shaderName": "pantera rosa", + "url": "https://www.shadertoy.com/view/l3GGRW", + "license": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License", + "licenseURL": "https://creativecommons.org/licenses/by-nc-sa/3.0/", + "video": "media/LACHICA-AGUA.mp4", + "shaderSpeed": 0.8 +} diff --git a/dist/shaders/symbolism.frag b/dist/shaders/symbolism.frag index 2456353..abbdbf5 100644 --- a/dist/shaders/symbolism.frag +++ b/dist/shaders/symbolism.frag @@ -10,19 +10,75 @@ // - use with music in iChannel0 - // -#define PI 3.14159265359 #define aTime 2.133333*iAmplifiedTime vec4 fft, ffts; //compressed frequency amplitudes uniform float iAmplifiedTime; +uniform float iTime; uniform sampler2D iAudioData; // nice hint for loading tAudio --> https://threejs.org/examples/webaudio_visualizer uniform sampler2D iChannel0; uniform sampler2D iChannel1; uniform vec2 iResolution; +uniform vec2 iMouse; uniform sampler2D iVideo; - varying vec2 vUv; +#define FFT(a) pow(texelFetch(iAudioData, ivec2(a, 0), 0).x, 5.) +float snd = 0.; +const float PI = 3.1415926; + +// MIT Licensed hash From Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) +vec3 hash33(vec3 p) +{ + p = fract(p * vec3(443.8975,397.2973, 491.1871)); + p += dot(p.zxy, p.yxz+19.27); + return fract(vec3(p.x * p.y, p.z*p.x, p.y*p.z)); +} + +vec3 stars(in vec3 p) +{ + vec3 c = vec3(0.); + float res = iResolution.x*0.8; + + for (float i=0.;i<4.;i++) + { + vec3 q = fract(p*(.15*res))-0.5; + //q*= snd/10.; + vec3 id = floor(p*(.15*res)); + vec2 rn = hash33(id).xy; + float c2 = 1.-smoothstep(0.,.6,length(q)); + c2 *= step(rn.x,.0005+i*i*0.001); + c += c2*(mix(vec3(1.0,0.49,0.1),vec3(0.75,0.9,1.),rn.y)*0.25+0.75); + p *= 1.4; + } + return c*c*.65; +} +void camera(vec2 fragCoord, out vec3 ro, out vec3 rd, out mat3 t) +{ + float a = 1.0/max(iResolution.x, iResolution.y); + //rd = normalize(vec3((fragCoord - iResolution.xy*0.5)*a, 0.5)); + rd = normalize(vec3(fragCoord, 1.0)); + + ro = vec3(0.0, 0.0, -15.); + + //float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y)); + float ff = min(1.0, step(0.001, iMouse.x) + step(0.001, iMouse.y))+sin(iTime/20.); + vec2 m = PI*ff + vec2(((iMouse.xy + 0.1) / iResolution.xy) * (PI*2.0)); + //m.y = -m.y; + m.y = sin(m.y*0.5)*0.3 + 0.5; + + //vec2 sm = sin(m)*sin(iTime), cm = cos(m)*(1.+sin(iTime)); + vec2 sm = sin(m)*(1.+sin(iTime/10.)/2.), cm = cos(m); + mat3 rotX = mat3(1.0, 0.0, 0.0, 0.0, cm.y, sm.y, 0.0, -sm.y, cm.y); + mat3 rotY = mat3(cm.x, 0.0, -sm.x, 0.0, 1.0, 0.0, sm.x, 0.0, cm.x); + + t = rotY * rotX; + + ro = t * ro; + rd = t * rd; + + rd = normalize(rd); +} void compressFft(){ //compress sound in iChannel0 to simplified amplitude estimations by frequency-range fft = vec4(0), ffts = vec4(0); @@ -337,10 +393,20 @@ vec3 makeSym(vec2 p, float id){ //glyph definitions (lots of redundant code but } void main( ){ + int max_freq = 100; + for(int i=1; i < max_freq; i++){ + snd +=FFT(i)*float(i); + } + snd /=float(max_freq*20); compressFft(); //initializes fft, ffts //vec2 uv = (2.*fragCoord-iResolution.xy) / max(iResolution.x, iResolution.y); //long edge -1 to 1 //vec2 uv = vUv.xy / iResolution.xy; vec2 uv = -1.0 + 2.0 *vUv; + //camera + rd for stars + vec3 ro = vec3(0.0);//rd = vec3( 0.0 ); + vec3 rd = normalize(vec3(uv,-1.5)); + mat3 t = mat3(1.0); + camera(uv, ro, rd, t); vec3 vid = texture(iVideo, vUv).rgb; // Symbol @@ -370,4 +436,7 @@ void main( ){ //gl_FragColor = vec4(col*(2.35*vid.rgb),1.0); //gl_FragColor = vec4(col*(2.*vid.rgb),1.0); gl_FragColor = vec4(col,1.0); + rd.x+=sin(iTime/1000.)*2.; + vec3 bg = stars(rd)*(1.+30.*snd); + gl_FragColor+=vec4(bg, 1.); } diff --git a/package-lock.json b/package-lock.json index 21cd92d..f4fe662 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "shader-amp", - "version": "0.9.0", + "version": "1.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "shader-amp", - "version": "0.9.0", + "version": "1.0.3", "license": "MIT", "dependencies": { "@eamonwoortman/use-chrome-storage": "^1.2.8", diff --git a/package.json b/package.json index 3fc3c97..8070b2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shader-amp", - "version": "1.0.2", + "version": "1.0.3", "description": "Unofficial ShaderToy Chrome Extension to visualize sound of any page.", "main": "index.js", "scripts": {