I have some Fragmentarium code that I would like to convert so it will work in Blender anyone have any ideas how I can do this?
The code is below:
#include "Progressive2D.frag"
#group Spiral
uniform int StripesNum; slider[1,10,100]
uniform int StripesAng; slider[-180,45,180]
uniform float StripesThinkness; slider[0,0.5,1]
uniform float CenterHole; slider[0,0.125,1]
uniform float OuterHole; slider[0,0.825,1]
const float pi = 3.141592653589793;
vec2 cLog(vec2 z)
{
return vec2(log(length(z)), atan(z.y, z.x));
}
vec3 color(vec2 p)
{
float t = radians(float(StripesAng));
float c = cos(t);
float s = sin(t);
mat2 m = mat2(c, -s, s, c);
vec2 q = m * cLog(p);
return vec3(float
( mod(float(StripesNum) * q.y / (sqrt(2.0) * pi), 1.0) < StripesThinkness
|| length(p) < CenterHole
|| length(p) > OuterHole
));
}
Here's the animation of the code working in Fragmentarium
Here's the animation of moire patterns, I'm trying to recreate this in Blender so I can animate multiple copies of spirals turning at different rates (along with using sliders to adjust variables) to produce different moire patterns.
Note: // Progressive2D.frag This is a utlity / include for the program to set up anti-aliased 2D rendering. Progressive2D.frag code location