Follow

set mashed up with algebra (a la ) rendered with in fork of

My highly over-engineered extravagant framework of shaders including each other multiple times with different things defined (to emulate C++ templates with function overloading without polymorphism) takes significantly longer to link the than it does to render the .

First attempts with typos gave 100k lines of cascaded errors in the shader info log, which which the Qt GUI list widget was Not Happy At All. Luckily the log went to stdout too, so I could pipe to a file and see the start where I missed a return statement or two.

Source code for the core formula definition:

```

/*
Experimental Magnet-Mandelbrot bulb triplex fractal.
Type 1: z_{n+1} = [(z_n^2 + c-1) / (2z_n + c-2)]^2
*/

MAGNETBULB(TRIPLEX, VEC, real) \
void Magnetbulb1Triplex(inout VEC w, in VEC c) \
{ \
TRIPLEX one = TRIPLEX(real(1), real(0), real(0)); \
TRIPLEX two = TRIPLEX(real(2), real(0), real(0)); \
TRIPLEX d = TRIPLEX(c.v[0], c.v[1], c.v[2]); \
TRIPLEX z = TRIPLEX(w.v[0], w.v[1], w.v[2]); \
z = sqr(div(add(sqr(z), sub(d, one)), add(add(z, z), sub(d, two)))); \
w.v[0] = z.x; \
w.v[1] = z.y; \
w.v[2] = z.z; \
w = add(w, c); \
}
MAGNETBULB(Triplexfx, Vec3fx, floatx)
MAGNETBULB(TriplexDual3f, Vec3Dual3f, dual3f)
MAGNETBULB
```

The rest of the framework is Too Big To Toot.

Show thread

Rendered a longer video of the Magnet Mandelbrot vs Mandelbulb Triplex mashup:

mathr.co.uk/de/magnetbulb-3.mp (100MB, 1920x1080p25, 45 seconds)

Has some sphere marching overstepping that is Very Visible thanks to the motion, didn't notice it in the still image before rendering, unfortunately.

Show thread

@mathr This is so incredibly beautiful! I want to learn how to do stuff like this, it’s exactly the kind of thing I’m looking to create for a future dance performance. What would be a good route towards that? I’ve dabbled a bit in openFrameworks, but not yet much in shaders...

@kf I used Fragmentarium (3Dickulus' FragM fork (version 2.5.3)) but Mandelbulber might be more user friendly to get started. render time was 2 days for 45 seconds, this one wasn't a realtime fractal...

@kf github.com/3Dickulus/FragM github.com/buddhi1980/mandelbu

FragM is sort of DIY shader stuff (GLSL) tutorial here: blog.hvidtfeldts.net/index.php

Mandelbulber2 has more built for you and better tools for timeline animation etc (uses OpenCL (fast on GPU, but not all features are implemented yet) or a CPU renderer (slower))

@kf neither are designed for realtime animation, rather near-realtime exploration in low quality then rendering in high quality, but FragM is great for protoyping shaders because you can bind sliders and other widgets to the shader variables and play around quickly without having to keep on rebuilding a program

@mathr Awesome, thanks a lot for the pointers! Eventually I'll probably need something that can render in realtime and respond to input from movement sensors, so I won't be even close to the kind of rendering quality you've got, but sometimes you only need a pointer in the right direction to get somewhere interesting...

Sign in to participate in the conversation
post.lurk.org

Welcome to post.lurk.org, an instance for discussions around cultural freedom, experimental, new media art, net and computational culture, and things like that.