Browse Source

the_ringer2 working base WIP

master
Crystalize 8 months ago
parent
commit
ad22954671
  1. 2
      linkX_bars_for_days.xml
  2. 92
      linkX_the_ringer2.xml

2
linkX_bars_for_days.xml

@ -136,7 +136,7 @@
acos(sbu * 2 - 1)
else
acos(exp(log(1 - sbu) * fsize) * 2 - 1)
sbm = sbr * invpi() / fsize
sbm = sbr * invpi()
sineblur = vec2(cos(sba), sin(sba)) * sbm
fill = (if fswitch <= 0.0

92
linkX_the_ringer2.xml

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="linkX_the_ringer2">
<node name="input_params">
<real name="the_ringer2">1</real>
<real name="the_ringer2_split" minval="0">0.5</real>
<real name="the_ringer2_outside_ring" minval="0">0.05</real>
<real name="the_ringer2_inside_ring" minval="0">0.05</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="split" />
<real name="oring" />
<real name="iring" />
</node>
<int name="num_unit_randoms">5</int>
<int name="num_gauss_randoms">1</int>
<string name="winter_init_function">
<![CDATA[
linkX_the_ringer2_init_result(the_ringer2, the_ringer2_split, the_ringer2_outside_ring, the_ringer2_inside_ring)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
cr = length(p_in)
ca = atan2(p_in.y, p_in.x)
csplit = if cr < 1.0 - split
then p_in
else vec2(cos(ca), sin(ca)) * (cr + split)
osplit = if split >= 1.0
then split
else 1.0
isplit = if 1.0 - split >= 0.0
then 1.0 - split
else 0.0
riring = if 1.0 - split + iring >= 0.0
then if 1.0 - split + iring >= 1.0
then 1.0
else 1.0 - split + iring
else 0.0
roring = if osplit - oring <= 1.0
then 1.0
else osplit - oring
br = osplit * unit_rnd_0
ba = unit_rnd_1 * twopi()
blur = vec2(cos(ba), sin(ba)) * br
brad = length(blur)
bang = atan2(blur.y, blur.x)
bs = sin(bang)
bc = cos(bang)
obmin = min(osplit, roring)
obmax = max(osplit, roring)
out_ring = if brad > obmax || brad < obmin
then if 1.0 == 1.0
then vec2(0.0, 0.0)
else vec2(bc, bs) * (obmax)
else blur
ibmin = min(isplit, riring)
ibmax = max(isplit, riring)
in_ring = if brad > ibmax || brad < ibmin
then if 1.0 == 1.0
then vec2(0.0, 0.0)
else vec2(bc, bs) * (ibmax)
else blur
irad = length(p_in)
iang = atan2(p_in.y, p_in.x)
is = sin(iang)
ic = cos(iang)
imin = min(riring, roring)
imax = max(riring, roring)
inside = if irad > imax || irad < imin
then if 1.0 == 1.0
then vec2(0.0, 0.0)
else vec2(ic, is) * (imax)
else p_in
rings = if unit_rnd_2 <= 0.5 then out_ring else in_ring
in_out = if unit_rnd_3 <= 0.5 then inside else csplit
total = if unit_rnd_4 <= 0.5 then rings else in_out
in
total * weight
]]>
</string>
</transform_def>
</user_transforms>
Loading…
Cancel
Save