this is my first WebGL-experiment.

this sketch builds a fractal, which can be modified by the ui-sliders. it will slow down significantly if the recursion-level is to high. but still, its remarkably fast, considering, how many vertices are rendered.

the model-vertices are generated in a simple class, using some vector calculations. three vbo’s are filled with the vertex-data (vertices, normals, recursion-level). the vertices get their color in the vertex-shader, depending on their recursion-depth. the lightning is done in the fragment-shader.

the geometry is only modified, when the slider-values change, so to keep an acceptable framerate at a high number of vertices.

check the live-version: webgl_fractal


i noticed, that the sketch won’t run on some browsers (IE, …). if so, check:

  • if you have the newest browser (it should run with firefox and chrome)
  • webgl is enabled
  • javascript is enabled

if the live-version won’t work, have a look at the screenshots,