https://github.com/jxckgan/mandelbrot-unityapp
An interactive Unity App which uses shaders to render the Mandelbrot Fractal.
https://github.com/jxckgan/mandelbrot-unityapp
fractal mandelbrot unity unity3d unityapp
Last synced: 10 months ago
JSON representation
An interactive Unity App which uses shaders to render the Mandelbrot Fractal.
- Host: GitHub
- URL: https://github.com/jxckgan/mandelbrot-unityapp
- Owner: jxckgan
- License: mit
- Created: 2022-06-12T09:04:45.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-15T20:10:26.000Z (about 1 year ago)
- Last Synced: 2025-04-15T21:23:43.461Z (about 1 year ago)
- Topics: fractal, mandelbrot, unity, unity3d, unityapp
- Language: ShaderLab
- Homepage:
- Size: 14.5 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
Mandelbrot Explorer

### About
Mandelbrot-UnityApp is an application built in Unity which utilises basic shadertoy scripts. Mandelbrot-UnityApp features a camera controller, allowing you to glide within the Mandelbrot Set.
### Controls
Below are the controls for navigating through the program:
- W, A, S, D: Up, Down, Left, Right
- I: Zoom In
- O: Zoon Out
- L: Rotate Left
- R: Rotate Right
Through the use of the `Lerp` function in Unity, we have a nice, smooth, navigation experience of the fractal. This is accomplished with the use of:
```cs
smoothPos = Vector2.Lerp(smoothPos, pos, .03f); // Movement
smoothScale = Mathf.Lerp(smoothScale, scale, .03f); // Zooming in + out
smoothAngle = Mathf.Lerp(smoothAngle, angle, .03f); // Rotating
float aspect = (float)Screen.width / (float)Screen.height;
float scaleX = smoothScale;
float scaleY = smoothScale;
if(aspect > 1f)
scaleY /= aspect;
else
scaleX *= aspect;
mat.SetVector("_Area", new Vector4(smoothPos.x, smoothPos.y, scaleX, scaleY));
mat.SetFloat("_Angle", smoothAngle);
```
### Known Issues
Zooming is limited, after a certain range the fractal will begin to pixelate and you won't be able to zoom in further.
## Screenshots
