title: WebGL/GLSL - How does a ShaderToy work?
body: <p>I've been knocking around Shadertoy - <a href="https://www.shadertoy.com/">https://www.shadertoy.com/</a> - recently, in an effort to learn more about OpenGL and GLSL in particular. </p>
  
  <p>From what I understand so far, the OpenGL user first has to prepare all the geometry to be used and configure the OpenGL server (number of lights allowed, texture storage, etc). Once that's done, the user then has to provide at least one vertex shader program, and one fragment shader program before an OpenGL program compiles.</p>
  
  <p>However, when I look at the code samples on Shadertoy, I only ever see one shader program, and most of the geometry used appears to be written directly into the GLSL code.</p>
  
  <p>How does that work?</p>
  
  <p>My guess is that a vertex shader is already prepared upfront, and that the editable/sample shader is only a fragment shader. But then that doesn't explain the geometry in some of the more complex examples...</p>
  
  <p>Can anyone explain how Shadertoy works?</p>