claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

Implemented a double helix based on an idea from 's `Knot.frag` (not knighty's, the other one, based on forum posts by DarkBeam).

Not sure how to -ize it, wanted to turn it into a of helices of helices etc. Nor how to make it a single helix (I only managed to colour the two halves individually...).

I think each strand is an Archimedean Serpentine, but I'm not 100% sure on terminology..

```
330 compatibility

providesColor
"MathUtils.frag"
"Complex.frag"
"DE-Raytracer.frag"

Helix

uniform float HelixD; slider[0.0,2.0,10.0]
uniform float HelixR; slider[0.0,1.0,10.0]
uniform float Helixr; slider[0.0,0.5,10.0]

uniform float time;

float DE(vec3 q)
{
q.z += HelixD * time;
float t = (mod(q.z / HelixD + 0.5, 1.0) - 0.5) * 2.0 * PI;
q.xy *= mat2(cos(t), sin(t), -sin(t), cos(t));
q.z = 0;
float s = atan(HelixD / (2.0 * PI), HelixR);
q.yz *= mat2(cos(s), -sin(s), sin(s), cos(s));
return length(vec2(length(q.xy) - HelixR, q.z)) - Helixr;
}

vec3 baseColor(vec3 q, vec3 n)
{
q.z += HelixD * time;
float t = (mod(q.z / HelixD + 0.5, 1.0) - 0.5) * 2.0 * PI;
q.xy *= mat2(cos(t), sin(t), -sin(t), cos(t));
return vec3(0.5) + 0.5 * sign(q.x) * n;
}
```

#fragmentarium #ThreeD #shader #glsl #opengl #group #include #define #version #helix #fractal #fragm #DistanceEstimate

Last updated 4 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

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.

#animation #shader #glsl #fragmentarium #fragm #DistanceEstimation #DualNumber #mandelbulb #triplex #ThreeD #fractal #mandelbrot #magnet

Last updated 4 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

Hacking on fork to make it possible to load arbitrary channels from image files (for example, raw fractal iteration data saved from ).

It mostly works, except when enabling time-based animation (seems channels reset to RGBA? investigating...). The attached GIF was done with manual stop motion instead of the animation render functionality.

#fragmentarium #fragm #exr #kf

Last updated 5 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

I fixed it by rewriting the code with a new approach tracking Provenance (which shader(s) the uniform is active in) of widget changes, instead of having multiple VariableEditors which was causing too many headaches (and I think that was ultimately a bad approach).

#fragmentarium #cplusplus

Last updated 5 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

Hacking on fork, to make the Post uniforms (things like Exposure, Contrast, Hue adjustment etc) in the BufferShader really be post-rendering (the Main shader accumulates subframes for anti-aliasing, which accumulation is fed through the BufferShader for display).

Before now, adjusting Exposure would lose all accumulated subframes. After my changes (and modifying the user frag source a little; message printouts say what needs to be done), adjusting Exposure keeps the accumulated subframes, giving a much more pleasant experience.

Hopefully it will be merged into 3Dickulus' master branch soon.

#fragmentarium #fragm #cplusplus #glsl

Last updated 5 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

Added rotation and skew to FragM's Camera2D code. Doing it only in the shaders is not possible because the mouse interactions don't match up with the image.

#fragmentarium #cplusplus #glsl

Last updated 5 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org
claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

colour according to angle of gradient (wrt image coordinates) of continuous escape time. one direction is more saturated, this direction is animated.

```
vec3 shade(float d00, float d01, float d10, float d11)
{
vec2 e = vec2(d00 - d11, d01 - d10);
float de = 1.0 / (log(2.0) * length(e));
float slope = dot(normalize(e), normalize(vec2(cos(radians(LightDirection)), sin(radians(LightDirection)))));
if (0.0 == d00 * d01 * d10 * d11 || isinf(de) || isnan(de)) return vec3(0.0);
vec3 h = hsv2rgb(vec3(degrees(atan(e.y, e.x)) / 360.0, clamp(slope, 0.0, 1.0), 1.0));
return h * tanh(clamp(4.0 * de, 0.0, 4.0));
}
```

#colour #cycling #loop #fractal #glsl #fragmentarium

Last updated 5 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

rendered a with version of

the trick is to replace (in your camera frag vertex block) all uses of the `Zoom` uniform by `Zoom*pow(2.0, ZoomFactor)` and add a Linear easing curve to new `ZoomFactor` uniform.

keep ZoomFactor at 0 while navigating for sanity

this toot brought to you by "Qt's InExpo easing curve is a bit rubbish" code.qt.io/cgit/qt/qtbase.git/

#2d #fractal #zoom #video #fragm #fragmentarium

Last updated 5 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org
claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

I ported some of the formulas I use in to , for faster rendering. Because of legacy baggage in the existing code of I started work on a new framework for 2D fragment within FragM.

Similar in spirit to (my physically inspired raytracer for FragM), only with the added complication of wanting to support double precision ( 4) where available, while still working to some extent (without so deep zooms) on single precision float (OpenGL 3) if that is all the can do. Only single precision is implemented so far.

#fractal #et #fragmentarium #fragm #trudy #glsl #shaders #raymond #opengl #gpu

Last updated 5 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

I added light sampling to Raymond: for diffuse opaque surfaces it is vastly more efficient (less noise for given rendering time) than random sampling, at the cost of double the number of rays to trace (an additional one from each surface hit directly towards a light).

Not so beneficial for shiny opaque surfaces in one test. And it breaks rendering of transparent objects (refractive caustics disappear).

code.mathr.co.uk/raymond/commi

#raytracing #mandelbulb #fragmentarium #threedee #fractals

Last updated 6 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

for viewing

depth map exported from (one of the examples that comes with it)

horizontally repeating fractal texture made with (modulusx final transform).

combined with homemade software. final image had autolevels applied to brighten it up before downscaling to 1920x1080@100dpi

I think this one turned out ok despite the depth discontinuities.

#autostereogram #crosseyed #fragmentarium #fractorium

Last updated 6 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

for viewing

map exported to from my "raymond" thingy implemented in inside , converted to using . EXR data must be in [0..1] for GIMP to understand it (otherwise it clips, not sure if it's clipped by FragM or GIMP). Not sure if sRGB non-linear response curve is mangling my data.

texture from a photo I took, cropped into a narrow vertical strip and made in

depth and texture combined with . took many iterations to get something that didn't make my eyes hurt too much. depth is jarring, too-small texture detail is distracting.

Refs:
- paulbourke.net/dataformats/pbm for PFM file format (like PGM/PPM but float32 data)

#autostereogram #crosseyed #depth #exr #raytracing #glsl #fragmentarium #pfm #gimp #fabric #seamless #homemade #software #discontinuity

Last updated 6 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

"2D.frag"
vec3 glitch(vec2 pos) { if (length(pos) < 0.1) return fract(pos.xyy) / 0.1; else 0.0; }
vec3 color(vec2 pos) { return glitch(pos); }
// note no return in else branch - > undefined behaviour, surprised it even compiles...

#include #opengl #glsl #glitch #fragmentarium

Last updated 6 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

is also inspirational praxislive.org/

it may be my new toy for live shader programming

was having no end of trouble with and core profile requirements on my laptop (the nvidia proprietary driver lets you use deprecated functionality together with new stuff, but the nouveau driver only lets you use the new stuff - and my hardware is now in legacy maintainence mode, not to mention nvidia's truly evil licensing requirements..)

the only sticking point will be whether i can have a library of shader code that i can include in all my shaders without too much trouble, because i don't want to copy-paste (eg) complex number maths all over the place.

#praxislive #fragmentarium #mesa #opengl

Last updated 6 years ago