diff --git a/components/content/shadertoy-museum/TheExperience.vue b/components/content/shadertoy-museum/TheExperience.vue new file mode 100644 index 0000000..a8aba86 --- /dev/null +++ b/components/content/shadertoy-museum/TheExperience.vue @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/content/shadertoy-museum/components/Camera.vue b/components/content/shadertoy-museum/components/Camera.vue new file mode 100644 index 0000000..18efbf9 --- /dev/null +++ b/components/content/shadertoy-museum/components/Camera.vue @@ -0,0 +1,24 @@ + + + + + + + \ No newline at end of file diff --git a/components/content/shadertoy-museum/components/Effects.vue b/components/content/shadertoy-museum/components/Effects.vue new file mode 100644 index 0000000..0016f56 --- /dev/null +++ b/components/content/shadertoy-museum/components/Effects.vue @@ -0,0 +1,26 @@ + + + + + + + + + \ No newline at end of file diff --git a/components/content/shadertoy-museum/components/Floor.vue b/components/content/shadertoy-museum/components/Floor.vue new file mode 100644 index 0000000..b0ada77 --- /dev/null +++ b/components/content/shadertoy-museum/components/Floor.vue @@ -0,0 +1,38 @@ + + + + + + + + \ No newline at end of file diff --git a/components/content/shadertoy-museum/components/Gallery.vue b/components/content/shadertoy-museum/components/Gallery.vue new file mode 100644 index 0000000..33c773e --- /dev/null +++ b/components/content/shadertoy-museum/components/Gallery.vue @@ -0,0 +1,131 @@ + + + + + + + \ No newline at end of file diff --git a/components/content/shadertoy-museum/components/Lights.vue b/components/content/shadertoy-museum/components/Lights.vue new file mode 100644 index 0000000..2524233 --- /dev/null +++ b/components/content/shadertoy-museum/components/Lights.vue @@ -0,0 +1,54 @@ + + + + + \ No newline at end of file diff --git a/components/content/shadertoy-museum/components/ShaderToy.vue b/components/content/shadertoy-museum/components/ShaderToy.vue new file mode 100644 index 0000000..5872c12 --- /dev/null +++ b/components/content/shadertoy-museum/components/ShaderToy.vue @@ -0,0 +1,73 @@ + + + + + + + \ No newline at end of file diff --git a/components/content/shadertoy-museum/components/TextUi.vue b/components/content/shadertoy-museum/components/TextUi.vue new file mode 100644 index 0000000..1bb1f12 --- /dev/null +++ b/components/content/shadertoy-museum/components/TextUi.vue @@ -0,0 +1,133 @@ + + + + + + + {{ expanded ? '[x]' : + '[-]' }} + + + {{ title }} + {{ author }} + {{ description }} + {{ href }} + + + + + + \ No newline at end of file diff --git a/components/content/shadertoy-museum/fns/shaderToyLights.ts b/components/content/shadertoy-museum/fns/shaderToyLights.ts new file mode 100644 index 0000000..9d2ce7e --- /dev/null +++ b/components/content/shadertoy-museum/fns/shaderToyLights.ts @@ -0,0 +1,28 @@ +import { Color, Vector2, type Light } from "three"; +import type { shaderToySrc } from "./shaderToySrc"; +import { clamp } from "three/src/math/MathUtils.js"; + +const { pow, sqrt, cos, abs, sin, max, min } = Math + +export type LightFn = (light: Light, uv: Vector2, iTime: number) => void + +const color = new Color() +export const shaderToyLights = { + sinusoidalTresJS: (light: Light, uv: Vector2, iTime: number) => { + color.g = 0.5 * clamp(pow(1.0 - sqrt(abs(cos(uv.y + uv.x + iTime))), sin(iTime) + 2.0), 0.2, 1); + color.b = 0.5 * clamp(pow(1.0 - sin(uv.y + iTime), cos(iTime) + 2.0), 0.2, 1); + color.r = 0.5 * clamp(sin(iTime + uv.x + sin(uv.y + iTime)), 0.2, 1); + // NOTE: Just taking one sample, but it'll be jerky. + // Lerp to avoid big jumps in color. + light.color.lerp(color, 0.06) + }, + + sinusoidalTresJS2: (light: Light, uv: Vector2, iTime: number) => { + color.g = pow(1.0 - sqrt(abs(cos(uv.y + iTime * 0.1))), sin(iTime) + 2.0); + color.b = pow(1.0 - sin(uv.y + iTime), cos(iTime) + 2.0); + color.r = sin(iTime + uv.y + sin(uv.y + iTime)); + // NOTE: Just taking one sample, but it'll be jerky. + // Lerp to avoid big jumps in color. + light.color.lerp(color, 0.1) + } +} as Record \ No newline at end of file diff --git a/components/content/shadertoy-museum/fns/shaderToySrc.ts b/components/content/shadertoy-museum/fns/shaderToySrc.ts new file mode 100644 index 0000000..febda98 --- /dev/null +++ b/components/content/shadertoy-museum/fns/shaderToySrc.ts @@ -0,0 +1,1409 @@ +const gamesOfSinus = ` +// NOTE: https://www.shadertoy.com/view/M32BD1 +// color pallette inspired by https://www.shadertoy.com/view/ls3Xzn +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + vec2 uv = fragCoord/iResolution.xy; + + float ph = 25. + (1. - uv.x) * 20.; + float amp = 0.02 + uv.x / 5.; + float y = 0.5 + sin(uv.x * ph + iTime) * amp; + float c1 = 1. - smoothstep(0.003, 0.003 + exp(-(1. - uv.x) * 4.), abs(uv.y - y)); + float c2 = 1. - smoothstep(0.003, 0.003 + exp(-(uv.x) * 4.), abs(uv.y - y)); + float r = pow(1.0 - sqrt(abs(uv.y - c1)), sin(iTime) + 2.0); + float g = pow(1.0 - sqrt(abs(uv.y - c2)), cos(iTime) + 2.0 ); + float b = 1.5 * (r+g); + + fragColor = vec4(r, g, b, r + g + b); +} +/** SHADERDATA +{ + "title": "The games of sinus :)", + "author": "cesio", + "description": "Sinusoid, color pallette inspired by https://www.shadertoy.com/view/ls3Xzn", + "href": "https://www.shadertoy.com/view/M32BD1" +} +*/ +` + +const unyo = ` +// Source: https://www.shadertoy.com/view/MX2BWR +// 球の距離関数 +float sphereSDF(vec3 p, float radius) { + return length(p) - radius; +} + +// 立方体の距離関数 +float boxSDF(vec3 p, vec3 size) { + vec3 d = abs(p) - size; + float outsideDistance = length(max(d, 0.0)); + float insideDistance = min(max(d.x, max(d.y, d.z)), 0.0); + return outsideDistance + insideDistance; +} + +// スムーズな最小値を計算する関数 +float smin(float a, float b, float k) { + float h = clamp(0.5 + 0.5 * (b - a) / k, 0.0, 1.0); + return mix(b, a, h) - k * h * (1.0 - h); +} + +float sceneSDF(vec3 p) { + float time = iTime; + float d = 100.0; + + // 球の数を定義 + int numSpheres = 20; + + // 複数の球を生成して結合するためのループ + for (int i = 0; i < numSpheres; i++) { + float angle = float(i) * 1.1 + time; + vec3 spherePos = vec3(sin(angle), cos(angle * 1.5), sin(angle * 0.7)); + + // 半径を変える + float radius = 0.4 + 0.1 * float(i % 3); // 球の半径を少し変化させる + + // 結合 + float dSphere = sphereSDF(p - spherePos, radius); + d = smin(d, dSphere, 0.5); + } + + return d; // 最終的なSDFを返す +} + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) { + // 画面の座標を正規化 + vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y; + + // カメラの設定 + vec3 cp = vec3(0.0, 0.0, -5.0); // カメラの位置を近づける + vec3 target = vec3(0.0, 0.0, 0.0); // 注目するターゲット + vec3 cd = normalize(target - cp); // カメラの向き + vec3 cs = normalize(cross(cd, vec3(0.0, 1.0, 0.0))); // カメラの右方向 + vec3 cu = normalize(cross(cs, cd)); // カメラの上方向 + + // レイの方向 + vec3 rd = normalize(cs * uv.x + cu * uv.y + cd); // 視野角調整 + + // レイマーチングのループ + float t = 0.0; + float maxDistance = 100.0; + int maxSteps = 100; + float d; + for (int i = 0; i < maxSteps; i++) { + vec3 p = cp + t * rd; // 現在のレイの位置 + d = sceneSDF(p); // 距離を計算 + if (d < 0.001) break; // 十分近づいたら終了 + t += d; // レイを進める + if (t > maxDistance) break; // 最大距離を超えたら終了 + } + + // ヒットしたかどうかで色を決定 + vec3 color; + if (t < maxDistance) { + // オブジェクトがヒットしたらカラフルな色にする + float r = 0.5 + 0.5 * sin(iTime + t); + float g = 0.5 + 0.5 * cos(iTime + t * 1.3); + float b = 0.5 + 0.5 * sin(iTime + t * 2.0); + color = vec3(r, g, b); // カラフルな色 + } else { + color = vec3(0.0); // ヒットしなかったら黒色 + } + + // 最終的なフラグメントの色を設定 + fragColor = vec4(color, 1.0); +} + +` + +const prettyHip = ` +// NOTE: https://www.shadertoy.com/view/XsBfRW +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + float aspect = iResolution.y/iResolution.x; + float value; + vec2 uv = fragCoord.xy / iResolution.x; + uv -= vec2(0.5, 0.5*aspect); + float rot = radians(45.0); // radians(45.0*sin(iTime)); + mat2 m = mat2(cos(rot), -sin(rot), sin(rot), cos(rot)); + uv = m * uv; + uv += vec2(0.5, 0.5*aspect); + uv.y+=0.5*(1.0-aspect); + vec2 pos = 10.0*uv; + vec2 rep = fract(pos); + float dist = 2.0*min(min(rep.x, 1.0-rep.x), min(rep.y, 1.0-rep.y)); + float squareDist = length((floor(pos)+vec2(0.5)) - vec2(5.0) ); + + float edge = sin(iTime-squareDist*0.5)*0.5+0.5; + + edge = (iTime-squareDist*0.5)*0.5; + edge = 2.0*fract(edge*0.5); + //value = 2.0*abs(dist-0.5); + //value = pow(dist, 2.0); + value = fract (dist*2.0); + value = mix(value, 1.0-value, step(1.0, edge)); + //value *= 1.0-0.5*edge; + edge = pow(abs(1.0-edge), 2.0); + + //edge = abs(1.0-edge); + value = smoothstep( edge-0.05, edge, 0.95*value); + + + value += squareDist*.1; + //fragColor = vec4(value); + fragColor = mix(vec4(1.0,1.0,1.0,1.0),vec4(edge,0.0,0.0,1.0), value); + fragColor.a = clamp(value, 0.0, 1.0); +} +` + +const mainImageDrawCircle = ` +// NOTE: https://www.shadertoy.com/view/3tdSRn +vec3 drawCircle(vec2 pos, float radius, float width, float power, vec4 color) +{ + vec2 mousePos = iMouse.xy - vec2(0.5); + float dist1 = length(pos); + dist1 = fract((dist1 * 5.0) - fract(iTime)); + float dist2 = dist1 - radius; + float intensity = pow(radius / abs(dist2), width); + vec3 col = color.rgb * intensity * power * max((0.8- abs(dist2)), 0.0); + return col; +} + +vec3 hsv2rgb(float h, float s, float v) +{ + vec4 t = vec4(1.0, 2.0/3.0, 1.0/3.0, 3.0); + vec3 p = abs(fract(vec3(h) + t.xyz) * 6.0 - vec3(t.w)); + return v * mix(vec3(t.x), clamp(p - vec3(t.x), 0.0, 1.0), s); +} + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + // // -1.0 ~ 1.0 + vec2 pos = (fragCoord.xy * 2.0 - iResolution.xy) / min(iResolution.x, iResolution.y); + + float h = mix(0.5, 0.65, length(pos)); + vec4 color = vec4(hsv2rgb(h, 1.0, 1.0), 1.0); + float radius = 0.5; + float width = 0.8; + float power = 0.1; + vec3 finalColor = drawCircle(pos, radius, width, power, color); + + pos = abs(pos); + // vec3 finalColor = vec3(pos.x, 0.0, pos.y); + + fragColor = vec4(finalColor, finalColor.r); +} +` + +const cellular = ` +// NOTE: https://www.shadertoy.com/view/Xs2GDd +#define PI 3.14159265359 + +vec3 col1 = vec3(0.216, 0.471, 0.698); // blue +vec3 col2 = vec3(1.00, 0.329, 0.298); // yellow +vec3 col3 = vec3(0.867, 0.910, 0.247); // red + +float disk(vec2 r, vec2 center, float radius) { + return 1.0 - smoothstep( radius-0.008, radius+0.008, length(r-center)); +} + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + float t = iTime*2.; + vec2 r = (2.0*fragCoord.xy - iResolution.xy) / iResolution.y; + r *= 1.0 + 0.05*sin(r.x*5.+iTime) + 0.05*sin(r.y*3.+iTime); + r *= 1.0 + 0.2*length(r); + float side = 0.5; + vec2 r2 = mod(r, side); + vec2 r3 = r2-side/2.; + float i = floor(r.x/side)+2.; + float j = floor(r.y/side)+4.; + float ii = r.x/side+2.; + float jj = r.y/side+4.; + + vec3 pix = vec3(1.0); + + float rad, disks; + + rad = 0.15 + 0.05*sin(t+ii*jj); + disks = disk(r3, vec2(0.,0.), rad); + pix = mix(pix, col2, disks); + + float speed = 2.0; + float tt = iTime*speed+0.1*i+0.08*j; + float stopEveryAngle = PI/2.0; + float stopRatio = 0.7; + float t1 = (floor(tt) + smoothstep(0.0, 1.0-stopRatio, fract(tt)) )*stopEveryAngle; + + float x = -0.07*cos(t1+i); + float y = 0.055*(sin(t1+j)+cos(t1+i)); + rad = 0.1 + 0.05*sin(t+i+j); + disks = disk(r3, vec2(x,y), rad); + pix = mix(pix, col1, disks); + + rad = 0.2 + 0.05*sin(t*(1.0+0.01*i)); + disks = disk(r3, vec2(0.,0.), rad); + pix += 0.2*col3*disks * sin(t+i*j+i); + + pix -= smoothstep(0.3, 5.5, length(r)); + fragColor = vec4(pix, disks); +} +` + +const tiles = ` +// Source: https://www.shadertoy.com/view/mdBSRt +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + float aspect_ratio = iResolution.y/iResolution.x; + vec2 uv = fragCoord.xy / iResolution.x; + uv -= vec2(0.5, 0.5 * aspect_ratio); + float rot = radians(-30. -iTime); // radians(45.0*sin(iTime)); + mat2 rotation_matrix = mat2(cos(rot), -sin(rot), sin(rot), cos(rot)); + uv = rotation_matrix * uv; + vec2 scaled_uv = 20.0 * uv; + vec2 tile = fract(scaled_uv); + float tile_dist = min(min(tile.x, 1.0-tile.x), min(tile.y, 1.0-tile.y)); + float square_dist = length(floor(scaled_uv)); + + float edge = sin(iTime-square_dist*20.); + edge = mod(edge * edge, edge / edge); + + float value = mix(tile_dist, 1.0-tile_dist, step(1.0, edge)); + edge = pow(abs(1.0-edge), 2.2) * 0.5; + + value = smoothstep( edge-0.05, edge, 0.95*value); + + + value += square_dist*.1; + value *= 0.8 - 0.2; + fragColor = vec4(pow(value, 2.), pow(value, 1.5), pow(value, 1.2), value); +} +` + +const rainbow = ` +// https://www.shadertoy.com/view/lscBRf +#define FALLING_SPEED 0.25 +#define STRIPES_FACTOR 5.0 + +//get sphere +float sphere(vec2 coord, vec2 pos, float r) { + vec2 d = pos - coord; + return smoothstep(60.0, 0.0, dot(d, d) - r * r); +} + +//main +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + //normalize pixel coordinates + vec2 uv = fragCoord / iResolution.xy; + //pixellize uv + vec2 clamped_uv = (round(fragCoord / STRIPES_FACTOR) * STRIPES_FACTOR) / iResolution.xy; + //get pseudo-random value for stripe height + float value = fract(sin(clamped_uv.x) * 43758.5453123); + //create stripes + vec3 col = vec3(1.0 - mod(uv.y * 0.5 + (iTime * (FALLING_SPEED + value / 5.0)) + value, 0.5)); + //add color + col *= clamp(cos(iTime * 2.0 + uv.xyx + vec3(0, 2, 4)), 0.0, 1.0); + //add glowing ends + col += vec3(sphere(fragCoord, + vec2(clamped_uv.x, (1.0 - 2.0 * mod((iTime * (FALLING_SPEED + value / 5.0)) + value, 0.5))) * iResolution.xy, + 0.9)) / 2.0; + //add screen fade + col *= vec3(exp(-pow(abs(uv.y - 0.5), 6.0) / pow(2.0 * 0.05, 2.0))); + // Output to screen + fragColor = vec4(col, col.r + col.g + col.b); +} +` + +const star = ` +// https://www.shadertoy.com/view/ttKGDt +precision highp float; + + +mat2 rot(float a) { + float c = cos(a), s = sin(a); + return mat2(c,s,-s,c); +} + +const float pi = acos(-1.0); +const float pi2 = pi*2.0; + +vec2 pmod(vec2 p, float r) { + float a = atan(p.x, p.y) + pi/r; + float n = pi2 / r; + a = floor(a/n)*n; + return p*rot(-a); +} + +float box( vec3 p, vec3 b ) { + vec3 d = abs(p) - b; + return min(max(d.x,max(d.y,d.z)),0.0) + length(max(d,0.0)); +} + +float ifsBox(vec3 p) { + for (int i=0; i<5; i++) { + p = abs(p) - 1.0; + p.xy *= rot(iTime*0.3); + p.xz *= rot(iTime*0.1); + } + p.xz *= rot(iTime); + return box(p, vec3(0.4,0.8,0.3)); +} + +float map(vec3 p, vec3 cPos) { + vec3 p1 = p; + p1.x = mod(p1.x-5., 10.) - 5.; + p1.y = mod(p1.y-5., 10.) - 5.; + p1.z = mod(p1.z, 16.)-8.; + p1.xy = pmod(p1.xy, 5.0); + return ifsBox(p1); +} + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) { + vec2 p = (fragCoord.xy * 2.0 - iResolution.xy) / min(iResolution.x, iResolution.y); + + vec3 cPos = vec3(0.0,0.0, -3.0 * iTime); + // vec3 cPos = vec3(0.3*sin(iTime*0.8), 0.4*cos(iTime*0.3), -6.0 * iTime); + vec3 cDir = normalize(vec3(0.0, 0.0, -1.0)); + vec3 cUp = vec3(sin(iTime), 1.0, 0.0); + vec3 cSide = cross(cDir, cUp); + + vec3 ray = normalize(cSide * p.x + cUp * p.y + cDir); + + // Phantom Mode https://www.shadertoy.com/view/MtScWW by aiekick + float acc = 0.0; + float acc2 = 0.0; + float t = 0.0; + for (int i = 0; i < 99; i++) { + vec3 pos = cPos + ray * t; + float dist = map(pos, cPos); + dist = max(abs(dist), 0.02); + float a = exp(-dist*3.0); + if (mod(length(pos)+24.0*iTime, 30.0) < 3.0) { + a *= 2.0; + acc2 += a; + } + acc += a; + t += dist * 0.5; + } + + vec3 col = vec3(acc * 0.01, acc * 0.011 + acc2*0.002, acc * 0.012+ acc2*0.005); + fragColor = vec4(col, 1.0 - t * 0.03); +} +` + +const fractalPyramid = ` +// NOTE: https://www.shadertoy.com/view/tsXBzS +vec3 palette(float d){ + return mix(vec3(0.2,0.7,0.9),vec3(1.,0.,1.),d); +} + +vec2 rotate(vec2 p,float a){ + float c = cos(a); + float s = sin(a); + return p*mat2(c,s,-s,c); +} + +float map(vec3 p){ + for( int i = 0; i<8; ++i){ + float t = iTime*0.2; + p.xz =rotate(p.xz,t); + p.xy =rotate(p.xy,t*1.89); + p.xz = abs(p.xz); + p.xz-=.5; + } + return dot(sign(p),p)/5.; +} + +vec4 rm (vec3 ro, vec3 rd){ + float t = 0.; + vec3 col = vec3(0.); + float d; + for(float i =0.; i<64.; i++){ + vec3 p = ro + rd*t; + d = map(p)*.5; + if(d<0.02){ + break; + } + if(d>100.){ + break; + } + //col+=vec3(0.6,0.8,0.8)/(400.*(d)); + col+=palette(length(p)*.1)/(400.*(d)); + t+=d; + } + return vec4(col,1./(d*100.)); +} +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + vec2 uv = (fragCoord-(iResolution.xy/2.))/iResolution.x; + vec3 ro = vec3(0.,0.,-50.); + ro.xz = rotate(ro.xz,iTime); + vec3 cf = normalize(-ro); + vec3 cs = normalize(cross(cf,vec3(0.,1.,0.))); + vec3 cu = normalize(cross(cf,cs)); + + vec3 uuv = ro+cf*3. + uv.x*cs + uv.y*cu; + + vec3 rd = normalize(uuv-ro); + + vec4 col = rm(ro,rd); + + + fragColor = col; +} + +/** SHADERDATA +{ + "title": "fractal pyramid", + "description": "", + "model": "car" +} +*/ +` + +const mandelbulb = ` +// NOTE: https://www.shadertoy.com/view/MdXSWn +// Created by evilryu +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + + +// whether turn on the animation +//#define phase_shift_on + +float stime, ctime; + void ry(inout vec3 p, float a){ + float c,s;vec3 q=p; + c = cos(a); s = sin(a); + p.x = c * q.x + s * q.z; + p.z = -s * q.x + c * q.z; + } + +float pixel_size = 0.0; + +/* + +z = r*(sin(theta)cos(phi) + i cos(theta) + j sin(theta)sin(phi) + +zn+1 = zn^8 +c + +z^8 = r^8 * (sin(8*theta)*cos(8*phi) + i cos(8*theta) + j sin(8*theta)*sin(8*theta) + +zn+1' = 8 * zn^7 * zn' + 1 + +*/ + +vec3 mb(vec3 p) { + p.xyz = p.xzy; + vec3 z = p; + vec3 dz=vec3(0.0); + float power = 8.0; + float r, theta, phi; + float dr = 1.0; + + float t0 = 1.0; + for(int i = 0; i < 7; ++i) { + r = length(z); + if(r > 2.0) continue; + theta = atan(z.y / z.x); + #ifdef phase_shift_on + phi = asin(z.z / r) + iTime*0.1; + #else + phi = asin(z.z / r); + #endif + + dr = pow(r, power - 1.0) * dr * power + 1.0; + + r = pow(r, power); + theta = theta * power; + phi = phi * power; + + z = r * vec3(cos(theta)*cos(phi), sin(theta)*cos(phi), sin(phi)) + p; + + t0 = min(t0, r); + } + return vec3(0.5 * log(r) * r / dr, t0, 0.0); +} + + vec3 f(vec3 p){ + ry(p, iTime*0.2); + return mb(p); + } + + + float softshadow(vec3 ro, vec3 rd, float k ){ + float akuma=1.0,h=0.0; + float t = 0.01; + for(int i=0; i < 50; ++i){ + h=f(ro+rd*t).x; + if(h<0.001)return 0.02; + akuma=min(akuma, k*h/t); + t+=clamp(h,0.01,2.0); + } + return akuma; + } + +vec3 nor( in vec3 pos ) +{ + vec3 eps = vec3(0.001,0.0,0.0); + return normalize( vec3( + f(pos+eps.xyy).x - f(pos-eps.xyy).x, + f(pos+eps.yxy).x - f(pos-eps.yxy).x, + f(pos+eps.yyx).x - f(pos-eps.yyx).x ) ); +} + +vec3 intersect( in vec3 ro, in vec3 rd ) +{ + float t = 1.0; + float res_t = 0.0; + float res_d = 1000.0; + vec3 c, res_c; + float max_error = 1000.0; + float d = 1.0; + float pd = 100.0; + float os = 0.0; + float step = 0.0; + float error = 1000.0; + + for( int i=0; i<48; i++ ) + { + if( error < pixel_size*0.5 || t > 20.0 ) + { + } + else{ // avoid broken shader on windows + + c = f(ro + rd*t); + d = c.x; + + if(d > os) + { + os = 0.4 * d*d/pd; + step = d + os; + pd = d; + } + else + { + step =-os; os = 0.0; pd = 100.0; d = 1.0; + } + + error = d / t; + + if(error < max_error) + { + max_error = error; + res_t = t; + res_c = c; + } + + t += step; + } + + } + if( t>20.0/* || max_error > pixel_size*/ ) res_t=-1.0; + return vec3(res_t, res_c.y, res_c.z); +} + + void mainImage( out vec4 fragColor, in vec2 fragCoord ) + { + vec2 q=fragCoord.xy/iResolution.xy; + vec2 uv = -1.0 + 2.0*q; + uv.x*=iResolution.x/iResolution.y; + + pixel_size = 1.0/(iResolution.x * 3.0); + // camera + stime=0.7+0.3*sin(iTime*0.4); + ctime=0.7+0.3*cos(iTime*0.4); + + vec3 ta=vec3(0.0,0.0,0.0); + vec3 ro = vec3(0.0, 3.*stime*ctime, 3.*(1.-stime*ctime)); + + vec3 cf = normalize(ta-ro); + vec3 cs = normalize(cross(cf,vec3(0.0,1.0,0.0))); + vec3 cu = normalize(cross(cs,cf)); + vec3 rd = normalize(uv.x*cs + uv.y*cu + 3.0*cf); // transform from view to world + + vec3 sundir = normalize(vec3(0.1, 0.8, 0.6)); + vec3 sun = vec3(1.64, 1.27, 0.99); + vec3 skycolor = vec3(0.6, 1.5, 1.0); + + vec3 bg = exp(uv.y-2.0)*vec3(0.4, 1.6, 1.0); + + float halo=clamp(dot(normalize(vec3(-ro.x, -ro.y, -ro.z)), rd), 0.0, 1.0); + vec3 col=bg+vec3(1.0,0.8,0.4)*pow(halo,17.0); + + + float t=0.0; + vec3 p=ro; + + vec3 res = intersect(ro, rd); + if(res.x > 0.0){ + p = ro + res.x * rd; + vec3 n=nor(p); + float shadow = softshadow(p, sundir, 10.0 ); + + float dif = max(0.0, dot(n, sundir)); + float sky = 0.6 + 0.4 * max(0.0, dot(n, vec3(0.0, 1.0, 0.0))); + float bac = max(0.3 + 0.7 * dot(vec3(-sundir.x, -1.0, -sundir.z), n), 0.0); + float spe = max(0.0, pow(clamp(dot(sundir, reflect(rd, n)), 0.0, 1.0), 10.0)); + + vec3 lin = 4.5 * sun * dif * shadow; + lin += 0.8 * bac * sun; + lin += 0.6 * sky * skycolor*shadow; + lin += 3.0 * spe * shadow; + + res.y = pow(clamp(res.y, 0.0, 1.0), 0.55); + vec3 tc0 = 0.5 + 0.5 * sin(3.0 + 4.2 * res.y + vec3(0.0, 0.5, 1.0)); + col = lin *vec3(0.9, 0.8, 0.6) * 0.2 * tc0; + col=mix(col,bg, 1.0-exp(-0.001*res.x*res.x)); + } + + // post + col=pow(clamp(col,0.0,1.0),vec3(0.45)); + col=col*0.6+0.4*col*col*(3.0-2.0*col); // contrast + col=mix(col, vec3(dot(col, vec3(0.33))), -0.5); // satuation + col*=0.5+0.5*pow(16.0*q.x*q.y*(1.0-q.x)*(1.0-q.y),0.7); // vigneting + fragColor = vec4(col.xyz, smoothstep(0.55, .76, 1.-res.x/5.)); + } + +/** SHADERDATA +{ +"title": "mandelbulb", +"author": "evilryu", +"description": "a mandelbulb", +"href": "https://www.shadertoy.com/view/MdXSWn" +} +*/ +` + +const shader02 = ` +// NOTE: https://www.shadertoy.com/view/wt3SWj +float opSmoothUnion( float d1, float d2, float k ) +{ + float h = clamp( 0.876 + 1.284*(d2-d1)/k, 0.112, 2.616 ); + return mix( d2, d1, h ) - k*h*(1.0-h); +} + +float sdSphere( vec3 p, float s ) +{ + return length(p)-s; +} + +float map(vec3 p) +{ + float d = 0.480; + for (int i = 0; i < 16; i++) + { + float fi = float(i); + float time = iTime * (fract(fi * 412.531 + 1.073) - 1.020) * 1.152; + d = opSmoothUnion( + sdSphere(p + sin(time + fi * vec3(52.5126, 64.62744, 632.25)) * vec3(2.0, 2.0, 0.8), mix(0.5, 1.0, fract(fi * 412.531 + 0.5124))), + d, + 0.024 + ); + } + return d; +} + +vec3 calcNormal( in vec3 p ) +{ + const float h = 1e-5; // or some other value + const vec2 k = vec2(1,-1); + return normalize( k.xyy*map( p + k.xyy*h ) + + k.yyx*map( p + k.yyx*h ) + + k.yxy*map( p + k.yxy*h ) + + k.xxx*map( p + k.xxx*h ) ); +} + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + vec2 uv = fragCoord/iResolution.xy; + + // screen size is 6m x 6m + vec3 rayOri = vec3((uv - 0.5) * vec2(iResolution.x/iResolution.y, 0.368) * 6.0, 3.0); + vec3 rayDir = vec3(0.0, 0.0, -1.0); + + float depth = 0.0; + vec3 p; + + for(int i = 0; i < 64; i++) { + p = rayOri + rayDir * depth; + float dist = map(p); + depth += dist; + if (dist < 1e-6) { + break; + } + } + + depth = min(6.0, depth); + vec3 n = calcNormal(p); + float b = max(0.0, dot(n, vec3(0.577))); + vec3 col = (0.5 + 0.5 * cos((b + iTime * 3.0) + uv.xyx * 2.0 + vec3(0,2,4))) * (0.85 + b * 0.35); + col *= exp( -depth * 0.15 ); + + // maximum thickness is 2m in alpha channel + fragColor = vec4(col, 0.0 ); +} + +/** SHADERDATA +{ + "title": "shader2", + "description": "sure", + "model": "nothing" +} +*/ +` + +const raymarchingBasic = ` +// https://www.shadertoy.com/view/Ml2XRD + +float map(vec3 p) { + vec3 n = vec3(0, 1, 0); + float k1 = 1.9; + float k2 = (sin(p.x * k1) + sin(p.z * k1)) * 0.8; + float k3 = (sin(p.y * k1) + sin(p.z * k1)) * 0.8; + float w1 = 4.0 - dot(abs(p), normalize(n)) + k2; + float w2 = 4.0 - dot(abs(p), normalize(n.yzx)) + k3; + float s1 = length(mod(p.xy + vec2(sin((p.z + p.x) * 2.0) * 0.3, cos((p.z + p.x) * 1.0) * 0.5), 2.0) - 1.0) - 0.2; + float s2 = length(mod(0.5+p.yz + vec2(sin((p.z + p.x) * 2.0) * 0.3, cos((p.z + p.x) * 1.0) * 0.3), 2.0) - 1.0) - 0.2; + return min(w1, min(w2, min(s1, s2))); +} + +vec2 rot(vec2 p, float a) { + return vec2( + p.x * cos(a) - p.y * sin(a), + p.x * sin(a) + p.y * cos(a)); +} + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) { + float time = iTime; + vec2 uv = ( fragCoord.xy / iResolution.xy ) * 2.0 - 1.0; + uv.x *= iResolution.x / iResolution.y; + vec3 dir = normalize(vec3(uv, 1.0)); + dir.xz = rot(dir.xz, time * 0.23);dir = dir.yzx; + dir.xz = rot(dir.xz, time * 0.2);dir = dir.yzx; + vec3 pos = vec3(0, 0, time); + vec3 col = vec3(0.0); + float t = 0.0; + float tt = 0.0; + for(int i = 0 ; i < 100; i++) { + tt = map(pos + dir * t); + if(tt < 0.001) break; + t += tt * 0.45; + } + vec3 ip = pos + dir * t; + col = vec3(t * 0.1); + col = sqrt(col); + fragColor = vec4(0.05*t+abs(dir) * col + max(0.0, map(ip - 0.1) - tt), 1.0); //Thanks! Shane! + fragColor.a = 1.0 / (t * t * t * t); +} +` + +const seventiesMelt = ` +// NOTE: https://www.shadertoy.com/view/XsX3zl +#ifdef GL_ES +precision mediump float; +#endif + +const int zoom = 40; +const float brightness = 0.975; +float fScale = 1.25; + +float cosRange(float amt, float range, float minimum) { + return (((1.0 + cos(radians(amt))) * 0.5) * range) + minimum; +} + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + float time = iTime * 1.25; + vec2 uv = fragCoord.xy / iResolution.xy; + vec2 p = (2.0*fragCoord.xy-iResolution.xy)/max(iResolution.x,iResolution.y); + float ct = cosRange(time*5.0, 3.0, 1.1); + float xBoost = cosRange(time*0.2, 5.0, 5.0); + float yBoost = cosRange(time*0.1, 10.0, 5.0); + + fScale = cosRange(time * 15.5, 1.25, 0.5); + + for(int i=1;i0. || temp.y>0.) sn = dbF(sp, sn, .001); + + // Surface color value. + vec3 oC = vec3(1); + + if(fold.x>0.) oC = vec3(1, .05, .1)*c2; // Reddish pink with finer grained Truchet overlay. + + if(fold.x<0.05 && (fold.y)<0.) oC = vec3(1, .7, .45)*(c2*.25 + .75); // Lighter lined borders. + else if(fold.x<0.) oC = vec3(1, .8, .4)*c2; // Gold, with overlay. + + //oC *= n3D(sp*128.)*.35 + .65; // Extra fine grained noisy texturing. + + + // Sending some greenish particle pulses through the snake-like patterns. With all the shininess going + // on, this effect is a little on the subtle side. + float p1 = 1.0 - smoothstep(0., .1, fold.x*.5+.5); // Restrict to the snake-like path. + // Other path. + //float p2 = 1.0 - smoothstep(0., .1, cos(heightMap(sp.xy + 1. + iTime/4.)*6.283)*.5+.5); + float p2 = 1.0 - smoothstep(0., .1, Voronoi(sp.xy*4. + vec2(tm, cos(tm/4.)))); + p1 = (p2 + .25)*p1; // Overlap the paths. + oC += oC.yxz*p1*p1; // Gives a kind of electron effect. Works better with just Voronoi, but it'll do. + + + + + float lDist = max(length(ld), 0.001); // Light distance. + float atten = 1./(1. + lDist*.125); // Light attenuation. + + ld /= lDist; // Normalizing the light direction vector. + + float diff = max(dot(ld, sn), 0.); // Diffuse. + float spec = pow(max( dot( reflect(-ld, sn), -rd ), 0.0 ), 16.); // Specular. + float fre = pow(clamp(dot(sn, rd) + 1., .0, 1.), 3.); // Fresnel, for some mild glow. + + // Shading. Note, there are no actual shadows. The camera is front on, so the following + // two functions are enough to give a shadowy appearance. + crv = crv*.9 + .1; // Curvature value, to darken the crevices. + float ao = calculateAO(sp, sn); // Ambient occlusion, for self shadowing. + + + + // Combining the terms above to light the texel. + vec3 col = oC*(diff + .5) + vec3(1., .7, .4)*spec*2. + vec3(.4, .7, 1)*fre; + + col += (oC*.5+.5)*envMap(reflect(rd, sn), sn)*6.; // Fake environment mapping. + + + // Edges. + col *= 1. - edge*.85; // Darker edges. + + // Applying the shades. + col *= (atten*crv*ao); + + + // Rough gamma correction, then present to the screen. + fragColor = vec4(sqrt(clamp(col, 0., 1.)), col.r); +} +` + +const octgrams = ` +// Source: https://www.shadertoy.com/view/tlVGDt +precision highp float; + + +float gTime = 0.; +const float REPEAT = 5.0; + +// 回転行列 +mat2 rot(float a) { + float c = cos(a), s = sin(a); + return mat2(c,s,-s,c); +} + +float sdBox( vec3 p, vec3 b ) +{ + vec3 q = abs(p) - b; + return length(max(q,0.0)) + min(max(q.x,max(q.y,q.z)),0.0); +} + +float box(vec3 pos, float scale) { + pos *= scale; + float base = sdBox(pos, vec3(.4,.4,.1)) /1.5; + pos.xy *= 5.; + pos.y -= 3.5; + pos.xy *= rot(.75); + float result = -base; + return result; +} + +float box_set(vec3 pos, float iTime) { + vec3 pos_origin = pos; + pos = pos_origin; + pos .y += sin(gTime * 0.4) * 2.5; + pos.xy *= rot(.8); + float box1 = box(pos,2. - abs(sin(gTime * 0.4)) * 1.5); + pos = pos_origin; + pos .y -=sin(gTime * 0.4) * 2.5; + pos.xy *= rot(.8); + float box2 = box(pos,2. - abs(sin(gTime * 0.4)) * 1.5); + pos = pos_origin; + pos .x +=sin(gTime * 0.4) * 2.5; + pos.xy *= rot(.8); + float box3 = box(pos,2. - abs(sin(gTime * 0.4)) * 1.5); + pos = pos_origin; + pos .x -=sin(gTime * 0.4) * 2.5; + pos.xy *= rot(.8); + float box4 = box(pos,2. - abs(sin(gTime * 0.4)) * 1.5); + pos = pos_origin; + pos.xy *= rot(.8); + float box5 = box(pos,.5) * 6.; + pos = pos_origin; + float box6 = box(pos,.5) * 6.; + float result = max(max(max(max(max(box1,box2),box3),box4),box5),box6); + return result; +} + +float map(vec3 pos, float iTime) { + vec3 pos_origin = pos; + float box_set1 = box_set(pos, iTime); + + return box_set1; +} + + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) { + vec2 p = (fragCoord.xy * 2. - iResolution.xy) / min(iResolution.x, iResolution.y); + vec3 ro = vec3(0., -0.2 ,iTime * 4.); + vec3 ray = normalize(vec3(p, 1.5)); + ray.xy = ray.xy * rot(sin(iTime * .03) * 5.); + ray.yz = ray.yz * rot(sin(iTime * .05) * .2); + float t = 0.1; + vec3 col = vec3(0.); + float ac = 0.0; + + + for (int i = 0; i < 99; i++){ + vec3 pos = ro + ray * t; + pos = mod(pos-2., 4.) -2.; + gTime = iTime -float(i) * 0.01; + + float d = map(pos, iTime); + + d = max(abs(d), 0.01); + ac += exp(-d*23.); + + t += d* 0.55; + } + + col = vec3(ac * 0.02); + + col +=vec3(0.,0.2 * abs(sin(iTime)),0.5 + sin(iTime) * 0.2); + + + fragColor = vec4(col ,1.0 - t * (0.02 + 0.02 * sin (iTime))); +} + +/** SHADERDATA +{ + "title": "Octgrams", + "author": "whisky_shusuky", + "description": "Inspired by arabesque.", + "href": "https://www.shadertoy.com/view/tlVGDt", + "model": "person" +} +*/ +` +export const mainImage = gamesOfSinus + +export const shaderToySrc = { + gamesOfSinus, + tiles, + star, + fractalPyramid, + mandelbulb, + shader02, + rainbow, + prettyHip, + raymarchingBasic, + unyo, + seventiesMelt, + sinusoidalTresJS, + sinusoidalTresJS2, + truchet, + octgrams, +} as const \ No newline at end of file diff --git a/components/content/shadertoy-museum/index.vue b/components/content/shadertoy-museum/index.vue new file mode 100644 index 0000000..c3138a8 --- /dev/null +++ b/components/content/shadertoy-museum/index.vue @@ -0,0 +1,71 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/components/content/shadertoy-museum/meshReflectionMaterial/BlurPass.ts b/components/content/shadertoy-museum/meshReflectionMaterial/BlurPass.ts new file mode 100644 index 0000000..8d3f2de --- /dev/null +++ b/components/content/shadertoy-museum/meshReflectionMaterial/BlurPass.ts @@ -0,0 +1,134 @@ +/* +Adapted from Drei BlurPass +https://github.com/pmndrs/drei/blob/master/ + +MIT License + +Copyright (c) 2020 react-spring + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +import { + BufferAttribute, + BufferGeometry, + Camera, + HalfFloatType, + LinearFilter, + Mesh, + Scene, + Vector2, + WebGLRenderTarget, +} from 'three' +import type { Material, WebGLRenderer } from 'three' + +import { ConvolutionMaterial } from './ConvolutionMaterial' + +export interface BlurPassProps { + resolution: number + width?: number + height?: number + depthEdge0?: number + depthEdge1?: number + depthScale?: number + depthBias?: number +} + +export class BlurPass { + readonly renderTargetA: WebGLRenderTarget + readonly renderTargetB: WebGLRenderTarget + readonly convolutionMaterial: ConvolutionMaterial + readonly scene: Scene + readonly camera: Camera + readonly screen: Mesh + renderToScreen: boolean = false + + constructor({ + resolution, + width = 500, + height = 500, + depthEdge0 = 0, + depthEdge1 = 1, + depthScale = 0, + depthBias = 0.25, + }: BlurPassProps) { + this.renderTargetA = new WebGLRenderTarget(resolution, resolution, { + minFilter: LinearFilter, + magFilter: LinearFilter, + stencilBuffer: false, + depthBuffer: false, + type: HalfFloatType, + }) + this.renderTargetB = this.renderTargetA.clone() + this.convolutionMaterial = new ConvolutionMaterial() + this.convolutionMaterial.setTexelSize(1.0 / width, 1.0 / height) + this.convolutionMaterial.setResolution(new Vector2(width, height)) + this.scene = new Scene() + this.camera = new Camera() + this.convolutionMaterial.uniforms.depthEdge0.value = depthEdge0 + this.convolutionMaterial.uniforms.depthEdge1.value = depthEdge1 + this.convolutionMaterial.uniforms.depthScale.value = depthScale + this.convolutionMaterial.uniforms.depthBias.value = depthBias + this.convolutionMaterial.defines.USE_DEPTH = depthScale > 0 + const vertices = new Float32Array([-1, -1, 0, 3, -1, 0, -1, 3, 0]) + const uvs = new Float32Array([0, 0, 2, 0, 0, 2]) + const geometry = new BufferGeometry() + geometry.setAttribute('position', new BufferAttribute(vertices, 3)) + geometry.setAttribute('uv', new BufferAttribute(uvs, 2)) + this.screen = new Mesh(geometry, this.convolutionMaterial) + this.screen.frustumCulled = false + this.scene.add(this.screen) + } + + render(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, outputBuffer: WebGLRenderTarget) { + const scene = this.scene + const camera = this.camera + const renderTargetA = this.renderTargetA + const renderTargetB = this.renderTargetB + const material = this.convolutionMaterial + const uniforms = material.uniforms + uniforms.depthBuffer.value = inputBuffer.depthTexture + const kernel = material.kernel + let lastRT = inputBuffer + let destRT + let i, l + // Apply the multi-pass blur. + for (i = 0, l = kernel.length - 1; i < l; ++i) { + // Alternate between targets. + destRT = (i & 1) === 0 ? renderTargetA : renderTargetB + uniforms.kernel.value = kernel[i] + uniforms.inputBuffer.value = lastRT.texture + renderer.setRenderTarget(destRT) + renderer.render(scene, camera) + lastRT = destRT + } + uniforms.kernel.value = kernel[i] + uniforms.inputBuffer.value = lastRT.texture + renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer) + renderer.render(scene, camera) + } + + dispose() { + (this.screen.material as Material).dispose() + this.screen.geometry.dispose() + this.renderTargetA.dispose() + this.renderTargetB.dispose() + this.convolutionMaterial.dispose() + } +} diff --git a/components/content/shadertoy-museum/meshReflectionMaterial/ConvolutionMaterial.ts b/components/content/shadertoy-museum/meshReflectionMaterial/ConvolutionMaterial.ts new file mode 100644 index 0000000..bc4bddf --- /dev/null +++ b/components/content/shadertoy-museum/meshReflectionMaterial/ConvolutionMaterial.ts @@ -0,0 +1,128 @@ +/* +Adapted from Drei ConvolutionMaterial +https://github.com/pmndrs/drei/blob/master/ + +MIT License + +Copyright (c) 2020 react-spring + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +import { NoBlending, ShaderMaterial, Uniform, Vector2 } from 'three' + +export class ConvolutionMaterial extends ShaderMaterial { + readonly kernel: Float32Array + constructor(texelSize = new Vector2()) { + super({ + uniforms: { + inputBuffer: new Uniform(null), + depthBuffer: new Uniform(null), + resolution: new Uniform(new Vector2()), + texelSize: new Uniform(new Vector2()), + halfTexelSize: new Uniform(new Vector2()), + kernel: new Uniform(0.0), + scale: new Uniform(1.0), + cameraNear: new Uniform(0.0), + cameraFar: new Uniform(1.0), + depthEdge0: new Uniform(0.0), + depthEdge1: new Uniform(1.0), + depthScale: new Uniform(0.0), + depthBias: new Uniform(0.25), + }, + fragmentShader: `#include + #include + uniform sampler2D inputBuffer; + uniform sampler2D depthBuffer; + uniform float cameraNear; + uniform float cameraFar; + uniform float depthEdge0; + uniform float depthEdge1; + uniform float depthScale; + uniform float depthBias; + varying vec2 vUv; + varying vec2 vUv0; + varying vec2 vUv1; + varying vec2 vUv2; + varying vec2 vUv3; + + void main() { + float depthFactor = 0.0; + + #ifdef USE_DEPTH + vec4 depth = texture2D(depthBuffer, vUv); + depthFactor = smoothstep( + 1.0 - depthEdge1, 1.0 - depthEdge0, + 1.0 - (depth.r * depth.a) + depthBias + ); + depthFactor = clamp(depthScale * depthFactor + 0.25, 0.0, 1.0); + #endif + + gl_FragColor = 0.25 * ( + texture2D(inputBuffer, mix(vUv0, vUv, depthFactor)) + + texture2D(inputBuffer, mix(vUv1, vUv, depthFactor)) + + texture2D(inputBuffer, mix(vUv2, vUv, depthFactor)) + + texture2D(inputBuffer, mix(vUv3, vUv, depthFactor)) + ); + + #include + #include + #include + }`, + vertexShader: `uniform vec2 texelSize; + uniform vec2 halfTexelSize; + uniform float kernel; + uniform float scale; + varying vec2 vUv; + varying vec2 vUv0; + varying vec2 vUv1; + varying vec2 vUv2; + varying vec2 vUv3; + + void main() { + vec2 uv = position.xy * 0.5 + 0.5; + vUv = uv; + + vec2 dUv = (texelSize * vec2(kernel) + halfTexelSize) * scale; + vUv0 = vec2(uv.x - dUv.x, uv.y + dUv.y); + vUv1 = vec2(uv.x + dUv.x, uv.y + dUv.y); + vUv2 = vec2(uv.x + dUv.x, uv.y - dUv.y); + vUv3 = vec2(uv.x - dUv.x, uv.y - dUv.y); + + gl_Position = vec4(position.xy, 1.0, 1.0); + }`, + blending: NoBlending, + depthWrite: false, + depthTest: false, + }) + + this.toneMapped = false + this.setTexelSize(texelSize.x, texelSize.y) + this.kernel = new Float32Array([0.0, 1.0, 2.0, 2.0, 3.0]) + } + + setTexelSize(x: number, y: number) { + this.uniforms.texelSize.value.set(x, y) + this.uniforms.halfTexelSize.value.set(x, y).multiplyScalar(0.5) + } + + setResolution(resolution: Vector2) { + this.uniforms.resolution.value.copy(resolution) + } +} diff --git a/components/content/shadertoy-museum/meshReflectionMaterial/index.vue b/components/content/shadertoy-museum/meshReflectionMaterial/index.vue new file mode 100644 index 0000000..1b2ca9f --- /dev/null +++ b/components/content/shadertoy-museum/meshReflectionMaterial/index.vue @@ -0,0 +1,389 @@ + + + + + + diff --git a/components/content/shadertoy-museum/meshReflectionMaterial/material.ts b/components/content/shadertoy-museum/meshReflectionMaterial/material.ts new file mode 100644 index 0000000..ca6c1ff --- /dev/null +++ b/components/content/shadertoy-museum/meshReflectionMaterial/material.ts @@ -0,0 +1,307 @@ +/* +Inspired by and adapted from MeshReflectorMaterial +https://github.com/pmndrs/drei/blob/master/src/materials/MeshReflectorMaterial.tsx + +MIT License + +Copyright (c) 2020 react-spring + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +import { MeshStandardMaterial } from 'three' +import type { Matrix4, Texture } from 'three' + +interface UninitializedUniform { value: Value | null } + +export class MeshReflectionMaterial extends MeshStandardMaterial { + private _tDepth: UninitializedUniform = { value: null } + private _distortionMap: UninitializedUniform = { value: null } + private _tSharp: UninitializedUniform = { value: null } + private _tBlur: UninitializedUniform = { value: null } + private _textureMatrix: UninitializedUniform = { value: null } + private _mix: { value: number } = { value: 0.5 } + private _sharpMix: { value: number } = { value: 0.0 } + private _blurMixSmooth: { value: number } = { value: 0.0 } + private _blurMixRough: { value: number } = { value: 0.0 } + private _sharpDepthEdgeMin: { value: number } = { value: 0.9 } + private _sharpDepthEdgeMax: { value: number } = { value: 1 } + private _sharpDepthScale: { value: number } = { value: 0 } + private _sharpDepthBias: { value: number } = { value: 0 } + private _distortion: { value: number } = { value: 1 } + + constructor(parameters = {}) { + super(parameters) + this.setValues(parameters) + } + + onBeforeCompile(shader: any) { + if (!shader.defines?.USE_UV) { + shader.defines.USE_UV = '' + } + // NOTE: Start #605 fix + // Tres lowercases pierced props. As a result, a component + // can't set "defines", which are written in ALL_CAPS by + // convention in the Three.js codebase. + // + // Issue: https://github.com/Tresjs/tres/issues/605 + // + // A fix has been merged into TresJS v4: + // https://github.com/Tresjs/tres/pull/608 + // + // TODO: This code can be removed for TresJS v4. + // + // Workaround: UPPER_CASE all defines + for (const key of Object.keys(shader.defines)) { + shader.defines[key.toUpperCase()] = shader.defines[key] + } + // NOTE: End #605 fix + + shader.uniforms.tSharp = this._tSharp + shader.uniforms.tDepth = this._tDepth + shader.uniforms.tBlur = this._tBlur + shader.uniforms.distortionMap = this._distortionMap + shader.uniforms.textureMatrix = this._textureMatrix + shader.uniforms.mixMain = this._mix + + shader.uniforms.sharpMix = this._sharpMix + shader.uniforms.sharpDepthScale = this._sharpDepthScale + shader.uniforms.sharpDepthEdgeMin = this._sharpDepthEdgeMin + shader.uniforms.sharpDepthEdgeMax = this._sharpDepthEdgeMax + shader.uniforms.sharpDepthBias = this._sharpDepthBias + + shader.uniforms.blurMixSmooth = this._blurMixSmooth + shader.uniforms.blurMixRough = this._blurMixRough + + shader.uniforms.distortion = this._distortion + + shader.vertexShader = ` + uniform mat4 textureMatrix; + varying vec4 my_vUv; + ${shader.vertexShader}` + shader.vertexShader = shader.vertexShader.replace( + '#include ', + `#include + my_vUv = textureMatrix * vec4( position, 1.0 ); + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );`, + ) + shader.fragmentShader = ` + uniform sampler2D tSharp; + uniform sampler2D tBlur; + uniform sampler2D tDepth; + uniform sampler2D distortionMap; + uniform float distortion; + uniform float cameraNear; + uniform float cameraFar; + uniform float mixMain; + uniform float sharpMix; + uniform float blurMixSmooth; + uniform float blurMixRough; + uniform float sharpDepthScale; + uniform float sharpDepthBias; + uniform float sharpDepthEdgeMin; + uniform float sharpDepthEdgeMax; + varying vec4 my_vUv; + ${shader.fragmentShader}` + shader.fragmentShader = shader.fragmentShader.replace( + '#include ', + `#include + + vec4 new_vUv = my_vUv; + + #ifdef USE_DISTORTION + float distortionFactor = (texture(distortionMap, vUv).r - 0.5) * distortion; + new_vUv.x += distortionFactor; + new_vUv.y += distortionFactor; + #endif + + #ifdef USE_NORMALMAP + + vec4 normalColor = texture(normalMap, vUv * normalScale); + vec3 my_normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) ); + vec3 coord = new_vUv.xyz / new_vUv.w; + vec2 normal_uv = coord.xy + coord.z * my_normal.xz * 0.05; + + vec4 sharp = texture(tSharp, normal_uv); + + #ifdef USE_BLUR + vec4 blur = texture(tBlur, normal_uv); + #endif + + #ifdef USE_DEPTH + vec4 depth = texture(tDepth, normal_uv); + #endif + + #else + + vec4 sharp = textureProj(tSharp, new_vUv); + + #ifdef USE_BLUR + vec4 blur = textureProj(tBlur, new_vUv); + #endif + + #ifdef USE_DEPTH + vec4 depth = textureProj(tDepth, new_vUv); + #endif + + #endif + + #ifdef USE_DEPTH + float depthFactor = smoothstep( + 1.0 - sharpDepthEdgeMax, 1.0 - sharpDepthEdgeMin, + 1.0 - (depth.r * depth.a) + sharpDepthBias + ); + depthFactor = clamp(sharpDepthScale * depthFactor, 0.0, 1.0); + + sharp *= depthFactor; + #endif + + sharp *= (1.0 - roughnessFactor); + `, + ) + shader.fragmentShader = shader.fragmentShader.replace( + '#include ', + ` + + #ifdef USE_BLUR + outgoingLight += mixMain * ( + vec3(sharp) * sharpMix + + vec3(blur) * (blurMixSmooth * (1.0 - roughnessFactor) + blurMixRough * roughnessFactor) + ); + #else + outgoingLight += mixMain * vec3(sharp) * sharpMix; + #endif + + #include + `, + ) + } + + get tSharp(): Texture | null { + return this._tSharp.value + } + + set tSharp(v: Texture | null) { + this._tSharp.value = v + } + + get tDepth(): Texture | null { + return this._tDepth.value + } + + set tDepth(v: Texture | null) { + this._tDepth.value = v + } + + get distortionMap(): Texture | null { + return this._distortionMap.value + } + + set distortionMap(v: Texture | null) { + this._distortionMap.value = v + } + + get tBlur(): Texture | null { + return this._tBlur.value + } + + set tBlur(v: Texture | null) { + this._tBlur.value = v + } + + get textureMatrix(): Matrix4 | null { + return this._textureMatrix.value + } + + set textureMatrix(v: Matrix4 | null) { + this._textureMatrix.value = v + } + + get sharpMix(): number { + return this._sharpMix.value + } + + set sharpMix(v: number) { + this._sharpMix.value = v + } + + get blurMixSmooth(): number { + return this._blurMixSmooth.value + } + + set blurMixSmooth(v: number) { + this._blurMixSmooth.value = v + } + + get blurMixRough(): number { + return this._blurMixRough.value + } + + set blurMixRough(v: number) { + this._blurMixRough.value = v + } + + get mix(): number { + return this._mix.value + } + + set mix(v: number) { + this._mix.value = v + } + + get sharpDepthScale(): number { + return this._sharpDepthScale.value + } + + set sharpDepthScale(v: number) { + this._sharpDepthScale.value = v + } + + get sharpDepthBias(): number { + return this._sharpDepthBias.value + } + + set sharpDepthBias(v: number) { + this._sharpDepthBias.value = v + } + + get sharpDepthEdgeMin(): number { + return this._sharpDepthEdgeMin.value + } + + set sharpDepthEdgeMin(v: number) { + this._sharpDepthEdgeMin.value = v + } + + get sharpDepthEdgeMax(): number { + return this._sharpDepthEdgeMax.value + } + + set sharpDepthEdgeMax(v: number) { + this._sharpDepthEdgeMax.value = v + } + + get distortion(): number { + return this._distortion.value + } + + set distortion(v: number) { + this._distortion.value = v + } +} diff --git a/content/experiments/shadertoy-museum.md b/content/experiments/shadertoy-museum.md new file mode 100644 index 0000000..6fb2a3e --- /dev/null +++ b/content/experiments/shadertoy-museum.md @@ -0,0 +1,8 @@ +--- +author: andretchen0 +description: A gallery of ShaderToy examples, inspired by cineshader.com +tags: ['shader', 'post-processing'] +--- + +::shadertoy-museum +:: diff --git a/public/models/shadertoy-museum/gallery.glb b/public/models/shadertoy-museum/gallery.glb new file mode 100644 index 0000000..5dde97b Binary files /dev/null and b/public/models/shadertoy-museum/gallery.glb differ diff --git a/public/models/shadertoy-museum/gallery.gltf b/public/models/shadertoy-museum/gallery.gltf new file mode 100644 index 0000000..f88d827 --- /dev/null +++ b/public/models/shadertoy-museum/gallery.gltf @@ -0,0 +1,3219 @@ +{ + "asset":{ + "generator":"Khronos glTF Blender I/O v4.2.69", + "version":"2.0" + }, + "extensionsUsed":[ + "KHR_materials_specular", + "KHR_lights_punctual" + ], + "extensionsRequired":[ + "KHR_lights_punctual" + ], + "extensions":{ + "KHR_lights_punctual":{ + "lights":[ + { + "color":[ + 0.045185185968875885, + 0.341914564371109, + 0.8227861523628235 + ], + "intensity":54.35141306588226, + "type":"point", + "range":300, + "name":"Point.012" + }, + { + "color":[ + 0.7230502963066101, + 0.7230556607246399, + 1 + ], + "intensity":54.35141306588226, + "type":"point", + "name":"Point.004", + "extras":{ + "x":"{\"speed\":0.001, \"dist\": 0.01, \"phase\": 1}", + "y":"{\"speed\":0.0013, \"dist\": 0.01, \"phase\": 1}", + "z":"{\"speed\":0.001, \"dist\": 0.01, \"phase\": 1}", + "intensity":"{\"a\":5, \"b\":10, \"speed\": 0.001}" + } + }, + { + "color":[ + 0.7230502963066101, + 0.7230556607246399, + 1 + ], + "intensity":54.35141306588226, + "type":"point", + "name":"Point.010", + "extras":{ + "x":"{\"speed\":0.001, \"dist\": 0.01, \"phase\": 1}", + "y":"{\"speed\":0.0013, \"dist\": 0.01, \"phase\": 1}", + "z":"{\"speed\":0.0009, \"dist\": 0.02, \"phase\": 1}", + "intensity":"{\"a\":5, \"b\":10, \"speed\": 0.0001}" + } + }, + { + "color":[ + 0.07618440687656403, + 0.371238112449646, + 0.46778398752212524 + ], + "intensity":271.7570653294113, + "type":"point", + "name":"Point.011", + "extras":{ + "x":"{\"speed\":0.001, \"dist\": 0.01, \"phase\": 1}", + "y":"{\"speed\":0.0013, \"dist\": 0.01, \"phase\": 1}", + "z":"{\"speed\":0.001, \"dist\": 0.01, \"phase\": 1}", + "intensity":"{\"a\":5, \"b\":10, \"speed\": 0.0001}" + } + }, + { + "color":[ + 0.7230502963066101, + 0.7230556607246399, + 1 + ], + "intensity":54.35141306588226, + "type":"point", + "name":"Point.014" + }, + { + "color":[ + 0.045185185968875885, + 0.341914564371109, + 0.8227861523628235 + ], + "intensity":54351.41306588226, + "type":"point", + "range":10, + "name":"Point.016", + "extras":{ + "x":"{\"speed\":0.001, \"dist\": 0.01, \"phase\": 1}", + "y":"{\"speed\":0.0013, \"dist\": 0.01, \"phase\": 1}", + "z":"{\"speed\":0.001, \"dist\": 0.01, \"phase\": 1}", + "intensity":"{\"a\":55, \"b\":10, \"speed\": 0.0001}" + } + }, + { + "color":[ + 0.7304567694664001, + 0.03310443088412285, + 0.7758224606513977 + ], + "intensity":543514.1306588226, + "type":"point", + "name":"Point.015", + "extras":{ + "x":"{\"speed\":0.001, \"dist\": 0.01, \"phase\": 1}", + "y":"{\"speed\":0.0013, \"dist\": 0.01, \"phase\": 1}", + "z":"{\"speed\":0.001, \"dist\": 0.01, \"phase\": 1}", + "intensity":"{\"a\":55, \"b\":10, \"speed\": 0.0001}" + } + } + ] + } + }, + "scene":0, + "scenes":[ + { + "name":"Scene", + "nodes":[ + 1, + 2, + 8, + 10, + 12, + 17, + 18, + 19, + 24, + 30, + 39, + 40, + 41, + 47, + 48, + 49 + ] + } + ], + "nodes":[ + { + "mesh":0, + "name":"Room.001", + "rotation":[ + 0, + 0.7071068286895752, + 0, + 0.7071068286895752 + ], + "scale":[ + 0.6096451878547668, + 0.18325558304786682, + 0.18325558304786682 + ], + "translation":[ + 0, + -0.31992894411087036, + -0.0031209690496325493 + ] + }, + { + "children":[ + 0 + ], + "mesh":1, + "name":"Cube.005", + "rotation":[ + 0, + -1, + 0, + 1.6292068494294654e-07 + ], + "scale":[ + 5.456860065460205, + 5.456860065460205, + 1.6402982473373413 + ], + "translation":[ + -5.04979133605957, + 1.8260504007339478, + 2.7964589595794678 + ] + }, + { + "name":"railing", + "translation":[ + -7.055902481079102, + 0.3411088287830353, + -0.12300610542297363 + ] + }, + { + "mesh":2, + "name":"Renderbot-human-obj-1250", + "rotation":[ + 0.5000001788139343, + -0.4999998211860657, + 0.5, + 0.5000000596046448 + ], + "scale":[ + 0.008850742131471634, + 0.008850742131471634, + 0.008850742131471634 + ], + "translation":[ + -33.478126525878906, + 4.08950138092041, + -2.575648784637451 + ] + }, + { + "mesh":3, + "name":"Renderbot-human-obj-237.001", + "rotation":[ + 0.7032331228256226, + 0.07391275465488434, + -0.07391275465488434, + 0.7032332420349121 + ], + "scale":[ + 0.008850742131471634, + 0.008850742131471634, + 0.008850742131471634 + ], + "translation":[ + -5.423603534698486, + 0.12343864142894745, + -1.0577911138534546 + ] + }, + { + "mesh":4, + "name":"Renderbot-human-obj-947.001", + "rotation":[ + 0.07808741182088852, + -0.7027819156646729, + 0.7027818560600281, + 0.07808741927146912 + ], + "scale":[ + 0.008850742131471634, + 0.008850742131471634, + 0.008850742131471634 + ], + "translation":[ + -11.380916595458984, + 4.259330749511719, + -10.557156562805176 + ] + }, + { + "mesh":5, + "name":"Renderbot-human-obj-960", + "rotation":[ + 0.6827879548072815, + 0.1838495135307312, + -0.18384949862957, + 0.6827880144119263 + ], + "scale":[ + 0.008850742131471634, + 0.008850742131471634, + 0.008850742131471634 + ], + "translation":[ + -6.07179594039917, + 0.09675943851470947, + -0.8034083843231201 + ] + }, + { + "mesh":6, + "name":"Renderbot-human-obj-960.001", + "rotation":[ + -0.3420540690422058, + 0.6188691258430481, + 0.6188692450523376, + 0.3420540690422058 + ], + "scale":[ + -0.008851000107824802, + -0.008850742131471634, + -0.008850742131471634 + ], + "translation":[ + -14.994315147399902, + 1.0594570636749268, + -0.535040020942688 + ] + }, + { + "children":[ + 3, + 4, + 5, + 6, + 7 + ], + "name":"Humans", + "translation":[ + 0, + 0, + 2.143202066421509 + ] + }, + { + "mesh":7, + "name":"Room.002", + "rotation":[ + 0, + 0.7071068286895752, + 0, + 0.7071068286895752 + ], + "scale":[ + 0.6096452474594116, + 0.18325559794902802, + 0.18325559794902802 + ], + "translation":[ + 0, + -0.3199288845062256, + -0.003121376736089587 + ] + }, + { + "children":[ + 9 + ], + "mesh":8, + "name":"Cube.002", + "rotation":[ + 0, + -0.7071068286895752, + 0, + 0.7071068286895752 + ], + "scale":[ + 12.115452766418457, + 12.115452766418457, + 3.6418297290802 + ], + "translation":[ + -39.357330322265625, + 7.784059524536133, + -0.22553355991840363 + ] + }, + { + "mesh":9, + "name":"Room.003", + "rotation":[ + 0, + 0.7071068286895752, + 0, + 0.7071068286895752 + ], + "scale":[ + 0.6096452474594116, + 0.18325558304786682, + 0.18325558304786682 + ], + "translation":[ + 0, + -0.31992894411087036, + -0.0031211001332849264 + ] + }, + { + "children":[ + 11 + ], + "mesh":10, + "name":"Cube.003", + "rotation":[ + 0, + -1, + 0, + 1.6292068494294654e-07 + ], + "scale":[ + 35.51914596557617, + 5.456860065460205, + 1.6402982473373413 + ], + "translation":[ + -15.790966033935547, + 5.61622953414917, + -10.082728385925293 + ] + }, + { + "camera":0, + "name":"Camera.003", + "translation":[ + -0.09494625777006149, + -1.11614990234375, + 8.01871109008789 + ] + }, + { + "mesh":11, + "name":"Floor", + "rotation":[ + -0.7071068286895752, + 0, + 0, + 0.7071068286895752 + ], + "scale":[ + 6.460000038146973, + 12, + 1 + ], + "translation":[ + 0, + -2.0432186126708984, + 7.295070648193359 + ] + }, + { + "extensions":{ + "KHR_lights_punctual":{ + "light":0 + } + }, + "name":"Point.006", + "rotation":[ + -0.7071068286895752, + 0, + 0, + 0.7071068286895752 + ], + "scale":[ + 0.1471872627735138, + 1, + 1 + ], + "translation":[ + 0.08722400665283203, + -0.33622264862060547, + -0.024529453366994858 + ] + }, + { + "mesh":12, + "name":"Target", + "translation":[ + 0, + -1.7034294605255127, + 0 + ] + }, + { + "children":[ + 13, + 14, + 15, + 16 + ], + "extras":{ + "name":"sinusoidalTresJS2" + }, + "name":"ShaderToy.004", + "rotation":[ + 0, + 0.7071068286895752, + 0, + 0.7071068286895752 + ], + "translation":[ + -15, + 2.1351475715637207, + 0 + ] + }, + { + "mesh":13, + "name":"Stairs", + "rotation":[ + -0.70710688829422, + 0, + -0.7071066498756409, + 2.513689594252355e-07 + ], + "scale":[ + 1.6588150262832642, + 1.3472731113433838, + 1.3472731113433838 + ], + "translation":[ + -20.150421142578125, + 4.186944961547852, + 0.000762939453125 + ] + }, + { + "mesh":14, + "name":"Cube" + }, + { + "camera":1, + "name":"Camera.002", + "rotation":[ + 0, + 1, + 0, + 1.696310619081487e-06 + ], + "scale":[ + 0.10244525223970413, + 0.6960197687149048, + 0.69601970911026 + ], + "translation":[ + -0.23946332931518555, + -0.47129619121551514, + -3.4978716373443604 + ] + }, + { + "mesh":15, + "name":"Floor.001", + "rotation":[ + -0.7071068286895752, + 0, + 0, + 0.7071068286895752 + ], + "scale":[ + 12, + 12, + 1 + ], + "translation":[ + 0, + -1.5677417516708374, + -5.134047508239746 + ] + }, + { + "extensions":{ + "KHR_lights_punctual":{ + "light":1 + } + }, + "name":"Point.004", + "rotation":[ + 0, + 0.7071068286895752, + 0.7071068286895752, + 2.3480765776184853e-06 + ], + "scale":[ + 0.1471872627735138, + 1, + 1 + ], + "translation":[ + 0.27020931243896484, + 0.08825838565826416, + 0.15838980674743652 + ] + }, + { + "mesh":16, + "name":"Target.001", + "scale":[ + 2.0399999618530273, + 2.5399997234344482, + 1 + ], + "translation":[ + 0.0621037483215332, + 0.18515360355377197, + 0 + ] + }, + { + "children":[ + 20, + 21, + 22, + 23 + ], + "extras":{ + "name":"octgrams" + }, + "name":"ShaderToy.000", + "translation":[ + -5.105712890625, + 1.6606000661849976, + 2.6873791217803955 + ] + }, + { + "camera":2, + "name":"Camera.005", + "rotation":[ + 0, + 0.9999606609344482, + 0, + 0.008878372609615326 + ], + "scale":[ + 0.10250584036111832, + 0.6960197687149048, + 0.6960107684135437 + ], + "translation":[ + 0.8091155290603638, + 1.6974177360534668, + -29.90185546875 + ] + }, + { + "mesh":17, + "name":"Floor.002", + "rotation":[ + -0.7071068286895752, + 0, + 0, + 0.7071068286895752 + ], + "scale":[ + 12.720001220703125, + 16.619998931884766, + 1 + ], + "translation":[ + 0.06757508963346481, + -1.4877362251281738, + -8.554046630859375 + ] + }, + { + "extensions":{ + "KHR_lights_punctual":{ + "light":2 + } + }, + "name":"Point.001", + "rotation":[ + -0.49999916553497314, + -0.5000008344650269, + -0.5000008940696716, + 0.49999916553497314 + ], + "scale":[ + 0.1471872627735138, + 1, + 1 + ], + "translation":[ + 0.6446093320846558, + 3.3281164169311523, + -13.99072265625 + ] + }, + { + "extensions":{ + "KHR_lights_punctual":{ + "light":3 + } + }, + "name":"Point.005", + "rotation":[ + -0.49999916553497314, + -0.5000008344650269, + -0.5000008940696716, + 0.49999916553497314 + ], + "scale":[ + 0.1471872627735138, + 1, + 1 + ], + "translation":[ + 0.6446093320846558, + 3.3281164169311523, + -10.140146255493164 + ] + }, + { + "mesh":18, + "name":"Target.002", + "scale":[ + 9, + 9.15999984741211, + 1 + ], + "translation":[ + 0, + 3.4538040161132812, + 0 + ] + }, + { + "children":[ + 25, + 26, + 27, + 28, + 29 + ], + "extras":{ + "name":"mandelbulb" + }, + "name":"ShaderToy.002", + "rotation":[ + 0, + -0.7071068286895752, + 0, + 0.7071068286895752 + ], + "translation":[ + -39.202091217041016, + 5.674603462219238, + -0.8609132766723633 + ] + }, + { + "camera":3, + "name":"Camera.006", + "rotation":[ + 0, + 0.7071055769920349, + 0, + 0.7071079611778259 + ], + "scale":[ + 0.6960198283195496, + 0.6960197687149048, + 0.10244523733854294 + ], + "translation":[ + 6.132008075714111, + 0.5869545936584473, + -0.09698186069726944 + ] + }, + { + "mesh":19, + "name":"Cube.001", + "translation":[ + 4.839295864105225, + 0.13288164138793945, + -0.863150954246521 + ] + }, + { + "mesh":20, + "name":"Cube.004", + "translation":[ + 4.839295864105225, + 0.13288164138793945, + -0.1130741760134697 + ] + }, + { + "mesh":21, + "name":"Floor.003", + "rotation":[ + -0.7071068286895752, + 0, + 0, + 0.7071068286895752 + ], + "scale":[ + 8, + 8, + 1 + ], + "translation":[ + 1.7318005561828613, + -0.39148473739624023, + -0.1318594515323639 + ] + }, + { + "extensions":{ + "KHR_lights_punctual":{ + "light":4 + } + }, + "name":"Point.002", + "rotation":[ + 0, + 0.7071068286895752, + 0.7071068286895752, + 2.3480765776184853e-06 + ], + "scale":[ + 0.1471872627735138, + 1, + 1 + ], + "translation":[ + 0.2872271239757538, + 0.9564309120178223, + 0.029778549447655678 + ] + }, + { + "mesh":22, + "name":"Renderbot-human-obj-1250.001", + "rotation":[ + 0.5000001788139343, + -0.4999997913837433, + 0.5, + 0.5 + ], + "scale":[ + 0.008850742131471634, + 0.008850742131471634, + 0.008850742131471634 + ], + "translation":[ + 2.824540615081787, + -0.4139680862426758, + -1.3565996885299683 + ] + }, + { + "mesh":23, + "name":"Renderbot-human-obj-190", + "rotation":[ + 0.4547937214374542, + -0.5414450168609619, + 0.5414450168609619, + 0.4547937214374542 + ], + "scale":[ + 0.008850742131471634, + 0.008850742131471634, + 0.008850742131471634 + ], + "translation":[ + 2.8673129081726074, + -0.4052572250366211, + -0.7358673810958862 + ] + }, + { + "mesh":24, + "name":"Target.003", + "rotation":[ + 0.6532815098762512, + 0.27059805393218994, + -0.27059805393218994, + 0.6532815098762512 + ], + "scale":[ + 0.2499609738588333, + 1, + 1 + ] + }, + { + "children":[ + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38 + ], + "extras":{ + "name":"sinusoidalTresJS" + }, + "name":"ShaderToy.001", + "rotation":[ + 0, + -0.7071068286895752, + 0, + 0.7071068286895752 + ], + "translation":[ + -2.125278949737549, + 4.589776515960693, + 5.519103527069092 + ] + }, + { + "mesh":25, + "name":"Cube.006" + }, + { + "mesh":26, + "name":"Cube.007", + "translation":[ + -25.552494049072266, + 0, + 0 + ] + }, + { + "camera":4, + "name":"Camera.007", + "rotation":[ + 0, + 1, + 0, + 1.696310619081487e-06 + ], + "scale":[ + 0.10244525223970413, + 0.6960197687149048, + 0.69601970911026 + ], + "translation":[ + -0.2886877954006195, + 0.8574857711791992, + -16.727806091308594 + ] + }, + { + "mesh":27, + "name":"Floor.004", + "rotation":[ + -0.7071068286895752, + 0, + 0, + 0.7071068286895752 + ], + "scale":[ + 18.880001068115234, + 5.380000114440918, + 1 + ], + "translation":[ + 0.06757363677024841, + -1.4877362251281738, + -2.2696120738983154 + ] + }, + { + "extensions":{ + "KHR_lights_punctual":{ + "light":5 + } + }, + "name":"Point.007", + "rotation":[ + -0.7071068286895752, + 0, + 0, + 0.7071068286895752 + ], + "scale":[ + 0.1471872627735138, + 1, + 1 + ], + "translation":[ + 3.023749351501465, + 1.983687400817871, + -0.3179958760738373 + ] + }, + { + "extensions":{ + "KHR_lights_punctual":{ + "light":6 + } + }, + "name":"Point.008", + "rotation":[ + -0.7071068286895752, + 0, + 0, + 0.7071068286895752 + ], + "scale":[ + 0.1471872627735138, + 1, + 1 + ], + "translation":[ + -3.592613697052002, + 1.8155574798583984, + -0.6216045618057251 + ] + }, + { + "mesh":28, + "name":"Target.004", + "scale":[ + 20, + 2, + 1 + ] + }, + { + "children":[ + 42, + 43, + 44, + 45, + 46 + ], + "extras":{ + "name":"gamesOfSinus" + }, + "name":"ShaderToy.003", + "rotation":[ + 0, + -1, + 0, + 4.887620548288396e-07 + ], + "translation":[ + -12.74905014038086, + 5.674603462219238, + -9.983145713806152 + ] + }, + { + "mesh":29, + "name":"Stair railing", + "translation":[ + -18.920501708984375, + 4.184889793395996, + 0 + ] + }, + { + "mesh":30, + "name":"Stair railing.001", + "translation":[ + -18.91954231262207, + 4.184728145599365, + -0.0028702616691589355 + ] + } + ], + "cameras":[ + { + "name":"Camera.003", + "perspective":{ + "aspectRatio":1.7777777777777777, + "yfov":0.9705651545840371, + "zfar":100, + "znear":0.10000000149011612 + }, + "type":"perspective" + }, + { + "name":"Camera.005", + "perspective":{ + "aspectRatio":1.7777777777777777, + "yfov":1.1483504415389845, + "zfar":100, + "znear":0.10000000149011612 + }, + "type":"perspective" + }, + { + "name":"Camera.006", + "perspective":{ + "aspectRatio":1.7777777777777777, + "yfov":0.532504134466597, + "zfar":100, + "znear":0.10000000149011612 + }, + "type":"perspective" + }, + { + "name":"Camera.007", + "perspective":{ + "aspectRatio":1.7777777777777777, + "yfov":1.0247789579772038, + "zfar":100, + "znear":0.10000000149011612 + }, + "type":"perspective" + }, + { + "name":"Camera.008", + "perspective":{ + "aspectRatio":1.7777777777777777, + "yfov":0.9737984952574713, + "zfar":100, + "znear":0.10000000149011612 + }, + "type":"perspective" + } + ], + "materials":[ + { + "doubleSided":true, + "extensions":{ + "KHR_materials_specular":{ + "specularFactor":0 + } + }, + "name":"walls", + "pbrMetallicRoughness":{ + "baseColorFactor":[ + 0.7230502963066101, + 0.7230556607246399, + 1, + 1 + ], + "metallicFactor":0 + } + }, + { + "doubleSided":true, + "name":"Human", + "pbrMetallicRoughness":{ + "baseColorFactor":[ + 0.7230502963066101, + 0.7230556607246399, + 1, + 1 + ], + "metallicFactor":0, + "roughnessFactor":0.5 + } + }, + { + "doubleSided":true, + "name":"Tableau", + "pbrMetallicRoughness":{ + "baseColorFactor":[ + 1, + 0, + 0.01631060428917408, + 1 + ], + "metallicFactor":0, + "roughnessFactor":0.5 + } + }, + { + "doubleSided":true, + "name":"Tableau.001", + "pbrMetallicRoughness":{ + "baseColorFactor":[ + 1, + 0, + 0.01631060428917408, + 1 + ], + "metallicFactor":0, + "roughnessFactor":0.5 + } + }, + { + "doubleSided":true, + "name":"Tableau.002", + "pbrMetallicRoughness":{ + "baseColorFactor":[ + 1, + 0, + 0.01631060428917408, + 1 + ], + "metallicFactor":0, + "roughnessFactor":0.5 + } + } + ], + "meshes":[ + { + "name":"Plane.017", + "primitives":[ + { + "attributes":{ + "POSITION":0, + "NORMAL":1, + "TEXCOORD_0":2 + }, + "indices":3, + "material":0 + } + ] + }, + { + "name":"Cube.007", + "primitives":[ + { + "attributes":{ + "POSITION":4, + "NORMAL":5, + "TEXCOORD_0":6 + }, + "indices":7, + "material":0 + } + ] + }, + { + "name":"Renderbot-human-obj-1250", + "primitives":[ + { + "attributes":{ + "POSITION":8, + "NORMAL":9, + "TEXCOORD_0":10 + }, + "indices":11, + "material":1 + } + ] + }, + { + "name":"Renderbot-human-obj-237.001", + "primitives":[ + { + "attributes":{ + "POSITION":12, + "NORMAL":13, + "TEXCOORD_0":14 + }, + "indices":15, + "material":1 + } + ] + }, + { + "name":"Renderbot-human-obj-947.001", + "primitives":[ + { + "attributes":{ + "POSITION":16, + "NORMAL":17, + "TEXCOORD_0":18 + }, + "indices":19, + "material":1 + } + ] + }, + { + "name":"Renderbot-human-obj-960", + "primitives":[ + { + "attributes":{ + "POSITION":20, + "NORMAL":21, + "TEXCOORD_0":22 + }, + "indices":23, + "material":1 + } + ] + }, + { + "name":"Renderbot-human-obj-960.001", + "primitives":[ + { + "attributes":{ + "POSITION":24, + "NORMAL":25, + "TEXCOORD_0":26 + }, + "indices":23, + "material":1 + } + ] + }, + { + "name":"Plane.019", + "primitives":[ + { + "attributes":{ + "POSITION":27, + "NORMAL":28, + "TEXCOORD_0":29 + }, + "indices":3, + "material":0 + } + ] + }, + { + "name":"Cube.005", + "primitives":[ + { + "attributes":{ + "POSITION":30, + "NORMAL":31, + "TEXCOORD_0":32 + }, + "indices":7, + "material":0 + } + ] + }, + { + "name":"Plane.021", + "primitives":[ + { + "attributes":{ + "POSITION":33, + "NORMAL":34, + "TEXCOORD_0":35 + }, + "indices":3, + "material":0 + } + ] + }, + { + "name":"Cube.006", + "primitives":[ + { + "attributes":{ + "POSITION":36, + "NORMAL":37, + "TEXCOORD_0":38 + }, + "indices":7, + "material":0 + } + ] + }, + { + "name":"Plane.036", + "primitives":[ + { + "attributes":{ + "POSITION":39, + "NORMAL":40, + "TEXCOORD_0":41 + }, + "indices":42, + "material":2 + } + ] + }, + { + "name":"Plane.020", + "primitives":[ + { + "attributes":{ + "POSITION":43, + "NORMAL":44, + "TEXCOORD_0":45 + }, + "indices":46, + "material":2 + } + ] + }, + { + "name":"Plane.014", + "primitives":[ + { + "attributes":{ + "POSITION":47, + "NORMAL":48 + }, + "indices":49 + } + ] + }, + { + "name":"Cube", + "primitives":[ + { + "attributes":{ + "POSITION":50, + "NORMAL":51, + "TEXCOORD_0":52 + }, + "indices":53 + } + ] + }, + { + "name":"Plane.038", + "primitives":[ + { + "attributes":{ + "POSITION":54, + "NORMAL":55, + "TEXCOORD_0":56 + }, + "indices":42, + "material":2 + } + ] + }, + { + "name":"Plane.037", + "primitives":[ + { + "attributes":{ + "POSITION":57, + "NORMAL":58, + "TEXCOORD_0":59 + }, + "indices":60, + "material":2 + } + ] + }, + { + "name":"Plane.039", + "primitives":[ + { + "attributes":{ + "POSITION":61, + "NORMAL":62, + "TEXCOORD_0":63 + }, + "indices":42, + "material":3 + } + ] + }, + { + "name":"Plane.040", + "primitives":[ + { + "attributes":{ + "POSITION":64, + "NORMAL":65, + "TEXCOORD_0":66 + }, + "indices":60, + "material":3 + } + ] + }, + { + "name":"Cube.004", + "primitives":[ + { + "attributes":{ + "POSITION":67, + "NORMAL":68, + "TEXCOORD_0":69 + }, + "indices":7 + } + ] + }, + { + "name":"Cube.002", + "primitives":[ + { + "attributes":{ + "POSITION":70, + "NORMAL":71, + "TEXCOORD_0":72 + }, + "indices":7, + "material":0 + } + ] + }, + { + "name":"Plane.042", + "primitives":[ + { + "attributes":{ + "POSITION":73, + "NORMAL":74, + "TEXCOORD_0":75 + }, + "indices":42, + "material":2 + } + ] + }, + { + "name":"Renderbot-human-obj-1250.001", + "primitives":[ + { + "attributes":{ + "POSITION":76, + "NORMAL":77, + "TEXCOORD_0":78 + }, + "indices":11, + "material":1 + } + ] + }, + { + "name":"Renderbot-human-obj-190", + "primitives":[ + { + "attributes":{ + "POSITION":79, + "NORMAL":80, + "TEXCOORD_0":81 + }, + "indices":82, + "material":1 + } + ] + }, + { + "name":"Plane.041", + "primitives":[ + { + "attributes":{ + "POSITION":83, + "NORMAL":84, + "TEXCOORD_0":85 + }, + "indices":60, + "material":2 + } + ] + }, + { + "name":"Cube.008", + "primitives":[ + { + "attributes":{ + "POSITION":86, + "NORMAL":87, + "TEXCOORD_0":88 + }, + "indices":89 + } + ] + }, + { + "name":"Cube.009", + "primitives":[ + { + "attributes":{ + "POSITION":90, + "NORMAL":91, + "TEXCOORD_0":92 + }, + "indices":93 + } + ] + }, + { + "name":"Plane.043", + "primitives":[ + { + "attributes":{ + "POSITION":94, + "NORMAL":95, + "TEXCOORD_0":96 + }, + "indices":42, + "material":4 + } + ] + }, + { + "name":"Plane.044", + "primitives":[ + { + "attributes":{ + "POSITION":97, + "NORMAL":98, + "TEXCOORD_0":99 + }, + "indices":60, + "material":4 + } + ] + }, + { + "name":"Plane", + "primitives":[ + { + "attributes":{ + "POSITION":100, + "NORMAL":101, + "TEXCOORD_0":102 + }, + "indices":103, + "material":0 + } + ] + }, + { + "name":"Plane.001", + "primitives":[ + { + "attributes":{ + "POSITION":104, + "NORMAL":105, + "TEXCOORD_0":106 + }, + "indices":107, + "material":0 + } + ] + } + ], + "accessors":[ + { + "bufferView":0, + "componentType":5126, + "count":288, + "max":[ + 0.019040213897824287, + 0.39424929022789, + 0.7690410614013672 + ], + "min":[ + -0.019040001556277275, + 0, + -0.7690410614013672 + ], + "type":"VEC3" + }, + { + "bufferView":1, + "componentType":5126, + "count":288, + "type":"VEC3" + }, + { + "bufferView":2, + "componentType":5126, + "count":288, + "type":"VEC2" + }, + { + "bufferView":3, + "componentType":5123, + "count":528, + "type":"SCALAR" + }, + { + "bufferView":4, + "componentType":5126, + "count":24, + "max":[ + 0.2250000536441803, + 0.2688310444355011, + 0.03509636968374252 + ], + "min":[ + -0.2250000536441803, + -0.2688310444355011, + -0.03509636968374252 + ], + "type":"VEC3" + }, + { + "bufferView":5, + "componentType":5126, + "count":24, + "type":"VEC3" + }, + { + "bufferView":6, + "componentType":5126, + "count":24, + "type":"VEC2" + }, + { + "bufferView":7, + "componentType":5123, + "count":36, + "type":"SCALAR" + }, + { + "bufferView":8, + "componentType":5126, + "count":1836, + "max":[ + 25.805973052978516, + 22.809457778930664, + 0.4536318778991699 + ], + "min":[ + -19.73650550842285, + -21.98978614807129, + -174.5129852294922 + ], + "type":"VEC3" + }, + { + "bufferView":9, + "componentType":5126, + "count":1836, + "type":"VEC3" + }, + { + "bufferView":10, + "componentType":5126, + "count":1836, + "type":"VEC2" + }, + { + "bufferView":11, + "componentType":5123, + "count":3000, + "type":"SCALAR" + }, + { + "bufferView":12, + "componentType":5126, + "count":1264, + "max":[ + 31.267614364624023, + 38.09022903442383, + 0.38263189792633057 + ], + "min":[ + -47.980987548828125, + -24.387990951538086, + -182.18084716796875 + ], + "type":"VEC3" + }, + { + "bufferView":13, + "componentType":5126, + "count":1264, + "type":"VEC3" + }, + { + "bufferView":14, + "componentType":5126, + "count":1264, + "type":"VEC2" + }, + { + "bufferView":15, + "componentType":5123, + "count":2052, + "type":"SCALAR" + }, + { + "bufferView":16, + "componentType":5126, + "count":1691, + "max":[ + 36.359764099121094, + 18.096303939819336, + -0.2764061987400055 + ], + "min":[ + -34.417049407958984, + -29.21428871154785, + -176.87591552734375 + ], + "type":"VEC3" + }, + { + "bufferView":17, + "componentType":5126, + "count":1691, + "type":"VEC3" + }, + { + "bufferView":18, + "componentType":5126, + "count":1691, + "type":"VEC2" + }, + { + "bufferView":19, + "componentType":5123, + "count":3000, + "type":"SCALAR" + }, + { + "bufferView":20, + "componentType":5126, + "count":1752, + "max":[ + 42.59036636352539, + 18.085132598876953, + -0.8201067447662354 + ], + "min":[ + -23.94802474975586, + -15.182145118713379, + -177.66537475585938 + ], + "type":"VEC3" + }, + { + "bufferView":21, + "componentType":5126, + "count":1752, + "type":"VEC3" + }, + { + "bufferView":22, + "componentType":5126, + "count":1752, + "type":"VEC2" + }, + { + "bufferView":23, + "componentType":5123, + "count":3000, + "type":"SCALAR" + }, + { + "bufferView":24, + "componentType":5126, + "count":1752, + "max":[ + 42.59036636352539, + 18.085132598876953, + -0.8201067447662354 + ], + "min":[ + -23.94802474975586, + -15.182145118713379, + -177.66537475585938 + ], + "type":"VEC3" + }, + { + "bufferView":25, + "componentType":5126, + "count":1752, + "type":"VEC3" + }, + { + "bufferView":26, + "componentType":5126, + "count":1752, + "type":"VEC2" + }, + { + "bufferView":27, + "componentType":5126, + "count":288, + "max":[ + 0.019040213897824287, + 0.39424929022789, + 0.7690410614013672 + ], + "min":[ + -0.019040001556277275, + 0, + -0.7690410614013672 + ], + "type":"VEC3" + }, + { + "bufferView":28, + "componentType":5126, + "count":288, + "type":"VEC3" + }, + { + "bufferView":29, + "componentType":5126, + "count":288, + "type":"VEC2" + }, + { + "bufferView":30, + "componentType":5126, + "count":24, + "max":[ + 0.2250000536441803, + 0.2688310444355011, + 0.03509636968374252 + ], + "min":[ + -0.2250000536441803, + -0.2688310444355011, + -0.03509636968374252 + ], + "type":"VEC3" + }, + { + "bufferView":31, + "componentType":5126, + "count":24, + "type":"VEC3" + }, + { + "bufferView":32, + "componentType":5126, + "count":24, + "type":"VEC2" + }, + { + "bufferView":33, + "componentType":5126, + "count":288, + "max":[ + 0.019040299579501152, + 0.39424929022789, + 0.7690410614013672 + ], + "min":[ + -0.019040001556277275, + 0, + -1.7526271343231201 + ], + "type":"VEC3" + }, + { + "bufferView":34, + "componentType":5126, + "count":288, + "type":"VEC3" + }, + { + "bufferView":35, + "componentType":5126, + "count":288, + "type":"VEC2" + }, + { + "bufferView":36, + "componentType":5126, + "count":24, + "max":[ + 0.2250000536441803, + 0.2688310444355011, + 0.03509634733200073 + ], + "min":[ + -0.3961009383201599, + -0.2688310444355011, + -0.03509637340903282 + ], + "type":"VEC3" + }, + { + "bufferView":37, + "componentType":5126, + "count":24, + "type":"VEC3" + }, + { + "bufferView":38, + "componentType":5126, + "count":24, + "type":"VEC2" + }, + { + "bufferView":39, + "componentType":5126, + "count":4, + "max":[ + 0.4999995231628418, + 0.5000004768371582, + 0 + ], + "min":[ + -0.5000014305114746, + -0.5000004768371582, + 0 + ], + "type":"VEC3" + }, + { + "bufferView":40, + "componentType":5126, + "count":4, + "type":"VEC3" + }, + { + "bufferView":41, + "componentType":5126, + "count":4, + "type":"VEC2" + }, + { + "bufferView":42, + "componentType":5123, + "count":6, + "type":"SCALAR" + }, + { + "bufferView":43, + "componentType":5126, + "count":62, + "max":[ + 3.211334705352783, + 3.5910019874572754, + 1.4408284425735474 + ], + "min":[ + -3.2052040100097656, + -0.3776076138019562, + -4.420117378234863 + ], + "type":"VEC3" + }, + { + "bufferView":44, + "componentType":5126, + "count":62, + "type":"VEC3" + }, + { + "bufferView":45, + "componentType":5126, + "count":62, + "type":"VEC2" + }, + { + "bufferView":46, + "componentType":5123, + "count":180, + "type":"SCALAR" + }, + { + "bufferView":47, + "componentType":5126, + "count":672, + "max":[ + 2, + 3.040001153945923, + 5.139999866485596 + ], + "min":[ + -2, + -8.146034247147327e-08, + 0.4999999403953552 + ], + "type":"VEC3" + }, + { + "bufferView":48, + "componentType":5126, + "count":672, + "type":"VEC3" + }, + { + "bufferView":49, + "componentType":5123, + "count":1248, + "type":"SCALAR" + }, + { + "bufferView":50, + "componentType":5126, + "count":2462, + "max":[ + 5.599112510681152, + 26.508834838867188, + 13.262882232666016 + ], + "min":[ + -40, + 0.031114578247070312, + -13.262882232666016 + ], + "type":"VEC3" + }, + { + "bufferView":51, + "componentType":5126, + "count":2462, + "type":"VEC3" + }, + { + "bufferView":52, + "componentType":5126, + "count":2462, + "type":"VEC2" + }, + { + "bufferView":53, + "componentType":5123, + "count":5250, + "type":"SCALAR" + }, + { + "bufferView":54, + "componentType":5126, + "count":4, + "max":[ + 0.4999995231628418, + 0.5000004768371582, + 0 + ], + "min":[ + -0.5000014305114746, + -0.5000004768371582, + 0 + ], + "type":"VEC3" + }, + { + "bufferView":55, + "componentType":5126, + "count":4, + "type":"VEC3" + }, + { + "bufferView":56, + "componentType":5126, + "count":4, + "type":"VEC2" + }, + { + "bufferView":57, + "componentType":5126, + "count":66049, + "max":[ + 0.5000978112220764, + 0.5000000596046448, + 5.364418598219345e-07 + ], + "min":[ + -0.5000977516174316, + -0.5, + -5.364418598219345e-07 + ], + "type":"VEC3" + }, + { + "bufferView":58, + "componentType":5126, + "count":66049, + "type":"VEC3" + }, + { + "bufferView":59, + "componentType":5126, + "count":66049, + "type":"VEC2" + }, + { + "bufferView":60, + "componentType":5125, + "count":393216, + "type":"SCALAR" + }, + { + "bufferView":61, + "componentType":5126, + "count":4, + "max":[ + 0.4999995231628418, + 0.5000004768371582, + 0 + ], + "min":[ + -0.5000014305114746, + -0.5000004768371582, + 0 + ], + "type":"VEC3" + }, + { + "bufferView":62, + "componentType":5126, + "count":4, + "type":"VEC3" + }, + { + "bufferView":63, + "componentType":5126, + "count":4, + "type":"VEC2" + }, + { + "bufferView":64, + "componentType":5126, + "count":66049, + "max":[ + 0.5000978112220764, + 0.5000000596046448, + 5.364418598219345e-07 + ], + "min":[ + -0.5000977516174316, + -0.5, + -5.364418598219345e-07 + ], + "type":"VEC3" + }, + { + "bufferView":65, + "componentType":5126, + "count":66049, + "type":"VEC3" + }, + { + "bufferView":66, + "componentType":5126, + "count":66049, + "type":"VEC2" + }, + { + "bufferView":67, + "componentType":5126, + "count":24, + "max":[ + -1.5146578550338745, + -0.07214447855949402, + -0.4119911193847656 + ], + "min":[ + -1.9036896228790283, + -1.0000001192092896, + -0.8010228872299194 + ], + "type":"VEC3" + }, + { + "bufferView":68, + "componentType":5126, + "count":24, + "type":"VEC3" + }, + { + "bufferView":69, + "componentType":5126, + "count":24, + "type":"VEC2" + }, + { + "bufferView":70, + "componentType":5126, + "count":24, + "max":[ + -1.5146578550338745, + -0.07214447855949402, + -0.4119911193847656 + ], + "min":[ + -1.9036896228790283, + -1.0000001192092896, + -0.8010228872299194 + ], + "type":"VEC3" + }, + { + "bufferView":71, + "componentType":5126, + "count":24, + "type":"VEC3" + }, + { + "bufferView":72, + "componentType":5126, + "count":24, + "type":"VEC2" + }, + { + "bufferView":73, + "componentType":5126, + "count":4, + "max":[ + 0.4999995231628418, + 0.5000004768371582, + 0 + ], + "min":[ + -0.5000014305114746, + -0.5000004768371582, + 0 + ], + "type":"VEC3" + }, + { + "bufferView":74, + "componentType":5126, + "count":4, + "type":"VEC3" + }, + { + "bufferView":75, + "componentType":5126, + "count":4, + "type":"VEC2" + }, + { + "bufferView":76, + "componentType":5126, + "count":1836, + "max":[ + 25.805973052978516, + 22.809457778930664, + 0.4536318778991699 + ], + "min":[ + -19.73650550842285, + -21.98978614807129, + -174.5129852294922 + ], + "type":"VEC3" + }, + { + "bufferView":77, + "componentType":5126, + "count":1836, + "type":"VEC3" + }, + { + "bufferView":78, + "componentType":5126, + "count":1836, + "type":"VEC2" + }, + { + "bufferView":79, + "componentType":5126, + "count":3000, + "max":[ + 31.302427291870117, + 34.92601776123047, + -0.437898188829422 + ], + "min":[ + -33.20698928833008, + -39.05141830444336, + -150.4948272705078 + ], + "type":"VEC3" + }, + { + "bufferView":80, + "componentType":5126, + "count":3000, + "type":"VEC3" + }, + { + "bufferView":81, + "componentType":5126, + "count":3000, + "type":"VEC2" + }, + { + "bufferView":82, + "componentType":5123, + "count":3000, + "type":"SCALAR" + }, + { + "bufferView":83, + "componentType":5126, + "count":66049, + "max":[ + 0.5000978112220764, + 0.5000000596046448, + 5.364418598219345e-07 + ], + "min":[ + -0.5000977516174316, + -0.5, + -5.364418598219345e-07 + ], + "type":"VEC3" + }, + { + "bufferView":84, + "componentType":5126, + "count":66049, + "type":"VEC3" + }, + { + "bufferView":85, + "componentType":5126, + "count":66049, + "type":"VEC2" + }, + { + "bufferView":86, + "componentType":5126, + "count":55428, + "max":[ + 0.5765803456306458, + 13.178695678710938, + 5.425432205200195 + ], + "min":[ + -25.72543716430664, + 3.3275389671325684, + -5.425432205200195 + ], + "type":"VEC3" + }, + { + "bufferView":87, + "componentType":5126, + "count":55428, + "type":"VEC3" + }, + { + "bufferView":88, + "componentType":5126, + "count":55428, + "type":"VEC2" + }, + { + "bufferView":89, + "componentType":5123, + "count":95904, + "type":"SCALAR" + }, + { + "bufferView":90, + "componentType":5126, + "count":814, + "max":[ + 1.1067285537719727, + 9.389677047729492, + 3.862765073776245 + ], + "min":[ + -5.0174431800842285, + 3.3275389671325684, + -3.862765073776245 + ], + "type":"VEC3" + }, + { + "bufferView":91, + "componentType":5126, + "count":814, + "type":"VEC3" + }, + { + "bufferView":92, + "componentType":5126, + "count":814, + "type":"VEC2" + }, + { + "bufferView":93, + "componentType":5123, + "count":1632, + "type":"SCALAR" + }, + { + "bufferView":94, + "componentType":5126, + "count":4, + "max":[ + 0.4999995231628418, + 0.5000004768371582, + 0 + ], + "min":[ + -0.5000014305114746, + -0.5000004768371582, + 0 + ], + "type":"VEC3" + }, + { + "bufferView":95, + "componentType":5126, + "count":4, + "type":"VEC3" + }, + { + "bufferView":96, + "componentType":5126, + "count":4, + "type":"VEC2" + }, + { + "bufferView":97, + "componentType":5126, + "count":66049, + "max":[ + 0.5000978112220764, + 0.5000000596046448, + 5.364418598219345e-07 + ], + "min":[ + -0.5000977516174316, + -0.5, + -5.364418598219345e-07 + ], + "type":"VEC3" + }, + { + "bufferView":98, + "componentType":5126, + "count":66049, + "type":"VEC3" + }, + { + "bufferView":99, + "componentType":5126, + "count":66049, + "type":"VEC2" + }, + { + "bufferView":100, + "componentType":5126, + "count":324, + "max":[ + 5.948592662811279, + 0.7402353286743164, + 3.255460739135742 + ], + "min":[ + -0.7340629696846008, + -3.4692959785461426, + -3.255460739135742 + ], + "type":"VEC3" + }, + { + "bufferView":101, + "componentType":5126, + "count":324, + "type":"VEC3" + }, + { + "bufferView":102, + "componentType":5126, + "count":324, + "type":"VEC2" + }, + { + "bufferView":103, + "componentType":5123, + "count":504, + "type":"SCALAR" + }, + { + "bufferView":104, + "componentType":5126, + "count":384, + "max":[ + 0.07336891442537308, + 0.7512474060058594, + 3.5004465579986572 + ], + "min":[ + -1.1873630285263062, + 0, + -3.5004465579986572 + ], + "type":"VEC3" + }, + { + "bufferView":105, + "componentType":5126, + "count":384, + "type":"VEC3" + }, + { + "bufferView":106, + "componentType":5126, + "count":384, + "type":"VEC2" + }, + { + "bufferView":107, + "componentType":5123, + "count":576, + "type":"SCALAR" + } + ], + "bufferViews":[ + { + "buffer":0, + "byteLength":3456, + "byteOffset":0, + "target":34962 + }, + { + "buffer":0, + "byteLength":3456, + "byteOffset":3456, + "target":34962 + }, + { + "buffer":0, + "byteLength":2304, + "byteOffset":6912, + "target":34962 + }, + { + "buffer":0, + "byteLength":1056, + "byteOffset":9216, + "target":34963 + }, + { + "buffer":0, + "byteLength":288, + "byteOffset":10272, + "target":34962 + }, + { + "buffer":0, + "byteLength":288, + "byteOffset":10560, + "target":34962 + }, + { + "buffer":0, + "byteLength":192, + "byteOffset":10848, + "target":34962 + }, + { + "buffer":0, + "byteLength":72, + "byteOffset":11040, + "target":34963 + }, + { + "buffer":0, + "byteLength":22032, + "byteOffset":11112, + "target":34962 + }, + { + "buffer":0, + "byteLength":22032, + "byteOffset":33144, + "target":34962 + }, + { + "buffer":0, + "byteLength":14688, + "byteOffset":55176, + "target":34962 + }, + { + "buffer":0, + "byteLength":6000, + "byteOffset":69864, + "target":34963 + }, + { + "buffer":0, + "byteLength":15168, + "byteOffset":75864, + "target":34962 + }, + { + "buffer":0, + "byteLength":15168, + "byteOffset":91032, + "target":34962 + }, + { + "buffer":0, + "byteLength":10112, + "byteOffset":106200, + "target":34962 + }, + { + "buffer":0, + "byteLength":4104, + "byteOffset":116312, + "target":34963 + }, + { + "buffer":0, + "byteLength":20292, + "byteOffset":120416, + "target":34962 + }, + { + "buffer":0, + "byteLength":20292, + "byteOffset":140708, + "target":34962 + }, + { + "buffer":0, + "byteLength":13528, + "byteOffset":161000, + "target":34962 + }, + { + "buffer":0, + "byteLength":6000, + "byteOffset":174528, + "target":34963 + }, + { + "buffer":0, + "byteLength":21024, + "byteOffset":180528, + "target":34962 + }, + { + "buffer":0, + "byteLength":21024, + "byteOffset":201552, + "target":34962 + }, + { + "buffer":0, + "byteLength":14016, + "byteOffset":222576, + "target":34962 + }, + { + "buffer":0, + "byteLength":6000, + "byteOffset":236592, + "target":34963 + }, + { + "buffer":0, + "byteLength":21024, + "byteOffset":242592, + "target":34962 + }, + { + "buffer":0, + "byteLength":21024, + "byteOffset":263616, + "target":34962 + }, + { + "buffer":0, + "byteLength":14016, + "byteOffset":284640, + "target":34962 + }, + { + "buffer":0, + "byteLength":3456, + "byteOffset":298656, + "target":34962 + }, + { + "buffer":0, + "byteLength":3456, + "byteOffset":302112, + "target":34962 + }, + { + "buffer":0, + "byteLength":2304, + "byteOffset":305568, + "target":34962 + }, + { + "buffer":0, + "byteLength":288, + "byteOffset":307872, + "target":34962 + }, + { + "buffer":0, + "byteLength":288, + "byteOffset":308160, + "target":34962 + }, + { + "buffer":0, + "byteLength":192, + "byteOffset":308448, + "target":34962 + }, + { + "buffer":0, + "byteLength":3456, + "byteOffset":308640, + "target":34962 + }, + { + "buffer":0, + "byteLength":3456, + "byteOffset":312096, + "target":34962 + }, + { + "buffer":0, + "byteLength":2304, + "byteOffset":315552, + "target":34962 + }, + { + "buffer":0, + "byteLength":288, + "byteOffset":317856, + "target":34962 + }, + { + "buffer":0, + "byteLength":288, + "byteOffset":318144, + "target":34962 + }, + { + "buffer":0, + "byteLength":192, + "byteOffset":318432, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":318624, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":318672, + "target":34962 + }, + { + "buffer":0, + "byteLength":32, + "byteOffset":318720, + "target":34962 + }, + { + "buffer":0, + "byteLength":12, + "byteOffset":318752, + "target":34963 + }, + { + "buffer":0, + "byteLength":744, + "byteOffset":318764, + "target":34962 + }, + { + "buffer":0, + "byteLength":744, + "byteOffset":319508, + "target":34962 + }, + { + "buffer":0, + "byteLength":496, + "byteOffset":320252, + "target":34962 + }, + { + "buffer":0, + "byteLength":360, + "byteOffset":320748, + "target":34963 + }, + { + "buffer":0, + "byteLength":8064, + "byteOffset":321108, + "target":34962 + }, + { + "buffer":0, + "byteLength":8064, + "byteOffset":329172, + "target":34962 + }, + { + "buffer":0, + "byteLength":2496, + "byteOffset":337236, + "target":34963 + }, + { + "buffer":0, + "byteLength":29544, + "byteOffset":339732, + "target":34962 + }, + { + "buffer":0, + "byteLength":29544, + "byteOffset":369276, + "target":34962 + }, + { + "buffer":0, + "byteLength":19696, + "byteOffset":398820, + "target":34962 + }, + { + "buffer":0, + "byteLength":10500, + "byteOffset":418516, + "target":34963 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":429016, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":429064, + "target":34962 + }, + { + "buffer":0, + "byteLength":32, + "byteOffset":429112, + "target":34962 + }, + { + "buffer":0, + "byteLength":792588, + "byteOffset":429144, + "target":34962 + }, + { + "buffer":0, + "byteLength":792588, + "byteOffset":1221732, + "target":34962 + }, + { + "buffer":0, + "byteLength":528392, + "byteOffset":2014320, + "target":34962 + }, + { + "buffer":0, + "byteLength":1572864, + "byteOffset":2542712, + "target":34963 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":4115576, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":4115624, + "target":34962 + }, + { + "buffer":0, + "byteLength":32, + "byteOffset":4115672, + "target":34962 + }, + { + "buffer":0, + "byteLength":792588, + "byteOffset":4115704, + "target":34962 + }, + { + "buffer":0, + "byteLength":792588, + "byteOffset":4908292, + "target":34962 + }, + { + "buffer":0, + "byteLength":528392, + "byteOffset":5700880, + "target":34962 + }, + { + "buffer":0, + "byteLength":288, + "byteOffset":6229272, + "target":34962 + }, + { + "buffer":0, + "byteLength":288, + "byteOffset":6229560, + "target":34962 + }, + { + "buffer":0, + "byteLength":192, + "byteOffset":6229848, + "target":34962 + }, + { + "buffer":0, + "byteLength":288, + "byteOffset":6230040, + "target":34962 + }, + { + "buffer":0, + "byteLength":288, + "byteOffset":6230328, + "target":34962 + }, + { + "buffer":0, + "byteLength":192, + "byteOffset":6230616, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":6230808, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":6230856, + "target":34962 + }, + { + "buffer":0, + "byteLength":32, + "byteOffset":6230904, + "target":34962 + }, + { + "buffer":0, + "byteLength":22032, + "byteOffset":6230936, + "target":34962 + }, + { + "buffer":0, + "byteLength":22032, + "byteOffset":6252968, + "target":34962 + }, + { + "buffer":0, + "byteLength":14688, + "byteOffset":6275000, + "target":34962 + }, + { + "buffer":0, + "byteLength":36000, + "byteOffset":6289688, + "target":34962 + }, + { + "buffer":0, + "byteLength":36000, + "byteOffset":6325688, + "target":34962 + }, + { + "buffer":0, + "byteLength":24000, + "byteOffset":6361688, + "target":34962 + }, + { + "buffer":0, + "byteLength":6000, + "byteOffset":6385688, + "target":34963 + }, + { + "buffer":0, + "byteLength":792588, + "byteOffset":6391688, + "target":34962 + }, + { + "buffer":0, + "byteLength":792588, + "byteOffset":7184276, + "target":34962 + }, + { + "buffer":0, + "byteLength":528392, + "byteOffset":7976864, + "target":34962 + }, + { + "buffer":0, + "byteLength":665136, + "byteOffset":8505256, + "target":34962 + }, + { + "buffer":0, + "byteLength":665136, + "byteOffset":9170392, + "target":34962 + }, + { + "buffer":0, + "byteLength":443424, + "byteOffset":9835528, + "target":34962 + }, + { + "buffer":0, + "byteLength":191808, + "byteOffset":10278952, + "target":34963 + }, + { + "buffer":0, + "byteLength":9768, + "byteOffset":10470760, + "target":34962 + }, + { + "buffer":0, + "byteLength":9768, + "byteOffset":10480528, + "target":34962 + }, + { + "buffer":0, + "byteLength":6512, + "byteOffset":10490296, + "target":34962 + }, + { + "buffer":0, + "byteLength":3264, + "byteOffset":10496808, + "target":34963 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":10500072, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":10500120, + "target":34962 + }, + { + "buffer":0, + "byteLength":32, + "byteOffset":10500168, + "target":34962 + }, + { + "buffer":0, + "byteLength":792588, + "byteOffset":10500200, + "target":34962 + }, + { + "buffer":0, + "byteLength":792588, + "byteOffset":11292788, + "target":34962 + }, + { + "buffer":0, + "byteLength":528392, + "byteOffset":12085376, + "target":34962 + }, + { + "buffer":0, + "byteLength":3888, + "byteOffset":12613768, + "target":34962 + }, + { + "buffer":0, + "byteLength":3888, + "byteOffset":12617656, + "target":34962 + }, + { + "buffer":0, + "byteLength":2592, + "byteOffset":12621544, + "target":34962 + }, + { + "buffer":0, + "byteLength":1008, + "byteOffset":12624136, + "target":34963 + }, + { + "buffer":0, + "byteLength":4608, + "byteOffset":12625144, + "target":34962 + }, + { + "buffer":0, + "byteLength":4608, + "byteOffset":12629752, + "target":34962 + }, + { + "buffer":0, + "byteLength":3072, + "byteOffset":12634360, + "target":34962 + }, + { + "buffer":0, + "byteLength":1152, + "byteOffset":12637432, + "target":34963 + } + ], + "buffers":[ + { + "byteLength":12638584, + "uri":"gallery.bin" + } + ] +} diff --git a/public/shadertoy-museum.png b/public/shadertoy-museum.png new file mode 100644 index 0000000..4be109e Binary files /dev/null and b/public/shadertoy-museum.png differ diff --git a/public/shadertoy-museum.png~ b/public/shadertoy-museum.png~ new file mode 100644 index 0000000..5d72c2f Binary files /dev/null and b/public/shadertoy-museum.png~ differ diff --git a/public/textures/shadertoy-museum/README.txt b/public/textures/shadertoy-museum/README.txt new file mode 100644 index 0000000..bef324a --- /dev/null +++ b/public/textures/shadertoy-museum/README.txt @@ -0,0 +1 @@ +Source: https://3dtextures.me/2018/06/22/blue-marble-002/ \ No newline at end of file diff --git a/public/textures/shadertoy-museum/displacement.png b/public/textures/shadertoy-museum/displacement.png new file mode 100644 index 0000000..02411fe Binary files /dev/null and b/public/textures/shadertoy-museum/displacement.png differ diff --git a/public/textures/shadertoy-museum/normal.jpg b/public/textures/shadertoy-museum/normal.jpg new file mode 100644 index 0000000..cdb05aa Binary files /dev/null and b/public/textures/shadertoy-museum/normal.jpg differ diff --git a/public/textures/shadertoy-museum/roughness.jpg b/public/textures/shadertoy-museum/roughness.jpg new file mode 100644 index 0000000..fb59ac6 Binary files /dev/null and b/public/textures/shadertoy-museum/roughness.jpg differ