top of page

Overview

In Treasure Party, many of our levels take place in or around water, and I wanted our background props—like docks, barrels, and boats—to feel more alive. To accomplish this, I developed a buoyancy system that synced perfectly with our stylized water shader, adding motion and polish to otherwise static scenes.

​

The goal was to have objects float and bob in response to the exact same sine wave used by the water shader. To keep both the physics and visuals in sync, I built and Ocean Manager that held the shared wave parameters: amplitude, frequency, and speed. This manager fed values to both the buoyancy logic and the shader ensuring that the vertex displacement and physics calculations always matched.

Each floating object used multiple buoyancy sample points, placed as children under the parent object. For each point, the system applied a distributed gravity force and checked if the point was below the wave surface its position. if submerged, and upward force was applied at the point, creating natural vertical bobbing.

To further enhance the buoyancy effect, the system also supported rotation in two distinct ways. First, through physics-driven torque. Applying the buoyant forces at the locations of the sample points causes the parent object to naturally tilt with the waves. Second, for more stylized control, I calculate the tangent of the sine wave at the object's position to determine an ideal rotation angle, which allowed for more exaggerated rocking motions when desired. The First method works better with smaller objects that are typically view from up close where smaller movements would be more noticeable, and the second method works better on large background objects where you want less subtle and more noticeable movements.

​

This feature added subtle, dynamic movement to floating objects and helped bring our water levels to life without overhead of large-scale fluid simulation. It is an example of using simple math and smart integration to add polish in a performance-friendly way.

bottom of page