xforms for Chaotica
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

601 lines
16 KiB

<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="hysteria">
<!-- based on a transform by dark-beam, http://jwildfire.org/forum/viewtopic.php?f=23&t=1464
Translated to winter by TataSZ. edited by Crystalize -->
<node name="input_params">
<real name="hysteria">1</real>
<real name="hysteria_alpha">0</real>
<real name="hysteria_beta">1</real>
<real name="hysteria_gamma">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="alpha" />
<real name="beta" />
<real name="gamma" />
</node>
<int name="num_unit_randoms">1</int>
<string name="winter_init_function">
<![CDATA[
hysteria_init_result(hysteria, hysteria_alpha, hysteria_beta, hysteria_gamma)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
xy0 = p_in * weight
r = dot(xy0, xy0)
t = r * beta / 2
XY = vec2(abs(xy0.x) - t, abs(xy0.y) - t)
r2 = length(XY)
in1 = (r < 1.0)
condition =
if in1 && (r2 < 1.0) then
unit_rnd_0 > 0.35
else
!in1
in
if condition then
xy0
else
let
cosa = cos(pi() * alpha)
sina = sin(pi() * alpha)
xx = xy0.x * cosa + xy0.y * sina
yy = xy0.x * sina + xy0.y * cosa
n = halfpi() * gamma / 2
nx = xx / sqrt(n - yy * yy) * (n - sqrt(n - (-abs(yy) + n) * (-abs(yy) + n)))
xx2 = nx * cosa + yy * sina
yy2 = -nx * sina + yy * cosa
in
vec2(xx2, yy2)
]]>
</string>
</transform_def>
<transform_def name="gaussian2">
<node name="input_params">
<real name="gaussian2">1</real>
<real name="gaussian2_x">1</real>
<real name="gaussian2_y">1</real>
<real name="gaussian2_z">1</real>
<real name="gaussian2_mod">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="ex" />
<real name="wy" />
<real name="zi" />
<real name="mod" />
</node>
<int name="num_gauss_randoms">1</int>
<int name="num_unit_randoms">2</int>
<string name="winter_init_function">
<![CDATA[
gaussian2_init_result(gaussian2, gaussian2_x, gaussian2_y, gaussian2_z, gaussian2_mod * halfsqrt2())
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
r = unit_rnd_0 * halfpi()
n = sqrt(weight) / 2 * mod
a =
if zi == 1 then
acos(r) * twopi() * zi
else
acos(n) * tanh(zi)
s = gauss_rnd_0 * weight
in
vec2(cos(a) * ex, sin(a) * wy) * s + p_in
]]>
</string>
</transform_def>
<transform_def name="flux2">
<node name="input_params">
<real name="flux2">1</real>
<real name="flux2_s">0</real>
<real name="flux2_p">1</real>
<real name="flux2_m">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="spread" />
<real name="pe" />
<real name="em" />
</node>
<string name="winter_init_function">
<![CDATA[
flux2_init_result(flux2, flux2 * (flux2_s + 2), flux2_p, flux2_m)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
x_plus_weight = p_in.x + pe
x_less_weight = p_in.x - em
num = x_plus_weight * x_plus_weight + p_in.y * p_in.y
den = x_less_weight * x_less_weight + p_in.y * p_in.y
a = (atan2(p_in.y, x_less_weight) - atan2(p_in.y, x_plus_weight)) * 0.5
r = spread * sqrt(sqrt(num / den))
in
vec2(cos(a), sin(a)) * r
]]>
</string>
</transform_def>
<transform_def name="gloonian_early">
<node name="input_params">
<real name="gloonian">1</real>
<real name="gloonian_a">1.5</real>
<real name="gloonian_b">1</real>
<real name="gloonian_c">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="ay" />
<real name="be" />
<real name="ci" />
</node>
<int name="num_unit_randoms">1</int>
<string name="winter_init_function">
<![CDATA[
gloonian_early_init_result(gloonian * halfsqrt2(), gloonian_a, gloonian_b, gloonian_c)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
r2 = dot(p_in, p_in) * ci
sr = sqrt(r2) / be
aux = if r2 > 1 then ay else -ay
w2 = weight * weight
r =
if r2 < w2 then
weight * sqrt(w2 / r2 - ci)
else
weight * be
in
if unit_rnd_0 < 0.5 then
vec2(aux * sqrt(sr + p_in.x) * r, -p_in.y / sqrt(sr + p_in.x)) * weight * r
else
vec2(aux * sqrt(sr + p_in.x) * r, p_in.y / sqrt(sr + p_in.x)) * (weight / sr) * r
]]>
</string>
</transform_def>
<transform_def name="moarface">
<!-- based on an Apophysis variation by Joel Faber and Michael Faber. Variables by Crystalize -->
<node name="input_params">
<real name="moarface">1</real>
<real name="moarface_x">1</real>
<real name="moarface_y">1</real>
<real name="moarface_z">1</real>
<real name="moarface_n">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="ex" />
<real name="wy" />
<real name="ze" />
<real name="en" />
</node>
<string name="winter_init_function">
<![CDATA[
moarface_init_result(moarface, moarface_x, moarface_y, moarface_z, moarface_n)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
if p_in.x > 0.0 then
let
a = atan2(p_in.y, p_in.x)
r = ex / length(p_in)
s = sin(a) * wy
c = cos(a) * ze
in
vec2(c, s) * (weight * r)
else
p_in * weight * en
]]>
</string>
</transform_def>
<transform_def name="arctanh2">
<!-- Transform by TataSZ. Variables by Crystalize -->
<node name="input_params">
<real name="arctanh2">1</real>
<real name="arctanh2_x">1</real>
<real name="arctanh2_y">1</real>
<real name="arctanh2_z">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="ex" />
<real name="wy" />
<real name="ze" />
</node>
<string name="winter_init_function">
<![CDATA[
arctanh2_init_result(arctanh2 * invpi(), arctanh2_x, arctanh2_y, arctanh2_z)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
z = complex(p_in.x, p_in.y) * ze
result = weight * log((z + ex) / (-z + wy))
in
vec2(result.re, result.im)
]]>
</string>
</transform_def>
<transform_def name="tanh2">
<!-- Complex vars by cothe. Tatasz added a pi re-scale. Variables by Crystalize -->
<node name="input_params">
<real name="tanh2">1</real>
<real name="tanh2_x">0.5</real>
<real name="tanh2_y">0.5</real>
<real name="tanh2_z">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="ex" />
<real name="wy" />
<real name="ze" />
</node>
<string name="winter_init_function">
<![CDATA[
tanh2_init_result(tanh2, tanh2_x, tanh2_y, tanh2_z)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
x = ex * pi() * p_in.x
y = wy * pi() * p_in.y
tanhsin = sin(y)
tanhcos = cos(y)
tanhsinh = sinh(x)
tanhcosh = cosh(x)
tanhden = if ze > 1 then ze / (tanhcos + tanhcosh) * log(sqrt(ex / wy)) else ze / (tanhcos + tanhcosh)
in
vec2(tanhsinh, tanhsin) * (weight * tanhden)
]]>
</string>
</transform_def>
<transform_def name="elliptix">
<node name="input_params">
<real name="elliptix">1</real>
<real name="elliptix_x">1</real>
<real name="elliptix_y">1</real>
<real name="elliptix_z">-0.05</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="ex" />
<real name="wy" />
<real name="ze" />
</node>
<string name="winter_init_function">
<![CDATA[
elliptix_init_result(elliptix * twoinvpi(), elliptix_x, elliptix_y, elliptix_z)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
tmp = dot(p_in, p_in) + 1
x2 = if ex > 0 then 2 * p_in.x else 2 * p_in.y
xmax = 0.5 * (sqrt(tmp + x2) + sqrt(tmp - x2))
a = p_in.x / xmax
#b = sqrt(max(0, 1 - a * a))
w = if p_in.y > 0 then weight else -weight
fx = asin(a) * weight / wy
#fx = atan2(a, b) * weight
fy = if ze < 0 then log(xmax + sqrt(max(0, xmax - 1))) * w else log(xmax + sqrt(max(0, xmax - 1))) * ze * wy
in
vec2(fx, fy)
]]>
</string>
</transform_def>
<transform_def name="ellipticplane">
<node name="input_params">
<real name="ellipticplane">1</real>
</node>
<node name="internal_params">
<real name="weight" />
</node>
<string name="winter_init_function">
<![CDATA[
ellipticplane_init_result(ellipticplane * twoinvpi())
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
tmp = dot(p_in, p_in) + 1
x2 = 2 * p_in.x
xmax = 0.5 * (sqrt(tmp + x2) + sqrt(tmp - x2))
a = p_in.x / xmax
#b = sqrt(max(0, 1 - a * a))
w = if p_in.y > 0 then weight else -weight
fx = atanh(a) * weight
#fx = acosh2(a, b) * weight
fy = log(xmax + sqrt(max(0, xmax - 1))) * w
in
vec2(fx, fy)
]]>
</string>
</transform_def>
<transform_def name="frank2">
<!-- Based on a transform by Tatasz and Chaosfissure Complex vars by cothe. Tatasz added a pi re-scale -->
<node name="input_params">
<real name="frank2">1</real>
<real name="mult_x">1</real>
<real name="mult_y">1</real>
<real name="sine">0</real>
<real name="sin_x_amplitude">1</real>
<real name="sin_x_freq">0.1</real>
<real name="sin_y_amplitude">2</real>
<real name="sin_y_freq">0.2</real>
<real name="mode">0</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="mult_x" />
<real name="mult_y" />
<real name="sine" />
<real name="xamp" />
<real name="xfreq" />
<real name="yamp" />
<real name="yfreq" />
<real name="mode" />
</node>
<string name="winter_init_function">
<![CDATA[
frank2_init_result(frank2, mult_x, mult_y, sine, sin_x_amplitude, sin_x_freq, sin_y_amplitude, sin_y_freq, mode)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
x = quartpi() * p_in.x
y = quartpi() * p_in.y
cschcos = cos(y)
cschsin = sin(y)
cschsinh = sinh(x)
cschcosh = cosh(x)
sechden = 2.0 / (cos(2.0 * y) + cosh(2.0 * x))
sech_output = vec2(cschcos * cschcosh, cschsin * cschsinh) * (weight * sechden)
r = weight / sqrt((sech_output.y * sech_output.y * mult_y) + (mult_x * sech_output.x * sech_output.x))
factor =
if sine <= 0.0 then
vec2(xamp, yamp)
else
let
pi_xfreq = pi() * sech_output.x
pi_yfreq = pi() * sech_output.y
tmp_vec = vec2(1.0, 2.0)
scalar_xy =
if mode <= 0.0 then
vec2(sech_output.x, sech_output.y)
else
if mode <= 1.0 then
vec2(exp(-sech_output.x), exp(-sech_output.y))
else
if mode <= 2.0 then
vec2(1.0 / sech_output.x, 1.0 / sech_output.y)
else
if mode <= 3.0 then
vec2(log(abs(sech_output.x)), yamp * log(abs(sech_output.y)))
else
vec2(atan2(sech_output.x, sech_output.y), atan2(sech_output.y, sech_output.x))
in
tmp_vec + vec2(xamp * sin(scalar_xy.x * pi_xfreq), yamp * sin(scalar_xy.y * pi_yfreq))
in
vec2(factor.x * (sech_output.x - sech_output.y) * (sech_output.x + mult_y * sech_output.y), factor.y * sech_output.x * sech_output.y) * r
]]>
</string>
</transform_def>
<transform_def name="frank">
<!-- Complex vars by cothe. Tatasz added a pi re-scale -->
<node name="input_params">
<real name="frank">1</real>
<real name="frank_power">2</real>
<real name="frank_dist">1</real>
<real name="frank_a">1</real>
<real name="frank_b">0</real>
<real name="frank_c">0</real>
<real name="frank_d">1</real>
<real name="frank_e">0</real>
<real name="frank_f">0</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="power" />
<real name="dist_power_2" />
<real name="a" />
<real name="b" />
<real name="c" />
<real name="d" />
<real name="e" />
<real name="f" />
</node>
<int name="num_unit_randoms">1</int>
<string name="winter_init_function">
<![CDATA[
frank_init_result(frank, frank_power, frank_dist / frank_power * 0.5, frank_a, frank_b, frank_c, frank_d, frank_e, frank_f)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
x = halfpi() * p_in.x
y = halfpi() * p_in.y
tanhsin = sin(y)
tanhcos = cos(y)
tanhsinh = sinh(x)
tanhcosh = cosh(x)
tanhden = 1.0 / (tanhcos + tanhcosh)
xh = tanhsinh * tanhden
yh = tanhsin * tanhden
xj = a * xh + b * yh + e
yj = c * xh + d * yh + f
root = truncateToInt(abs(power) * unit_rnd_0)
a = (atan2(yj, xj) + toReal(root) * twopi()) / power
r = weight * pow(xj * xj + yj * yj, dist_power_2)
in
vec2(cos(a), sin(a)) * r
]]>
</string>
</transform_def>
<transform_def name="pixel_flow">
<!-- Transform by bezo97 -->
<node name="input_params">
<real name="pixel_flow">1.0</real>
<real name="pixel_flow_angle">90.0</real>
<real name="pixel_flow_length">0.1</real>
<real name="pixel_flow_width">200.0</real>
<real name="pixel_flow_power">10.0</real>
<int name="pixel_flow_seed">42</int>
</node>
<node name="internal_params">
<real name="weight" />
<real name="dirx" />
<real name="diry" />
<real name="length" />
<real name="width" />
<real name="power" />
<int name="seed" />
</node>
<int name="num_unit_randoms">1</int>
<string name="winter_init_function">
<![CDATA[
let
a_rad = pixel_flow_angle * 0.0174532925
dirx = cos(a_rad)
diry = sin(a_rad)
in
pixel_flow_init_result(pixel_flow, dirx, diry, pixel_flow_length, pixel_flow_width, pixel_flow_power, pixel_flow_seed)
]]><!--angle: deg to rad-->
</string>
<string name="winter_eval_function">
<![CDATA[
let
block = floor(p_in * width)
vblock = block + vec2(2.0, 2.0) - 4.0 * vec2(hash_shadertoy(block.x * seed + 1, 0, seed), hash_shadertoy(0, block.y * seed + 1, seed))
fLen = hash_shadertoy(vblock.x, vblock.y, seed * 2)
fade = pow(unit_rnd_0, power) * fLen
in
vec2(dirx, diry) * length * fade * weight
]]>
</string>
</transform_def>
<transform_def name="hex_modulus">
<node name="input_params">
<real name="hex_modulus">1</real>
<real name="hex_modulus_size" notes="crop width">0.2</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="hsize" />
</node>
<int name="num_unit_randoms">1</int>
<string name="winter_init_function">
<![CDATA[
let
hsize = halfsqrt3() / hex_modulus_size
weight = hex_modulus / halfsqrt3()
in
hex_modulus_init_result(weight, hsize)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
XY0 = p_in * hsize
x = (0.57735026918962576450914878050196 * XY0.x - XY0.y / 3.0)
z = (2.0 * XY0.y / 3.0)
y = -x - z
#round
rx = floor(x + 0.5)
ry = floor(y + 0.5)
rz = floor(z + 0.5)
x_diff = abs(rx - x)
y_diff = abs(ry - y)
z_diff = abs(rz - z)
r_final =
if (x_diff > y_diff && x_diff > z_diff) then
vec3(-ry-rz, ry, rz)
else
if (y_diff > z_diff) then
vec3(rx, -rx-rz, rz)
else
vec3(rx, ry, -rx-ry)
FXY_h = vec2(sqrt3() * e0(r_final) + halfsqrt3() * e2(r_final), 1.5 * e2(r_final))
in
(XY0 - FXY_h) * weight
]]>
</string>
</transform_def>
</user_transforms>