Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


WebGL Ray Marching Distance Extimation intersection between MandelBulb and MengerSponge cube

Live wglMengerBulb example


  • light (blinn-phong) and shadows with full settings
  • ambient occlusion with settings
  • subpixel subdivision
  • level of details (epsilon)
  • auto-progressive step of accuracy.
  • settings MengerSponge parameters: iterations / rotation / increment / scale / offset
  • settings MandelBulb parameters: iterations / power
  • 10 palettes with offset setting


Shadow Deep and Density parameters start with a low value (for slow GPU): increment values to get a better render (Deep) or for smooth shadows (Density)


  • LeftMouseButton -> Rotate object
  • RightMouseButton -> Rotate light
  • MouseWheel -> Zoom in/out
  • shift + LeftMouseButton -> Pan


This is pure WebGL 2.0 Experiment, without 3th party WebGL tools/library.

It uses only gl-matrix js library for mat/vec/quat, and other self-made tools in the jsLib directory


For standalone use, on local computer, need of an http server to load external glsl shader file.

Commons workarounds

For safety the browsers can't load external files from local machine, but if you want to test this experiment, without a http server, you can use a workaround:


Launch browser with --allow-file-access-from-files command line option.

Firefox (from v.68 and above: before works fine w/o any settings)

In about:config url (config page), set privacy.file_unique_origin = false

You can’t perform that action at this time.