ScrapExplorer - Circle.glsl

Home / misc / GLSL Lines: 1 | Size: 532 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1/* GLSL Examples 2 * A collection of GLSL examples for use with the Shader toy website and other 3 * GLSL environments. 4 * By: 0x4248 5 * 6 * Circle animate. 7 * Draws a circle that moves around the screen. 8 */ 9 10void mainImage(out vec4 fragColor, in vec2 fragCoord) { 11 vec2 center = vec2(0.5, 0.5); 12 13 float radius = 0.3; 14 15 vec2 uv = fragCoord.xy / iResolution.xy; 16 17 float distance = length(uv - center); 18 19 if (distance < radius) { 20 fragColor = vec4(1.0, 1.0, 1.0, 1.0); 21 } else { 22 fragColor = vec4(0.0, 0.0, 0.0, 1.0); 23 } 24} 25
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.