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.

43 lines
1010 B

10 months ago
<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="knotty">
<!-- based on a Transform by TataSZ -->
<node name="input_params">
<real name="knotty">1</real>
<real name="width">0.5</real>
<real name="space">0.1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="wd" />
<real name="space" />
</node>
<int name="num_unit_randoms">2</int>
<string name="winter_init_function">
<![CDATA[
knotty_init_result(knotty, width, space)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
cell = vec2(floor(p_in.x), ceil(p_in.y))
xy0 = vec2(((unit_rnd_0 - 0.5) * wd), ((unit_rnd_1) * 2 - 1.0) * (1.0 - space - wd * 0.5))
dir0 = abs(cell.x + cell.y)
dir1 = dir0 - 2.0 * floor(dir0 / 2.0)
xy =
if (dir1 < 0.5) then
xy0
else
vec2(-xy0.y, xy0.x)
in
(cell + xy) * weight
]]>
</string>
</transform_def>
</user_transforms>