shaders-cursor-ripples

Adds cursor-following WebGPU water ripple distortion to images using the Shaders library.

5.7k|685|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/MengTo/Skills --skill shaders-cursor-ripples
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shaders-cursor-ripples
Source: https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/shaders-cursor-ripples
Command: npx skills add https://github.com/MengTo/Skills --skill shaders-cursor-ripples

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires shaders, and includes assets (resource) components.

What problem does it solve?

Replacing fragile custom spotlight or flashlight reveal effects with a maintainable cursor-following fluid distortion is hard: manual pointer tracking, radial masks, and duplicated images cause coordinate drift and accessibility issues. This Skill implements the Shaders library's CursorRipples effect over an existing image while preserving layout, brand, and fallbacks.

Core Features & Use Cases

  • WebGPU Ripple Composition: Renders an existing image through a single Shader canvas with ImageTexture and CursorRipples, with correct component ordering and ACES tone mapping.
  • Safe Fallback Pattern: Keeps a semantic image beneath the canvas, lazy-loads the shader module, and disables the effect for reduced motion or missing WebGPU support.
  • Legacy Cleanup: Removes old reveal code such as radial masks, duplicated images, and manual requestAnimationFrame pointer loops.
  • Use Case: A hero section on a landing page uses a drifting CSS spotlight reveal; you replace it with a water-ripple mouse effect that follows the cursor over the same image without changing copy, colors, or layout.

Quick Start

Use the shaders-cursor-ripples skill to add a cursor-following WebGPU water ripple effect to the hero image on this page while keeping the existing layout and fallback image.

Frequently Asked Questions about shaders-cursor-ripples

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a cursor-following ripple effect to an image in React?

Install the shaders package and render the image through a Shader component with ImageTexture followed by CursorRipples. Lazy-load the shader module behind a WebGPU check and keep the original img element as an accessible fallback beneath the canvas.

What is the difference between Shaders CursorRipples and Water components?

CursorRipples is the interactive image-displacement effect that responds to pointer movement, while Water is a different generator. For a mouse-driven ripple over an existing image, use CursorRipples placed after ImageTexture so it post-processes that image.

Does the Shaders library work with Next.js and Vite?

Yes. Import from framework subpaths like shaders/react, and in Next.js use a client-only dynamic import with ssr disabled. For Vite, do not add shaders to optimizeDeps.exclude because its CommonJS dependencies need pre-bundling.

Why is the ripple canvas blank or not reacting to the mouse?

A blank canvas usually means the wrapper has zero dimensions or the image URL is not same-origin or CORS-readable. If the image renders but does not ripple, CursorRipples is likely placed before ImageTexture instead of after it.

How do I handle reduced motion and browsers without WebGPU?

Check for navigator.gpu and the prefers-reduced-motion media query before mounting the shader, and unmount or disable it when either fails. Keep the semantic fallback image visible so the page stays complete and accessible without the effect.