Water shaders
Transparent water with reflection and refraction
Show distortion of objects beneath the water and highlights on its surface.
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 Three.js water demonstration for {{scene}} with readable {{objects}} beneath the surface. Create restrained reflection and refraction cues, wavelength-scale normal distortion, depth-dependent tint and Fresnel blending. Choose between a lightweight environment-map approximation and a render-target approach based on the existing stack and performance budget. Describe the tradeoff rather than presenting screen-space approximations as physically exact water. Expose roughness, distortion strength, tint and opacity or transmission controls appropriate to the selected material. Keep submerged objects recognizable and prevent feedback loops when rendering reflection or refraction textures.
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:
- A comparison toggle or developer control makes the distortion and Fresnel effect observable.
- Rendering does not recursively sample its own active output target.
- No major black edges, transparency-order glitches or disappearing underwater objects appear at supported camera angles.
- Provide a cheaper fallback when render targets or required capabilities are unavailable.
- Record GPU resource sizes and measured frame time for the final quality presets.Requested checks · not performed
- A comparison toggle or developer control makes the distortion and Fresnel effect observable.
- Rendering does not recursively sample its own active output target.
- No major black edges, transparency-order glitches or disappearing underwater objects appear at supported camera angles.
- Provide a cheaper fallback when render targets or required capabilities are unavailable.
- Record GPU resource sizes and measured frame time for the final quality presets.
Execution record
Download template record ↓Source & preservation
Kumyu Academy creative templates