Water shaders
Shoreline shader with shallow water and foam
Create shoreline foam and water color that changes with depth.
Your inputs
Requested output
A reusable component and configuration integrated into the existing repository, required styles or shaders, a runnable demo, a list of changed files, validation results and known limitations.
Original model policy · no model was executed
model-agnostic coding agent
Original usage notes
- A prompt for a development agent implementing changes in an existing codebase; the requested output is code.
Prompt with your inputs
The default values are filled in. This prompt has not been executed.
Original reusable prompt
Implement a reusable stylized shoreline water scene with Three.js for {{use}}. Use {{palette}} colors. Show a simple beach or rock geometry and a water surface whose shallow and deep regions have visibly different color and transparency. Generate a narrow animated foam band at the shoreline using a depth-based method where the existing rendering pipeline supports it, or an explicit shore-distance mask for a lighter implementation. Explain the chosen technique. Keep foam attached to the shoreline rather than floating randomly across the whole plane. Add restrained scrolling noise and small wave displacement, with configurable foam width, speed, water level and depth tint. Avoid z-fighting and handle the renderer's actual depth and color conventions.
Implementation constraints:
First inspect the existing repository and installed versions. Reuse its routing, styling, build tools and dependency conventions. Use React Three Fiber only if the project already uses it or the integration is clearly justified; otherwise use the existing Three.js integration or a minimal isolated component. Do not assume version-specific APIs: check the installed package documentation and types. Do not change unrelated pages or silently replace the application architecture. Explain any required new dependency before adding it. Dispose GPU resources, remove event listeners and stop rendering when the component is not visible. Respect prefers-reduced-motion and provide a readable non-WebGL fallback. Keep links and controls in accessible HTML above the canvas. Return the changed files, configuration knobs, tests performed and known limitations.
Acceptance criteria:
- Foam is visible where water meets land and is controllable through a named configuration value.
- The water does not disappear or flicker when the camera or viewport changes.
- Depth resources resize and are disposed correctly if a depth pass is used.
- Low-quality mode keeps the shoreline readable with fewer shader samples or a simpler mask.
- Document visual approximations and test the actual page with transparency and nearby HTML overlays.Requested checks · not performed
- Foam is visible where water meets land and is controllable through a named configuration value.
- The water does not disappear or flicker when the camera or viewport changes.
- Depth resources resize and are disposed correctly if a depth pass is used.
- Low-quality mode keeps the shoreline readable with fewer shader samples or a simpler mask.
- Document visual approximations and test the actual page with transparency and nearby HTML overlays.
Execution record
Download template record ↓Source & preservation
Kumyu Academy creative templates