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.

51 lines
1.4 KiB

10 months ago
<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="gloonian">
<node name="input_params">
<real name="gloonian">1</real>
<real name="gloonian_radius_mult">1</real>
<real name="gloonian_hole">0.0</real>
<real name="gloonian_expand">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="radm" />
<real name="hole" />
<real name="exp" />
</node>
<int name="num_unit_randoms">1</int>
<string name="winter_init_function">
<![CDATA[
gloonian_init_result(gloonian * halfsqrt2(), gloonian_radius_mult, 1.0 - gloonian_hole, gloonian_expand)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
p_len = length(p_in)
aux = if p_len*p_len > radm then 1.0 * exp else -1.0 * exp
a2 = sqrt(p_len + p_in.x)
glynnia_out =
if unit_rnd_0 < 0.5 then
vec2(aux * a2, -p_in.y / a2) * p_len/(radm*radm)
else
vec2(aux * a2, p_in.y / a2) * (1.0 / p_len)
glynnia_r2 = dot(glynnia_out, glynnia_out)
w2 = radm*radm
loonie_r =
if glynnia_r2 < w2 then
radm * sqrt(w2 / glynnia_r2 - hole)
else
radm
in
glynnia_out * loonie_r * weight
]]>
</string>
</transform_def>
</user_transforms>