Interactive Water Shader for platformer
Effects ... Offline manual (Documentation.rtf) with a table of contents, a step by step setup ... The Built-in Render Pipeline and HDRP are not supported. ... Surface for calm water and flow.
by Roam Moon
Price History +
Effects
- 16 modes on one component, in five families: Surface, Waves, Bodies, Foam and Ripples
- Water Color, Normal Map Waves, Flow Map, Sine Waves, Voronoi Waves, Wave Crest, Ocean Waves, Pool Water, Waterline, Water Depth Color, Foam, Shore Foam, Edge Foam, Ripple, Interaction Ripples, Splash Particles
- Every mode ships pre tuned; changing the mode loads its preset, and Undo works
Interaction
- Ripple API: AddRipple(uv, strength) and AddRippleAtWorldPosition(world, strength), up to 8 live at once, each fading over 3.5 seconds
- Ripple Strength from 0 to 4 scales every ripple on a sprite, on top of the strength passed to the call
- WaterBuoyancy hands the animated waterline to Unity's Buoyancy Effector 2D, so anything with a Rigidbody 2D floats, bobs and tips on real 2D physics
- SampleSurfaceHeight and TryGetSurfacePoint give the surface height and slope at any point, for gameplay that needs to follow the water
Settings
- Amount, Speed, Phase, Randomize Phase On Enable, Frequency, Direction
- Level, Depth, Foam, Distortion, Shine, Opacity, Edge Fade, Ripple Strength
- Shallow, Deep and Foam colors plus an HDR Highlight color
- One Bottom texture slot for the modes that show a floor, tiles included
- Custom Inspector that dims the settings the selected mode ignores
Rendering
- Universal Render Pipeline with the 2D Renderer
- Unlit and Lit 2D, switched from a dropdown on the component
- Nothing outside the sprite is sampled: no grab pass and no scene texture
- Per sprite values on a MaterialPropertyBlock, one material shared by every sprite
- Animation runs from shader time, so Speed, Phase and Randomize Phase keep copies out of lockstep with no per frame script cost
- Works on Sprite Atlas and on the default Square sprite
Package
- 3 demo scenes: all 16 modes unlit, all 16 on Lit 2D, and a duck drop interaction scene
- Runtime slider panel in the demos for Amount, Speed, Frequency, Level, Depth, Foam, Distortion, Shine and Ripple Strength
- Offline manual (Documentation.rtf) with a table of contents, a step by step setup guide and a full script reference
- Assembly definitions; the demo assembly only compiles when Unity UI is present
- Full source: 2 Shader Graph assets, 2 HLSL files and 8 C# scripts, no DLLs
Requires Unity 6000.0 or newer, URP with the Shader Graph package and the 2D Renderer. The Built-in Render Pipeline and HDRP are not supported.
Water your player can actually touch.
Drop a crate, a coin or a duck into it and the surface opens where it lands. The ripple runs out along the waterline, the foam rides the crest, and the object settles and bobs on Unity's own Buoyancy Effector 2D. Nothing about it is a canned animation.
It is built for the side view, so the water fills the sprite up to a Level line, everything above that line is transparent, and the body underneath is posterized into flat cartoon bands. Drop the component on a plain square and you have a pool. Stretch that square into a lake, a canal or a narrow well and the waves, foam, bubbles and dashes stay the same size, because every shape is measured in world units rather than in the sprite's UV.
Sixteen looks ship as modes on one dropdown, in five families. Surface for calm water and flow. Waves for sine, voronoi, breaking crests and layered ocean. Bodies for tiled pools, waterlines and depth. Foam for shorelines and edges. Ripples for interaction and splash droplets. Every mode arrives pre tuned, and switching modes loads that mode's own values, with Undo.
Everything is customizable from the Inspector or from code: wave height and speed, how many waves cross the sprite, how high the water sits, how dark it reads with depth, how thick the foam grows, four colors including an HDR highlight, opacity so what is behind the water shows through, and how hard a ripple hits. The custom Inspector dims the settings a mode does not use, so you are never guessing which slider matters.
It runs on URP with the 2D Renderer, unlit or Lit 2D from a dropdown, and it samples nothing outside its own sprite. No grab pass, no scene texture, no camera setup to get right. Per sprite values go through a MaterialPropertyBlock, so a hundred puddles with a hundred different looks still share one material.
Three demo scenes are included: a grid of all sixteen modes unlit, the same grid on the Lit 2D shader, and an interaction scene with a duck you can drop into the water by clicking. An offline manual with a full script reference is in the package.