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.

58 lines
2.1 KiB

<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="linkX_bOkay">
<node name="input_params">
<real name="bOkay">1</real>
<real name="bOkay_rotate1">0</real>
<real name="bOkay_rotate2">3.141592653589</real>
<real name="bOkay_power1" minval="1">1</real>
<real name="bOkay_power2" minval="2">2</real>
<real name="bOkay_move">0</real>
<real name="bOkay_split" minval="0.5">1</real>
<real name="bOkay_inner_weight">0.5</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="rotate1" />
<real name="rotate2" />
<real name="power1" />
<real name="power2" />
<real name="move" />
<real name="split" />
<real name="iw" />
</node>
<int name="num_unit_randoms">2</int>
<string name="winter_init_function">
<![CDATA[
linkX_bOkay_init_result(bOkay, bOkay_rotate1, bOkay_rotate2, bOkay_power1, bOkay_power2, bOkay_move, bOkay_split, bOkay_inner_weight)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
taua = 0.5 * (log((p_in.x + 1.0) * (p_in.x + 1.0) + p_in.y * p_in.y) - log((p_in.x - 1.0) * (p_in.x - 1.0) + p_in.y * p_in.y)) / power1 + move
taub = 0.5 * (log((p_in.x + 1.0) * (p_in.x + 1.0) + p_in.y * p_in.y) - log((p_in.x - 1.0) * (p_in.x - 1.0) + p_in.y * p_in.y)) / power2 + move
sigmaa = pi() - atan2(2 * p_in.y, 1 - dot(p_in, p_in)) + rotate1
sigmab = pi() - atan2(2 * p_in.y, 1 - dot(p_in, p_in)) + rotate2
sigma2a = (sigmaa + twopi() * floor(unit_rnd_0 * power1)) / power1
sigma2b = (sigmab + twopi() * floor(unit_rnd_0 * power2)) / power2
tau2 = if p_in.x >= 0
then taua + split
else taua - split
tau3 = if p_in.x >= 0
then taub - split
else taub + split
b_out1 = vec2(sinh(tau2), sin(sigma2a)) * (weight / (cosh(tau2) - cos(sigma2a)))
b_out2 = vec2(sinh(tau3), sin(sigma2b)) * (weight / (cosh(tau3) - cos(sigma2b)))
in
lerp(b_out1, b_out2, if unit_rnd_1 >= iw
then 0.0
else 1.0)
]]>
</string>
</transform_def>
</user_transforms>