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.6 KiB

10 months ago
<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="curlinderplus">
<node name="input_params">
<real name="curlinderplus">1</real>
<real name="curlinderplus_c1" >0</real>
<real name="curlinderplus_c2" >0</real>
<real name="curlinderplus_rotate" >0</real>
<real name="curlinderplus_axisflip" >0</real>
<real name="curlinderplus_matswitch" >0</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="c1" />
<real name="c2" />
<real name="rotate" />
<real name="axisflip" />
<real name="matswitch" />
</node>
<string name="winter_init_function">
<![CDATA[
curlinderplus_init_result(curlinderplus, curlinderplus_c1, curlinderplus_c2, curlinderplus_rotate,
curlinderplus_axisflip, curlinderplus_matswitch)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
mat1 = mat2x2(sinh(p_in.x), tanh(p_in.x),
tanh(p_in.y), sinh(p_in.y))
rotmat = mat2x2(cos(rotate), -sin(rotate),
sin(rotate), cos(rotate))
curl_out = vec2(
1 + c1 * p_in.x + c2 * (p_in.x * p_in.x - p_in.y * p_in.y),
(c1 + 2 * c2 * p_in.x) * p_in.y)
p = (if matswitch <= 0
then rotmat
else mat1) * curl_out
fx = if axisflip <= 0
then sinh(p_in.x * p.x) + sinh(p_in.y * p.y)
else tanh(p_in.x * p.x) + sinh(p_in.y * p.y)
fy = if fx == sinh(p_in.x * p.x) + sinh(p_in.y * p.y)
then tanh(p_in.y * p.x) - tanh(p_in.x * p.y)
else sinh(p_in.y * p.x) - tanh(p_in.x * p.y)
fr = weight * (p.x * p.x + p.y * p.y)
in
vec2(fx, fy) * fr
]]>
</string>
</transform_def>
</user_transforms>