Psilly.com
🍄
Relax, get psilly...
Login
Art
Listen
Watch
Read
Play
Talk
Chat
Jam
FAQ
About
Contact
WebGL Canvas Template
, 2021
JavaScript on WebGLRenderingContext
Good luck!
<sauce/>
This art requires JavaScript.
Shaders
Vertex Shader
#version 300 es in vec2 a_position; in vec4 a_color; out vec4 v_color; void main(void) { gl_Position = vec4(a_position, 0.0, 1.0); v_color = a_color; }
Fragment Shader
#version 300 es #ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; #else precision mediump float; #endif uniform float u_time; uniform vec2 u_translate; uniform vec2 u_scale; out vec4 fragmentColor; void main() { float m_0 = ( gl_FragCoord.x + u_translate.x ) * u_scale.x; float m_1 = ( gl_FragCoord.y + u_translate.y ) * u_scale.y; float radiusSquared = pow(sin(u_time/60.0), 2.0); bool inside = m_0*m_0 + m_1*m_1 < radiusSquared; fragmentColor.r = fragmentColor.b = inside ? 0.5 : 0.0; }
Loading...
Loading...