{
  "id": "three-shore-foam",
  "theme": "three-shaders",
  "type": "code",
  "sourceCategory": "ocean",
  "kind": "shader",
  "genre": "water-shader",
  "title": "Shoreline shader with shallow water and foam",
  "description": "Create shoreline foam and water color that changes with depth.",
  "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.\n\nImplementation constraints:\nFirst 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.\n\nAcceptance criteria:\n- Foam is visible where water meets land and is controllable through a named configuration value.\n- The water does not disappear or flicker when the camera or viewport changes.\n- Depth resources resize and are disposed correctly if a depth pass is used.\n- Low-quality mode keeps the shoreline readable with fewer shader samples or a simpler mask.\n- Document visual approximations and test the actual page with transparency and nearby HTML overlays.",
  "variables": [
    {
      "key": "use",
      "label": "Use case",
      "default": "an interactive travel landing page",
      "required": true
    },
    {
      "key": "palette",
      "label": "Color palette",
      "default": "turquoise shallows, blue-green deeper water and warm white foam",
      "required": true
    }
  ],
  "notes": [
    "A prompt for a development agent implementing changes in an existing codebase; the requested output is code."
  ],
  "outputArtifact": "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.",
  "modelPolicy": "model-agnostic coding agent",
  "aspectRatio": null,
  "referenceImageRequired": false,
  "transparentOutputRequested": null,
  "ageConstraint": null,
  "acceptanceCriteria": [
    "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."
  ],
  "keywords": [
    "Three.js",
    "Shoreline",
    "Foam",
    "Depth"
  ],
  "defaultPrompt": "Implement a reusable stylized shoreline water scene with Three.js for an interactive travel landing page. Use turquoise shallows, blue-green deeper water and warm white foam 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.\n\nImplementation constraints:\nFirst 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.\n\nAcceptance criteria:\n- Foam is visible where water meets land and is controllable through a named configuration value.\n- The water does not disappear or flicker when the camera or viewport changes.\n- Depth resources resize and are disposed correctly if a depth pass is used.\n- Low-quality mode keeps the shoreline readable with fewer shader samples or a simpler mask.\n- Document visual approximations and test the actual page with transparency and nearby HTML overlays.",
  "execution": {
    "status": "not-run",
    "actualModel": null,
    "modelVersion": null,
    "executionDate": null,
    "tokens": null,
    "cost": null,
    "elapsedSeconds": null,
    "output": null
  },
  "provenance": {
    "source": "Kumyu Academy creative templates",
    "sourceFile": "apps/academy/content/creative/templates/en/three-shaders.json",
    "sourceCommit": "33a0ac4473d64ec443e809d754051109d9324435",
    "sourceBlob": "63133a94f8f80ae74418bb869a122276a793f5bf",
    "sourceSha256": "0f842b83757f873f3f8838ee4d77509570d99cce1290a523a6e0ec1b9903f1fb",
    "originalJsonPointer": "/templates/1",
    "originalPromptSha256": "3867a44afb4f4a8545db1950c25818c4f6fbf6acf0c46d515095d8b60f737b8a",
    "publicPromptSha256": "3867a44afb4f4a8545db1950c25818c4f6fbf6acf0c46d515095d8b60f737b8a",
    "originalDefaultPromptSha256": "84d945b3890979e930d7fe885cc9895335c27b82ada7330542dd1c02cfdae827",
    "publicDefaultPromptSha256": "84d945b3890979e930d7fe885cc9895335c27b82ada7330542dd1c02cfdae827",
    "transformations": [],
    "defaultInterpolationMatchesOriginal": true,
    "validationNotes": []
  }
}
