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
1.3 KiB

<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="epolar_strip">
<!-- Xform by Crystalize, based on the wonderful work of Tatasz -->
<node name="input_params">
<real name="epolar_strip">1</real>
<real name="epolar_strip_length" minval="0" >1</real>
<real name="epolar_strip_strength" minval="0" >1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="t" />
<real name="strength" />
</node>
<int name="num_unit_randoms">3</int>
<string name="winter_init_function">
<![CDATA[
epolar_strip_init_result(epolar_strip, epolar_strip_length, epolar_strip_strength)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
tmp = dot(p_in, p_in) + t
z = complex(p_in.y, p_in.x)
result = halfinvpi() * log((z * tmp) + (z * tmp))
epolar = vec2(result.im, result.re)
cpx = clamp(epolar.x, -0.5, 0.5)
cpy = clamp(epolar.y, 0.0, 0.5)
rpolar = lerp(vec2(cpx, cpy), vec2(-cpx, -cpy), if unit_rnd_0 >= 0.5 then 1.0 else 0.0)
log_out = vec2(rpolar.y, rpolar.x + floor(log(unit_rnd_2) * (if unit_rnd_1 < 0.5
then strength
else -strength) + 0.5)) * (weight * 2.0)
in
log_out
]]>
</string>
</transform_def>
</user_transforms>