GithubHelp home page GithubHelp logo

angramme / fractal_viewer Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 7.05 MB

A simple ray-marched fractal renderer in Processing and GLSL

GLSL 62.39% Processing 37.61%
fractals fractal menger-sponge koch-fractal koch-curve ray-tracing raymarcher ray-marching processing glsl opengl raytracer

fractal_viewer's Introduction

Fractal Viewer!

This is a prototype! A version written in Rust using gfx-rs along with compute shaders for better performance is eventually planned.

I made a WebGL based version here. See the code here

This simple renderer uses GLSL accelerated Ray Marching and a host program written in the Processing language to display fractals.

It can render any fractal which can be defined with a signed distance function (SDF).

Right now only some fractals defined with IFS are present by default.

Running the program

Install Processing if you haven't already and run the program as any other Processing sketch.

You can also download the prebuilt binaries located in releases.

Controls

key sequence action
right/left arrow switch between fractals
drag mouse rotate the fractal
drag mouse + L change the light direction
drag mouse + R rotate the camera
drag mouse + P change the orientation of the cut plane
scroll zoom in and out
scroll + shift zoom in and out (slower)
scroll + I change the number of iterations
scroll + R change the number of reflection bounces
scroll + P change the position of the cut plane
scroll + P + shift change the position of the cut plane (slower)
S reload shader
C save screenshot

Gallery

Menger Sponge

menger1 menger2 menger5 menger4

Koch Curve

koch4 koch1 koch2

Jerusalem Cube

jerusalem1 jerusalem2 jerusalem3 jerusalem4

Experiment on your own

You can modify the shader to change the color and other attributes. Hit the S button on your keyboard once the program is running to reload the shader.

You can also add your own fractals just by adding another file inside the fractals folder.

fractal_viewer's People

Contributors

angramme avatar

Stargazers

 avatar  avatar  avatar  avatar  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.