This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "frag": "// © 2026 Patricio Gonzalez Vivo. All rights reserved\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_tex0;\nuniform vec2\t\tu_tex0Resolution;\nuniform sampler2D u_doubleBuffer0; // 128x128\nuniform sampler2D u_scene;\n\nuniform vec2 u_resolution;\nuniform float u_time;\nuniform float u_delta;\nuniform int u_frame;\nuniform int \t\tu_cameraChange;\n\nvarying vec4 v_color;\nvarying vec2 v_texcoord;\n\n#include \"lygia/math/const.glsl\"\n#include \"lygia/math/decimate.glsl\"\n#include \"lygia/math/saturate.glsl\"\n#include \"lygia/space/ratio.glsl\"\n#include \"lygia/color/luma.glsl\"\n#include \"lygia/draw/fill.glsl\"\n#include \"lygia/generative/random.glsl\"\n#include \"lygia/sample/zero.glsl\"\n\n#define STEPS 36\nvec2 buffRes = vec2(128.0);\nfloat maxSpeed = 0.5;\nfloat dotSize = 10.0;\n\n\nvoid main(void) {\n vec4 color = vec4(vec3(0.0), 1.0);\n \n vec2 buffPixel = 1.0/buffRes;\n vec2 pixel = 1.0/u_resolution;\n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "frag": "#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_tex0;\nuniform sampler2D u_doubleBuffer0; // 128x128\nuniform sampler2D u_scene;\n\nuniform vec2 u_resolution;\nuniform float u_time;\nuniform float u_delta;\nuniform int u_frame;\n\nvarying vec4 v_color;\nvarying vec2 v_texcoord;\n\n#include \"lygia/math/const.glsl\"\n#include \"lygia/math/decimate.glsl\"\n#include \"lygia/math/saturate.glsl\"\n#include \"lygia/color/luma.glsl\"\n#include \"lygia/draw/fill.glsl\"\n#include \"lygia/generative/random.glsl\"\n\n#define STEPS 36\nvec2 buffRes = vec2(128.0);\nfloat maxSpeed = 0.5;\nfloat dotSize = 10.0;\n\nvec2 buffPixel = 1.0/buffRes;\nvec2 pixel = 1.0/u_resolution;\n\nvoid main(void) {\n vec4 color = vec4(vec3(0.0), 1.0);\n \n vec2 st = v_texcoord;\n vec2 data_uv = decimate(st, buffRes) + 0.5 * buffPixel;\n vec4 data = texture2D(u_doubleBuffer0, data_uv);\n\n// PARTICLES PINGPONG\n#if defined(DOUBLE_BUFFER_0)\n\n // I |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "frag": "#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_tex0;\nuniform sampler2D u_doubleBuffer0; // 128x128\nuniform sampler2D u_scene;\n\nuniform vec2 u_resolution;\nuniform float u_time;\nuniform float u_delta;\nuniform int u_frame;\n\nvarying vec4 v_color;\nvarying vec2 v_texcoord;\n\n#include \"lygia/math/const.glsl\"\n#include \"lygia/math/decimate.glsl\"\n#include \"lygia/math/saturate.glsl\"\n#include \"lygia/color/luma.glsl\"\n#include \"lygia/draw/fill.glsl\"\n#include \"lygia/generative/random.glsl\"\n\n\nvec2 buffRes = vec2(128.0);\nfloat maxSpeed = 0.5;\nfloat dotSize = 10.0;\n\nvec2 buffPixel = 1.0/buffRes;\nvec2 pixel = 1.0/u_resolution;\n\nvoid main(void) {\n vec4 color = vec4(vec3(0.0), 1.0);\n \n vec2 st = v_texcoord;\n vec2 data_uv = decimate(st, buffRes) + 0.5 * buffPixel;\n vec4 data = texture2D(u_doubleBuffer0, data_uv);\n\n// PARTICLES PINGPONG\n#if defined(DOUBLE_BUFFER_0)\n\n // Initial parameter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "frag": "#ifdef GL_ES\nprecision mediump float;\n#endif\n\nuniform vec2 u_resolution;\nuniform vec2 u_mouse;\nuniform float u_time;\n\n#define W2RGB_FNC spectral_zucconi6\n#define W2RGB_ITERATIONS 20.\n\n#include \"lygia/math/map.glsl\"\n#include \"lygia/color/space.glsl\"\n#include \"lygia/color/palette/spectral.glsl\"\n\n#include \"lygia/draw/digits.glsl\"\n\nvoid main(void) {\n vec4 color = vec4(vec3(0.0), 1.0);\n vec2 pixel = 1.0/u_resolution.xy;\n vec2 st = gl_FragCoord.xy * pixel;\n\n float x = st.x;\n float w = mix(400., 700., st.x);\n\n if (st.y > 0.8)\n color.rgb = spectral( x );\n else if (st.y > 0.7)\n color.rgb = spectral( x, map(st.y, 0.8, 0.7, 0.0, 1.0) );\n else if (st.y > 0.6)\n color.rgb = spectral_geoffrey( x );\n else if (st.y > 0.5)\n color.rgb = spectral_zucconi( x );\n else if (st.y > 0.4)\n color.rgb = spectral_zucconi6( x );\n else if (st.y > 0.3)\n color.rgb = spectral_gems( x );\n else if (st.y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "frag": "#ifdef GL_ES\nprecision mediump float;\n#endif\n\nuniform vec2 u_resolution;\nuniform vec2 u_mouse;\nuniform float u_time;\n\n#include \"lygia/math/const.glsl\"\n#include \"lygia/math/decimate.glsl\"\n#include \"lygia/math/cubicMix.glsl\"\n#include \"lygia/draw/circle.glsl\"\n\n// #define RYB_FAST\n#define RYB_LERP(A, B, T) cubicMix(A, B, T)\n#include \"lygia/color/hueShiftRYB.glsl\"\n// #define HSV2RYB_FAST\n#include \"lygia/color/space/hsv2ryb.glsl\"\n\n\nvoid main(void) {\n vec4 color = vec4(1.);\n vec2 pixel = 1./u_resolution.xy;\n vec2 st = gl_FragCoord.xy * pixel;\n\n // Color Wheel\n vec2 p = st * 2.0 - 1.0;\n p *= 1.1;\n float a = atan(p.y, -p.x);\n a = decimate(a, 3.0);\n float l = saturate(length(p));\n vec3 w = hsv2ryb(vec3(a/TAU + 0.5, 1.0, decimate( l, 6.0) ));\n color.rgb = mix(color.rgb, w, aastep(l, 1.0));\n\n // Mouse Pointer\n vec2 p_mouse = (u_mouse * pixel) * 2.0 - 1.0;\n float a_mouse = atan(p_mouse.y, -p_mouse.x); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "frag": "#ifdef GL_ES\nprecision mediump float;\n#endif\n\nuniform vec2 u_resolution;\nuniform vec2 u_mouse;\nuniform float u_time;\n\n#include \"lygia/draw/char.glsl\"\n#include \"lygia/generative/random.glsl\"\n\nvoid main(void) {\n vec4 color = vec4(vec3(0.0), 1.0);\n vec2 pixel = 1.0/u_resolution.xy;\n vec2 st = gl_FragCoord.xy * pixel;\n \n\n int char_code[13];\n char_code[0] = CHAR_H;\n char_code[1] = CHAR_E;\n char_code[2] = CHAR_L;\n char_code[3] = CHAR_L;\n char_code[4] = CHAR_O;\n char_code[5] = CHAR_COMMA;\n char_code[6] = CHAR_SPACE;\n char_code[7] = CHAR_W;\n char_code[8] = CHAR_O;\n char_code[9] = CHAR_R;\n char_code[10] = CHAR_L;\n char_code[11] = CHAR_D;\n char_code[12] = CHAR_EXCLAMATION;\n\n st *= vec2(13.0, 8.0);\n vec2 st_f = fract(st);\n vec2 st_i = floor(st);\n\n int index = int(st_i.x);\n\n // #if defined(PLATFORM_WEBGL)\n int c = 0;\n for (int i = 0; i < 13; i++) {\n if (i == index) \n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "frag": "#ifdef GL_ES\nprecision mediump float;\n#endif\n\nuniform sampler2D u_tex0;\nuniform vec2 u_tex0Resolution;\n\nuniform vec2 u_resolution;\nuniform float u_time;\n\n#define SAMPLESPRITE_SAMPLER_FNC(TEX, UV) sampleNearest(TEX, UV, u_tex0Resolution)\n\n#include \"lygia/space/ratio.glsl\"\n#include \"lygia/sample/nearest.glsl\"\n#include \"lygia/animation/spriteLoop.glsl\"\n\nvoid main (void) {\n vec4 color = vec4(0.0, 0.0, 0.0, 1.0);\n vec2 pixel = 1.0/u_resolution.xy;\n vec2 st = gl_FragCoord.xy * pixel;\n st = ratio(st, u_resolution);\n\n vec2 grid = vec2(10., 7.0);\n\n float time = mod(u_time * 6.0, 48.0);\n if (time < 6.0)\n color = spriteLoop(u_tex0, st, grid, 0., 2., time);\n else if (time < 12.0)\n color = spriteLoop(u_tex0, st, grid, 3., 6., time);\n else if (time < 18.0)\n color = spriteLoop(u_tex0, st, grid, 13., 16., time);\n else if (time < 24.0)\n color = spriteLoop(u_tex0, st, grid, 23., 26., time);\n el |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "frag": "#ifdef GL_ES\nprecision mediump float;\n#endif\n\nuniform vec2 u_resolution;\nuniform vec2 u_mouse;\nuniform float u_time;\n\n// By default all 2D shapes and space functions asume\n// the center is at vec2(0.5, 0.5), this can be overloaded\n// by defining CENTER_2D to be something else, like vec2(0.0)\n// before the functions are include\n\n// #define CENTER_2D vec2(0.0)\n\n#include \"lygia/draw/fill.glsl\"\n#include \"lygia/space/aspect.glsl\"\n#include \"lygia/space/ratio.glsl\"\n#include \"lygia/space/center.glsl\"\n#include \"lygia/space/uncenter.glsl\"\n#include \"lygia/space/rotate.glsl\"\n\n#include \"lygia/sdf/circleSDF.glsl\"\n#include \"lygia/sdf/crossSDF.glsl\"\n#include \"lygia/sdf/flowerSDF.glsl\"\n#include \"lygia/sdf/gearSDF.glsl\"\n#include \"lygia/sdf/heartSDF.glsl\"\n#include \"lygia/sdf/hexSDF.glsl\"\n#include \"lygia/sdf/polySDF.glsl\"\n#include \"lygia/sdf/rectSDF.glsl\"\n#include \"lygia/sdf/raysSDF.glsl\"\n#include \"lygia/sdf/spiralSDF.glsl\"\n#include |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "frag": "// Copyright Patricio Gonzalez Vivo, 2021 - http://patriciogonzalezvivo.com/\n\n#ifdef GL_ES\nprecision mediump float;\n#endif\n\nuniform vec3 u_camera;\nuniform vec3 u_light;\nuniform vec3 u_lightColor;\n\nuniform vec2 u_resolution;\nuniform vec2 u_mouse;\n\n\n// SPACE\n#define LOOK_AT_RIGHT_HANDED\n#define LIGHT_DIRECTION u_light\n#define RESOLUTION u_resolution\n#define LIGHT_COLOR vec3(0.95, 0.65, 0.5)\n#define RAYMARCH_AMBIENT vec3(0.7, 0.9, 1.0)\n#define RAYMARCH_BACKGROUND (RAYMARCH_AMBIENT + rayDirection.y * 0.8)\n#define DEBUG_FLIPPED_SPACE\n\n#define PYRAMID_POS vec3(2.0, 0.10, 2.0)\n#define CONE_POS vec3(0.0, 0.75, -2.0)\n\n#include \"lygia/space/ratio.glsl\"\n#include \"lygia/draw/matrix.glsl\"\n#include \"lygia/draw/point.glsl\"\n#include \"lygia/draw/axis.glsl\"\n#include \"lygia/space/perspective.glsl\"\n#include \"lygia/math/inverse.glsl\"\n#include \"lygia/math/transpose.glsl\"\n#include \"lygia/sdf.gls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "frag": "\n#ifdef GL_ES\nprecision mediump float;\n#endif\n\nuniform vec2 u_resolution;\nuniform float u_time;\n\n#include \"lygia/math/const.glsl\"\n#include \"lygia/generative/snoise.glsl\"\n#include \"lygia/generative/gnoise.glsl\"\n#include \"lygia/generative/wavelet.glsl\"\n\nfloat gyroid (vec3 p) { return dot(sin(p),cos(p.yzx)); }\n\n#define ROT 5\nfloat ang = TAU / float(ROT);\nmat2 m = mat2( cos(ang), sin(ang),\n -sin(ang), cos(ang));\n\nfloat turb(vec3 p) {\n float result = 0.0, a = 0.5;\n p *= 2.0;\n for (int i = 0; i < ROT; ++i) {\n result += gyroid(p/a)*a;\n p.xy = m * p.xy * 0.75 + result * 0.1;\n p.z += u_time * 0.05;\n a *= 0.5;\n }\n return result;\n}\n\n// #define CURL_FNC(P) turb(P)\n// #define CURL_FNC(P) snoise(vec3((P).xy, (P).z + u_time * 0.5))\n#include \"lygia/generative/curl.glsl\"\n\nvoid main(void) {\n vec4 color = vec4(vec3(0.0), 1.0);\n vec2 pixel = 1.0/u_resolution.xy;\n vec2 st = gl_FragCoord.xy * pixel |
NewerOlder