Skip to content

AdamColton/asmJsMandelbrot

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

Asm.js Mandelbrot

I wanted to try writing some asm.js (by hand) to understand it's structure. Rendering the Mandelbrot set seemed like a good problem.

I may come back to this at somepoint and add support for Web Workers, using transfer objects it would add a notible performance gain.

Very little code is actually used in computing the set, lines 238-251 and 203-218. It was easier to repeat the algorthm to accomodate the differences in the two shading styles.

The Zebra shading is the most direct approach, and here we choose to highlight the escape bands. Lines 64-129 run a simple smoothing algorithm by averaging each pixel with it's 8 neighbors.

The smoothing algorithm is take directly from the Wikipedia article.

All rendering parameters are kept in the URL, so interesting coordinates can be bookmarked or shared. Such as these:

Have fun!

About

Mandelbrot set in Asm.Js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages