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.

55 lines
1.7 KiB

<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="julian_beach">
<!-- Xform by Crystalize, based on Julian and Waves2 -->
<node name="input_params">
<real name="julian_beach">1</real>
<real name="julian_beach_power">2</real>
<real name="julian_beach_dist">1</real>
<real name="julian_beach_re">1</real>
<real name="julian_beach_im">1</real>
<real name="julian_beach_lin" minval="0" maxval="1">0.5</real>
<real name="julian_beach_waves">1</real>
<real name="julian_beach_y">1</real>
<real name="julian_beach_x">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="power" />
<real name="dist" />
<real name="re" />
<real name="im" />
<real name="a" />
<real name="b" />
<real name="wy" />
<real name="ex" />
</node>
<int name="num_unit_randoms">1</int>
<string name="winter_init_function">
<![CDATA[
julian_beach_init_result(julian_beach * quartpi(), julian_beach_power, julian_beach_dist / julian_beach_power * 0.5,
julian_beach_re, julian_beach_im,
julian_beach_lin, julian_beach_waves, julian_beach_y, julian_beach_x)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
offset = vec2(sin(p_in.y * b) * wy, sin(p_in.x * b) * ex)
x = complex(p_in.x + offset.y, p_in.y + offset.x)
y = complex(p_in.x + offset.x, p_in.y + offset.y)
intre = lerp(x.re * re, y.re * re, a)
intim = lerp(x.im * im, y.im * im, a)
root = truncateToInt(power * unit_rnd_0)
a2 = (atan2(intre, intim) + toReal(root) * twopi()) / power
r = weight * pow(dot(p_in, p_in), dist)
in
vec2(cos(a2), sin(a2)) * r
]]>
</string>
</transform_def>
</user_transforms>