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

<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="hyphy_tile">
<!-- kinda like the xform by Zueuk, just more... hyphy... af. -->
<node name="input_params">
<real name="hyphy_tile" notes="Faster than hypertile 1">1</real>
<real name="hyphy_tile_p" minvalue="2">3</real>
<real name="hyphy_tile_q" minvalue="2">7</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="p" />
<real name="r" />
</node>
<int name="num_unit_randoms">1</int>
<string name="winter_init_function">
<![CDATA[
let
pa = twopi() / hyphy_tile_p
cs = cos(pa)
r2 = 1.0 - (cs - 1) / (cs + cos(twopi() / hyphy_tile_q))
r = if r2 > 0 then 1.0 / sqrt(r2) else 1.0
in
hyphy_tile_init_result(hyphy_tile, pa, r)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
III = (p_in * (r / p)).x
IIa = pow(complex(p_in.x, hash_shadertoy(p_in.x, p_in.y, III)), p_in.x)
IIb = complex(p_in.x, hash_shadertoy(p_in.x, p_in.y, III))
I = toReal(truncateToInt(IIa.re * IIb.im))
a = (vec2(I).x + vec2(I).y) + r
c = r * p_in.x
d = r * p_in.y
x = (a * c + p_in.y * d)
y = (p_in.y * c - a * d)
rnd_a = floor(unit_rnd_0 * 32767) * p
cosa = cos(rnd_a)
sina = sin(rnd_a)
in
vec2(x * cosa + y * sina, y * cosa - x * sina) * (weight / ((c * c) + (d * d)))
]]>
</string>
</transform_def>
</user_transforms>