What I want
The plants' movement underwater needs both uniformity and variation. Finding the right balance was hard. Too much uniformity made the plants look like copies of one animation. Too much independence made them look as though they are in separate streams. The scene's movement as a whole is determined by how each leaf moves individually. So there were two linked questions. How could I model water that gives the plants a common direction and rhythm, with enough variation? And how could I model leaves to respond to that water?
Using one image
The first build used a transparent image containing three separate plant-cluster designs. Each design depicted several overlapping leaves. The program selected from those designs to place four clusters in the scene, reusing one design. Each placement had its own position, size and angle.
There were no individual leaf objects yet. To animate a cluster, a shader changed where it read colors from the image. For each screen pixel inside the cluster, it calculated a position in the source image. Moving that lookup position over time made the image appear to sway and bend, a little like viewing a photograph through a shifting distortion.
The displacement varied along the image: it was small near the base and stronger toward the ends. Two sine waves, changing at different rates, supplied the sway. Each cluster had a different starting phase, meaning it began at a different point in those oscillations.
The essential operation was:
for each screen pixel covered by a cluster:
image_position = map_screen_position_into_cluster_image(pixel)
image_position += changing_offset(image_position, time)
color = read_image(image_position)
This moved the picture of the plants. It did not give the leaves separate bodies. Two leaves painted across each other remained part of the same picture, so one could not bend away from the other. The cluster moved, but it felt too much like one object.
Modeling each leaf as on strip
The next version built each leaf as a narrow, flat strip, with a leaf image applied to it for color and detail. The program could now change one leaf's shape without moving the others.
To construct a strip, I defined a line running down its middle—the centerline. At several positions along that line, I placed an edge point on either side. Joining those pairs produced the strip's surface. A curved centerline therefore produced a curved leaf.
Its initial centerline was a hand-chosen curve. The animation added changing offsets to that curve. In shortened pseudocode:
for each sampled position s along a leaf:
center = resting_curve(s)
center.y += movement_weight(s) * wave_offset(s, time)
center.y += extra_tip_offset(s, time)
construct_the_leaf_strip_around_these_centers()
Here, measures distance along the leaf as a fraction of its length: zero at the base, one at the tip. wave_offset combined several sine waves. Each depended on both position and time, allowing different parts of a leaf to move by different amounts.
The movement weight increases towards the tip:
controls stiffness. Increasing reduced movement through most of the body while keeping the weight at the tip equal to one. For example, if the exponent is three, halfway along the leaf the weight is : only one eighth of its value at the tip.
That weighting kept the base still, but it also weakened the movement through much of the body. A leaf's tip could move noticeably while the original bend in its middle barely changed.
At this stage, I drew each strip as forty short sections joined together. Those subdivisions made its outline smooth, but every section still followed the offset formula above. A smooth outline could therefore reproduce the same unconvincing movement.
Changing the leaves with three controls
I next tested a model that changed a leaf's curvature directly. I used a separate page with plain strips, so texture and water reflections would not hide the movement.
Each leaf had three changing numbers: controlled a broad bow, added an opposing bend through the body, and adjusted the end. Together, they determined the direction of each short section along the leaf. I joined those sections end to end to make its centerline.
A simplified version of the direction formula was:
Here, runs from base to tip and is time. is the section's angle from the horizontal. sets the starting direction, and supplies an initial arch. The fixed functions and determine where the first two controls act:
The first sine pattern has one broad rise along the leaf. The second changes sign halfway along, allowing the two halves to turn in opposing directions. Multiplying them by and changes the amount and direction of those bends. The term acts more strongly toward the tip.
The cubic terms keep these patterns from returning to zero at the tip. That lets changes in the body also change the end's direction. The actual implementation also uses to shift the bend patterns slightly along the leaf; that position adjustment is omitted from this simplified equation.
The program built the curve from those directions:
point = attachment
for each section from base to tip:
angle = direction_formula(section_position, time)
next_point = point + section_length * [cos(angle), sin(angle)]
add next_point to the centerline
point = next_point
The pair [cos(angle), sin(angle)] gives a direction of length one. Multiplying it by section_length makes every step the same length. Changing the angles therefore changes the curve without stretching the leaf. I drew the textured strip around this new centerline just as before.
To animate it, I generated a target for each of , and using smooth noise: numbers that change irregularly but gradually. Each control approached its target through a damped update, which both pulled it toward the target and slowed its rate of change. Stronger targets produced deeper bends; a faster response made the leaf follow sooner.
This produced changing body curves and more freedom in the tip's direction. When I arranged the leaves into three overlapping groups in the scene, however, the groups did not move convincingly together.
Giving nearby leaves related movement
The problem was in the target generator. It chose different parts of its noise pattern according to a leaf's group, with additional timing offsets based on leaf length. Two leaves could overlap on screen yet follow unrelated signals. Their visual proximity had no say in how their movements were linked.
I changed the generator to use actual scene positions. For each leaf, I chose the average position of the middle part of its resting centerline. All leaves used the same time. At that position, each bend control received a blend of shared and local variation:
and are scene coordinates. gives every leaf the same changing number. varies smoothly across the scene, so nearby leaves receive similar numbers. raises and lowers the overall strength slowly. This construction is repeated for all three bend controls, using a different noise pattern for each.
The 82% common part gave the groups a shared push and release. The 18% local part let them differ without separating into unrelated rhythms. Increasing the common share made the targets more alike; increasing the local share gave position more influence. The size of the local noise features also mattered: broad features affected several leaves together, while smaller features created differences over shorter distances.
These signals set bend targets, not water velocities. The program scaled them by the overall Current setting and small per-leaf strength differences, then used the same damped update and curve construction as before.
The groups now moved together more convincingly. Yet each leaf was still controlled by only three numbers. A changing target reshaped the whole curve; it did not describe a local push on the middle of a leaf and the resulting movement of its neighbors.
Letting connected sections respond to water
I gave each leaf a centerline made of 18 points, each with its own position and velocity. Adjacent points were connected by segments that resisted stretching, and adjacent segments resisted changes in their angle. This is a simple flexible rod.

I had tested connected-point models during the earlier motion study. This time, I used them to preserve the common movement while allowing a push on one section to affect the rest of the leaf.
The important change was what the program stored between updates. In the three-control model, the point positions were calculated from , and . In the rod model, the positions and velocities of the points were the changing state. Their interactions determined the curve.
The water model changed with it. I replaced the bend-target signals with a function that returned a horizontal and vertical water velocity at any position and time. Every moving point sampled that same underlying function at its current location. Points at the same location sampled identical velocities, and nearby points sampled related ones.
This was a prescribed current in the two-dimensional plane of the leaves. It did not calculate a volume of fluid or the leaves' effect on the water. The visible water surface was rendered separately. Initially, repeating waves varied the prescribed velocities; I refined that pattern after testing the leaf response.
How the water moves a point
Water resistance, or drag, brings a point's velocity closer to the water velocity around it. For one direction, the code used:
is the point's current velocity, is the water velocity, is the time step, and is the response rate. The result is a weighted average of the old point velocity and the water velocity. A larger makes the point follow the water sooner; a smaller one retains more of its previous motion.
I applied this update separately along and across the leaf's local direction, with much stronger drag across it. This lets a sideways current bend a leaf more strongly than a current running along its length. After updating velocity, the program moves the point by velocity * dt.
Current now controlled the strength of the water velocity rather than a bend target. The separate Response control scaled drag. Increasing Response made a leaf follow moving water more closely, but also made still water slow it more strongly. Setting leaves the update as : stopping the current does not remove resistance.
How the points stay connected
Drag alone would let every point drift on its own and the leaf come apart. After the drag step, I corrected their positions using two rules.
First, neighboring points should remain one segment length apart. If they moved too far apart, the solver brought them closer; if too close, it separated them. Lighter points received more of the correction. The first two points were fixed in this version, holding the attachment and the first segment's direction.
Second, a joint should resist bending away from its resting angle. Three points define two segments and the angle between them. The model assigned a bending energy to changes in that angle:
is the current joint angle, is its initial angle, is the segment length, and is bending rigidity. Larger departures have a higher cost. Increasing makes a joint harder to bend under the same loading.
The code uses this relationship through compliance, , which describes how much a joint yields. A constraint solver repeatedly adjusts the three points to reduce the angle error while allowing some bend according to that compliance. High compliance permits more bending; low compliance keeps the joint closer to its resting angle. The solver note gives the exact correction formula.
One simulation step is therefore:
save previous positions
for each free point:
sample the shared water velocity at its position
update the point's velocity through drag
move it by velocity * dt
repeat corrections along the leaf:
bring segment lengths back toward their original lengths
resist changes in joint angles according to bending rigidity
for each free point:
velocity = (corrected_position - previous_position) / dt
A correction to one point affects both segments connected to it. Repeating the process lets a local disturbance affect neighboring sections. The last line carries the corrected movement into the next step, so the leaf retains momentum. The simulation uses a fixed step of second, independently of the browser's drawing rate.
The leaf now had sections that influenced one another. It still needed the right water pattern and material settings to look convincing.
Balancing shared motion and local differences
The first candidate in this round was too stiff. Stronger repeating water-velocity waves made the bends visible, but many leaves followed the same S-shaped gesture. The movement had gone from disconnected groups to excessive uniformity.
In the Solaris reference clip, straighter spans, changing bows and active tips coexist within the same broad flow. I adjusted both the leaves' material properties and the water pattern to reproduce that mixture.
Different leaves can yield differently
I varied relative thickness along and between leaves. Thickness here was a simulation parameter, separate from the visible strip's width. Some profiles had a flexible base and a stiffer body; others made the tip softer than the middle.
Holding other factors fixed, mass scaled with thickness , the base drag rate with , and bending rigidity with . A section made 20% thinner therefore had 80% of the mass, 1.25 times the base drag rate and about half the bending rigidity: .
These relationships let similar water movement produce different bends. A stiff span could move mostly as a unit, while a softer section changed curvature more readily. The parameters were tuned for the scene, not measured from real plants.
The same water can vary across space
I also replaced the repeating velocity waves with curl noise, which builds circulating flow from a smooth irregular pattern.
Start with a function that returns one number at each location and time. Imagine those numbers as the heights of a landscape. This is only a way to construct the current; it is not the visible water surface. The slopes of that landscape give a velocity through:
The derivatives describe how quickly the number changes vertically and horizontally. Swapping those slopes and reversing one sign turns the direction along the landscape's contours. The pair gives the horizontal and vertical velocity of a local swirling pattern, or eddy.
To move the pattern through the scene, the program evaluates the noise at a shifted position such as x - drift_speed * time. The shift moves the arrangement of eddies; the local slopes and their amplitude determine the water velocity returned at a point. Those are two different speeds.
The final velocity combines two sizes of eddies with a shared directional flow:
water_velocity = downstream_push(time) + sideways_change(time)
water_velocity += large_drifting_eddies(position, time)
water_velocity += smaller_weaker_eddies(position, time)
water_velocity *= current
The directional terms and larger eddies give several leaves related movement. The smaller eddies vary the push along and between them. Every point samples the same combined function; no leaf gets a private random current.
Pattern size controls how broadly a change is shared. Drift speed controls how quickly the pattern passes, and amplitude controls how strong its velocity contribution is. The first noise-based candidate was too quiet. Increasing eddy strength to 2.75 times that candidate restored visible movement while keeping the mean downstream component unchanged.
Together, the varied material response and shared irregular current gave the leaves different bends and timing within a recognizable common movement. It remained more orderly than the reference footage.
Moving the plants with our cursor
With the shared-current movement working, I added plant brushing on September 22. Surface ripples already responded to the cursor; holding the left mouse button and sweeping over the plants now bent them too.
The leaf model already responded to water velocity. I added the stroke as a local movement of water, letting the existing drag and connections determine how the leaves reacted.
I tracked the cursor's positions over time and mapped them into the scene's coordinates. Each movement created a short trail of disturbances along the path between the previous and new positions. Sampling along that path let a fast stroke affect a narrow leaf even if the cursor crossed it between browser updates.
Each disturbance pushed in the direction of the stroke. Its influence was strongest near its center and faded to zero within a small radius, so nearby sections could move while distant leaves continued with the current. Faster strokes produced stronger pushes. I capped the speed used to calculate the push, and the resulting water speed, to avoid abrupt flinging. I accumulated the push from the distance the cursor traveled, rather than adding a fixed kick for every input event. That kept a mouse reporting more events from automatically producing a stronger effect.
At each leaf point, the added velocity entered the existing model as:
The two terms are the background water velocity and the local velocity produced by recent cursor movement, both sampled at that point. I used their sum in the drag update described earlier. The leaf's bending resistance, momentum and connections then shaped the response. Push strength and interaction radius controlled how strongly and how widely a stroke affected the plants.
The disturbances rose briefly and then faded away within one second. Releasing the button stopped new input, but left that short wake and the plants' existing motion intact. Holding the cursor still added nothing. I tested a stroke with the background current turned off to check that it produced a local bend followed by settling.










