https://github.com/alordash/newton-fractal
Drawing Newton's fractal using pure js, rust-wasm, SIMDs, threads and GPU
https://github.com/alordash/newton-fractal
glsl newton-fractal newton-fractals newton-method newtons-fractal rust simd threads wasm web-worker webgl webgl2
Last synced: 2 months ago
JSON representation
Drawing Newton's fractal using pure js, rust-wasm, SIMDs, threads and GPU
- Host: GitHub
- URL: https://github.com/alordash/newton-fractal
- Owner: alordash
- Created: 2022-01-24T16:40:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-24T15:44:03.000Z (almost 3 years ago)
- Last Synced: 2025-02-27T09:49:05.841Z (3 months ago)
- Topics: glsl, newton-fractal, newton-fractals, newton-method, newtons-fractal, rust, simd, threads, wasm, web-worker, webgl, webgl2
- Language: TypeScript
- Homepage: https://alordash.github.io/newton-fractal/www/index.html
- Size: 834 KB
- Stars: 105
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Newton's fractal
Runtime [Newton's fractal](https://en.wikipedia.org/wiki/Newton_fractal) renderer.
### [>>Click<<](https://alordash.github.io/newton-fractal/www/index.html) to open in your browser
Inspired by [3blue1brown](https://www.3blue1brown.com/)'s [video about Newton's fractal](https://youtu.be/-RdOwhmqP5s).

## Build
1. Rust-wasm:
`wasm-pack build --target web`
2. TypeScript:
`tsc`## Drawing techniques
### 1. Javascript [fractal_calculation.ts](https://github.com/alordash/newton-fractal/blob/main/scripts/math/fractal_calculation.ts) and [geometry.ts](https://github.com/alordash/newton-fractal/blob/main/scripts/math/geometry.ts)
### 2. **Rust-WASM**: scalar [fractal_calculation.rs](https://github.com/alordash/newton-fractal/blob/main/src/fractal_calculation.rs) and [geometry.rs](https://github.com/alordash/newton-fractal/blob/main/src/geometry.rs)
### 3. **Rust-WASM**: [SIMD](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data) commands [fractal_calculation.rs](https://github.com/alordash/newton-fractal/blob/main/src/fractal_calculation.rs) and [simd_math.rs](https://github.com/alordash/newton-fractal/blob/main/src/simd_math.rs) (includes comments)
### 4. **GPU glsl**sources: [webgl2_drawing.ts](https://github.com/alordash/newton-fractal/blob/main/scripts/webgl/webgl2_drawing.ts) and [gl_manager.ts](https://github.com/alordash/newton-fractal/blob/main/scripts/webgl/gl_manager.ts)
shaders: [vertex.vert](https://github.com/alordash/newton-fractal/blob/main/webgl/vertex.vert) and [fragment.frag](https://github.com/alordash/newton-fractal/blob/main/webgl/fragment.frag)### 5. **Multithreading** for 1-3 techniques[drawing_manager.ts](https://github.com/alordash/newton-fractal/blob/main/scripts/drawing/drawing_manager.ts) and [drawing_worker.ts](https://github.com/alordash/newton-fractal/blob/main/scripts/drawing/drawing_worker.ts)