Created
February 17, 2026 18:16
-
-
Save patriciogonzalezvivo/ec745fde833013d6d972f6a0513a1403 to your computer and use it in GitHub Desktop.
Char
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 c = char_code[i];\n }\n // #else\n // int c = char_code[index];\n // #endif\n\n color.rgb += char(st_f, c) * (st_i.y / 8.0);\n\n gl_FragColor = color;\n}\n", | |
| "vert": "#ifdef GL_ES\nprecision mediump float;\n#endif\n\nattribute vec4 a_position;\nvarying vec4 v_position;\n\nvoid main() {\n v_position = a_position;\n gl_Position = a_position;\n}\n", | |
| "commands": [ | |
| "plot,off", | |
| "textures,off", | |
| "buffers,off", | |
| "cubemap,off", | |
| "camera_position,-0,-0,-2", | |
| "camera_look_at,0,0,0", | |
| "camera,default" | |
| ], | |
| "assets": {}, | |
| "history": [ | |
| { | |
| "gistId": "38226dd10b4baeaf889a80c5ecc59d06", | |
| "owner": { | |
| "login": "patriciogonzalezvivo", | |
| "id": 346914, | |
| "avatar_url": "https://avatars.githubusercontent.com/u/346914?v=4" | |
| }, | |
| "loadedAt": "2026-02-17T18:15:15.181Z" | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment