Fractal Desmos

Fractal Desmos

10 devlogs
39h 56m
•  Ship certified

A graphing calculator for escape time fractals built with Typescript and WebGPU.

Users can input their own equations to render unique and possibly never seen before fractals!

Timeline

Ship 1

1 payout of shell 810.0 shells

Thomas McConkey

about 2 months ago

Thomas McConkey Covers 10 devlogs and 39h 56m

I added those section and panel collapse buttons, some color map options for more variety, and wrote a README.md.

Update attachment

I did a massive UI overhaul on the side panel where I added some tutorial text and preset buttons. I still do want to add some buttons that can optionally hide the side panel and its sections of text, but it's almost 4am and I should probably get some sleep lol.

Update attachment
Eucatastrophe Eucatastrophe about 2 months ago
THIS LOOKS SO COOL!!! sleep well lol

I added support for implicit multiplication, panning, and zooming. The site does, so I kind of want to do a quick rewrite of this project as a desktop app just to see the performance difference.

Update attachment

You can now set the initial z value of the fractal with another math formula entry. I also added sliders for user defined variables. These sliders automatically pop up if there are variables detected in either the z(0) or f(z) math input areas.

Update attachment

I converted the AST into shader code so now different fractals can be rendered based off user input!

Update attachment

I implemented a lexer and parser to generate an Abstract Syntax Tree from the Mathquill Equation text entry (Mathquill is the library the Desmos Graphing Calculator uses). Right now it generates a new AST every time the user changes the equation.

Update attachment

I got a basic Julia Set shader working, and I sort of ported my entire codebase to Typescript... but the WebGPU code is a lot less verbose now and it's easier to integrate everything with the web since I don't have to compile to web assembly everytime.

Update attachment
Thomas McConkey Thomas McConkey about 2 months ago
Hey thanks! I’m glad you like it so far. I am using WebGPU with Typescript for the renderer. As for the equations, each time the user edits the equation, I convert the latex from the formula entry into an Abstract Syntax Tree and then into WGSL (shader code). This then gets inserted into the main, generalized fractal shader which is recompiled to make the changes take effect visually.
Eucatastrophe Eucatastrophe about 2 months ago
this project is sick!! /pos how are you rending equations? just curious.

Spent a bunch of time learning about buffers and shader uniforms in WebGPU. Having past experience with OpenGL definitely helps. Next, I want to get a web build with Emscripten working and hopefully render a basic Julia Set.

Update attachment

Now rendering a triangle! I am going to learn how to use buffers and uniforms in WebGPU next after which I will do some major code organization and try to get this running in the browser using Emscripten.

Update attachment

I got a color rendering to a window lol. It may not look like much, but it took me a long time to learn the basic setup for WebGPU using C++.

Update attachment