← Lab

Rasengan!

A cage of 144 circles on four shells, orbiting arcs, HDR bloom

Built from one frame: the Parent and Child Rasengan at the end of Boruto: Naruto the Movie, where the ball is wound with hundreds of thin, smooth, bright lines at every angle, crossing into a net that thickens toward the rim, around a core too bright to see into. Each line here is a circle on the sphere, the set of directions whose dot product with some axis equals some offset: one multiply per line, no noise anywhere, so every thread is clean. A hundred and forty-four of them in four groups, each group turning about its own axis at its own speed, one against the others, so the net shears the way chakra spun several ways at once would. Four concentric shells of it, front and back faces each, give the cage depth, and by projection alone the lines crowd toward the rim as they do in the film. Each thread breathes in brightness on its own clock, which is the flicker. As it grows, brighter arcs begin to orbit outside it on tilted circles that precess and wander, each lap rolling a hash for whether the arc shows and how long its tail is, so no two passes match, dimmed where they pass behind the ball. The body is a soft luminous volume that thins out with radius rather than stopping, so the glow has no edge; the net does, because in the film it does. The world behind is bent, dimmed and tinted the way a bright translucent sphere would, and as it charges the air just outside the shell starts to shimmer and drag into a spiral while chakra peels off in soft tongues. At rest it is quiet. Rest the pointer on it and it charges: bigger, brighter, faster, to more than twice its size the way the film's grows from a hand to a house, and it settles when you move off. The world behind it changes every twelve seconds, or when you click it: a field under the moon, a pine forest, a meadow at dusk, a rocky valley at dawn, the kind of places these fights happen in. The lens and bloom are the same as the water drop's.

Rebuild it

This is the whole recipe, written as a prompt. Paste it into an AI coding assistant and it has everything: the maths, the numbers, the colours.

Build a Rasengan (Naruto) as a single WebGPU fragment shader over a photographed HDRI background. Ray trace from the camera; every term below is a function of the ray's closest approach to the ball's centre, b, in units of the ball radius.

1. Threads. Generate 144 circles on the unit sphere: each is a unit axis a (uniform on the sphere, seeded) and an offset h in [-0.55, 0.55]. A thread is where |dot(n, a) - h| < 0.009, drawn with smoothstep. Split them into four groups; before the dot product, rotate n about the group's own axis by spin times the group's speed (Rodrigues formula), one group counter-rotating. Give each thread a brightness of 0.55 + 0.45 sin(spin * (1.1 + 0.09 i) + 1.7 i) so the net flickers.

2. Shells. Evaluate the threads on four spheres, radii 1.0, 0.85, 0.68, 0.5. For each shell the ray crosses (b < radius), read the front and back intersection, back at about 0.3 of the front. Inner shells are whiter. Fade the inner shells out just inside their own silhouettes; leave the outer one sharp, that is the ball's edge.

3. Body. A soft luminous volume: cyan in the middle going blue outward, weighted by smoothstep(1.2, 0.6, b) squared, plus a white core exp(-2.8 b^2). Dim and tint the background seen through the ball by the same smoothstep, so nothing has a hard boundary except the net.

4. Orbits. Six tilted circles just outside the ball, radius 0.98 to 1.12. For each, intersect the ray with the circle's plane, and light the pixel where the hit is within 0.035 of the circle's radius. Along the ring, measure the angle behind a head that advances with spin, and shape the arc as exp(-behind * (5 + 9 hash)), with a per-lap hash deciding whether the arc appears at all. Precess each axis with three incommensurate sines and let the radius drift. Dim arcs on the far side of the ball.

5. Air. Outside the ball, bend the background lookup direction tangentially and inward with exp(-3 |b - 1|) falloff and a slow noise shimmer, and add soft noise tongues that ride the rotation and dissolve half a radius out.

6. Charge. A value 0 to 1 that rises while the pointer is over the ball and falls when it leaves. Radius scales 1 to 2.7. Spin rate is 1 + 5 charge^2. Brightness is 0.5 + 0.25 charge. Orbits and air are multiplied by smoothstep(0.1, 0.7, charge) so the ball is quiet at rest.

7. Light. Render linear HDR, then a bright pass, a quarter-resolution Gaussian blur, and ACES tone mapping. Background is an equirectangular HDRI stored as log2(1 + 32 L) / 17 in an 8-bit WebP, with mip levels for a slight depth of field, auto-exposed to a fixed key.

Colours: core (0.85, 0.97, 1.0), cyan (0.45, 0.85, 1.0), chakra (0.22, 0.52, 1.0). Everything additive.