Skip to content

zett42/plasmafractal-gl

Repository files navigation

PlasmaFractal

Screenshot

Oldschool PlasmaFractal revival with Perlin Noise and WebGL. Fully customizable via dynamic VueJS based UI.

Basic algorithm (fragment shader):

  • For each pixel, grayscale value is calculated by calling Perlin Noise or other noise functions.
  • RGB color is generated by using grayscale value as palette index.
  • To produce fractal, calculate noise function multiple times per pixel with increasing frequency and decreasing amplitude.
  • Optional domain warping:
    • Distort the space by applying another noise function to the input coordinates of the final noise function. Most tutorials simply add noise values to the coordinates, while more interesting results can be achieved with other techniques, e. g. using polar coordinates.

Animation

  • Noise can be mutated by taking a slice of 3D noise and incrementing the Z position over time.
  • A turbulence effect can be achieved by incrementing the Z position faster for each octave of fractal.
  • Palette can be animated by rotating the palette entries and by blending between random colors.
  • Double-click to toggle fullscreen.
  • Press the "gear" button in the top-left corner to adjust plasma options.
  • When you are happy with your settings, share the Permalink with your friends.

Requirements and browser support:

  • Requires WebGL2 support by browser.
  • ✅ Tested successfully with Chrome v77.0.3865.90, Opera v63.0.3368.94, Firefox v69.0.1
  • Best performance observed in Chromium-based browsers like Chrome and Opera.

Preset Links

Fiery Dirty Contrast on White - by Nickelartist Neon Tapes Lines and Clouds - by Nickelartist Lava Lamp Golden Lines Golden Circles Cellular milk greY - by Nickelartist Cosmic Energy Agate Blue/Yellow Monochromatic Stripes Dark Complexity Graphical Flux Petrol Lake (Domain Warping) Sulfur (Domain Warping) Gradient Pattern (Domain Warping)

Develop

# Install
npm install
npm install -g @vue/cli
    
# Build & Serve
vue ui
    
# Build Release
npm run build

To open the release build locally in a browser, you must use a local web server. The root folder must be the project directory, so that there is a "plasmafractal-gl" sub folder in the URL: http://127.0.0.1:8080/plasmafractal-gl/index.html

Credits

This project uses the following open source libraries. Each library comes with its own license terms, which can be found in the source code included in this project.

Special thanks to

  • stackoverflow

    • So many helpful answers, too many to credit them individually. Kudos to this awesome community!
  • Nickelartist

    • For many inspirations and some awesome presets.