• Remix
  • Share
  • New Entry

  • ME

  • /
  • COLOR PULSE - Remix

on 13 Nov 2023
  • 12
  • 23
  • 0
  • 0
  • 672
drawframe(40);
function drawframe(f)
% Remixed version made while trying to figure out how the original works
iRes = cat(3, 800, 800);
iTime = f/47*3;
persistent fragCoord
if isempty(fragCoord)
[x,y]=meshgrid(1:iRes(1), 1:iRes(2));
fragCoord = cat(3,x,y);
end
img = mainImage(fragCoord);
imagesc(img)
axis equal
axis off
function out=palette( t )
cc = ones(1,1,3);
aa = cc/2;
dd = reshape([0.563,0.416,0.557],1,1,3);
out = aa + aa.*cos( 1.28318*( cc .* t + dd) );
end
function finalColor=mainImage( fragCoord )
uv = (fragCoord * 2 - iRes) / iRes(2);
uv0 = uv;
finalColor = 0;
i=0;
while i < 4
uv = mod(uv * .7, 1) - 0.5;
d = vecnorm(uv,2,3) .* exp(-vecnorm(uv0,2,3));
col = palette( vecnorm(uv0,2,3) + i *0.4 + iTime*0.4);
d = sin( d*10 + iTime )/8;
d = abs(d);
d = (0.01 ./ d).^ 1.2;
finalColor = finalColor + col .* d;
i=i+1;
end
end
end
Animation
Remix Tree