Coder Social home page Coder Social logo

skyleilani / fractal-shader Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 10 KB

A fractal shader made in Unity. Offers use with Arduino.

Home Page: https://web-unity-mandelbrot.vercel.app/

C# 44.59% ShaderLab 50.36% C++ 5.05%
shaderlab unity arduino

fractal-shader's Introduction

Fractal Shader

A Unity Fractal explorer based on Mandelbrot set. Options to navigate using WASD(QE) or set it up to use Arduino controls.

Currently still a work in progress in terms of my hardware set up here in person. Base setup currently has two basic buttons. If possible, I'll use conductive paint in the future but seeing what I can do with what I have here instead.

Explore the fractal in your browser here

About the Shader

This shader modifies the traditional Mandelbrot set equation to create a dynamic & interactive fractal exploration experience :)

The classic Mandelbrot set equation is z = z^2 + c, where z and c are complex numbers. I modified the equation to z = rotate(z, 0, _Time.y) + c, where the value of z is passed through a function "rotate" first. This function applies a rotation to the point, and then the resulting value of z is added to c. This modification causes the Mandelbrot set to rotate over time, as the rotation angle is controlled by the _Time.y variable.

The equation is used to calculate the position of each pixel on the canvas, and the resulting value is used to determine the color of the pixel. I thought fragment shaders were so exciting for this because they allow such precise dictation of the behavior of individual pixels.

In the fragment shader, the current position of the pixel is calculated and then passed through the Mandelbrot equation, which calculates the distance of the pixel from the origin of the fractal. This distance is then used to determine the color of the pixel. The loop breaks out when the distance exceeds a certain threshold, known as the escape radius. This creates the characteristic shape of the Mandelbrot set.

This is not an infinite generation of fractals! It's limited and finite <3

fractal-shader's People

Contributors

skyleilani avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.