#GLSL: Animated 2D fluid inside sphere.
Use for loading animations, health UI, etc...
void mainImage(out vec4 col, in vec2 uv)
{
vec3 r = iResolution;
uv=((2.*uv)-r.xy)/r.y;
float
sdf=length(uv),c=step(sdf,.85),
vB=smoothstep(.1,.9,sin(uv.x+(PI*.5))-.3),
vBA=vB*sin(iTime*4.)*.1,
fW=(sin(((iTime*2.)+uv.x)*2.)*.05)+vBA,
bW=(sin(((iTime*-2.)+uv.x)*2.+PI)*.05)-vBA,
fA=(sin(iTime*4.)*.05)*vB,
fP=-.2+(sin((iTime)*PI)*.1),
fF=step(uv.y,(fA+fW)+fP)*c,
bF=step(uv.y,(-fA+bW)+fP)*c;
col =
vec4((step(sdf,1.)-step(sdf,.9))+
(fF+(clamp(bF-fF,0.,1.)*.8))+
clamp(pow((sdf+.01)*
((1.-(fF+bF))*c),5.),0.,1.));
}
Try it INTERACTIVE
w/ comments on
#ShaderToy:
👉
shadertoy.com/view/Ds3BRN
#gamedev #indiedev #vfx #shader