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.

47 lines
1.6 KiB

<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="average_ghosts2">
<!-- Transform by Crystalize -->
<node name="input_params">
<real name="average_ghosts2">1</real>
<real name="average_ghosts2_param1">1</real>
<real name="average_ghosts2_param2">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="p1" />
<real name="p2" />
</node>
<int name="num_unit_randoms">1</int>
<string name="winter_init_function">
<![CDATA[
average_ghosts2_init_result(average_ghosts2 * invpi(), average_ghosts2_param1, average_ghosts2_param2)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
I = truncateToInt(p_in.x * p_in.y)
II = truncateToInt(p_in.y)
n =
if p2 > 0
then
if unit_rnd_0 * (p_in.x / p_in.y) / p2 < 0.0
then complex((toReal(I)), (toReal(truncateToInt((hash_shadertoy(p_in.x, p_in.y, weight)))) * p2))
else complex((toReal(truncateToInt((hash_shadertoy(p_in.y, p_in.x, p_in.x / p_in.y))))), cos(toReal(II)) * p2)
else complex(sin(toReal(truncateToInt(p_in.x))), cos(toReal(truncateToInt(p_in.y))) * -p2)
r = length(vec2(n.im + n.re)) * twoinvpi()
x = if p1 > 0 then truncateToInt(r * p1) else (truncateToInt((r * p1) * sqrt(n.im * 100)))
y = truncateToInt((log(n).re * log(n).im) * (twoinvpi() * p1))
y1 = log(complex(tanh(toReal(x)), sinh(toReal(x))))
y2 = log(complex(cosh(toReal(y)), tanh(toReal(y))))
in
(p_in * vec2(y1.im + y2.re).x * floor(r)) * (0.1 * weight)
]]>
</string>
</transform_def>
</user_transforms>