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.

41 lines
996 B

<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="fluxpher">
<node name="input_params">
<real name="fluxpher">1</real>
<real name="mod1">0</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="mod1" />
</node>
<int name="num_unit_randoms">4</int>
<string name="winter_init_function">
<![CDATA[
fluxpher_init_result(fluxpher, mod1)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
r2 = dot(p_in, p_in) / max(mod1, -mod1)
fspher = if r2 > 1.0
then if unit_rnd_0 < 0.5
then p_in * (2.0 / r2)
else p_in * 2.0
else vec2(0.0, 0.0)
spher = vec2(fspher.x + (1.0 + (mod1 * 0.1)), fspher.y)
r = length(spher)
a = atan2(spher.y, spher.x)
c = floor(a * halfinvpi() + 0.5)
alpha = a * 0.5 + c * pi()
in
vec2(cos(alpha), sin(alpha)) * (r * weight)
]]>
</string>
</transform_def>
</user_transforms>