Stylized water for Unity URP, built for phones first and at home on desktop.
ShoreLine is a hand-written URP shader with everything a stylized game needs: water that changes colour with depth, foam lines where it touches rocks and the shore, foam bands rolling up the beach, Gerstner waves, caustics, refraction and reflections. Waves calm down by themselves in shallow water, and an Ocean Mode carries the sea to the horizon.
It was tuned on real phones, a 2016 OnePlus 3T and a Pixel 7 Pro, into three quality tiers. Every feature is a per-material toggle, so what you switch off costs nothing and is stripped from your build. The CPU knows the waves too: float boats and place props with height queries that match the screen.
Description
WATER
- Depth colour: shallow and deep colours by real water depth, plus a horizon colour at grazing angles
- Intersection foam where objects and the shore touch the water, with soft edges
- Shore waves: foam bands that roll toward the beach, from the water depth alone (no masks to paint)
- Surface foam on open water, with extra foam on wave crests
- Caustics, refraction (objects in front never bleed in), reflections, received shadows, sun glint
- Edge fade where the water meets objects
WAVES
- Up to 4 Gerstner waves, normalised so the surface never folds over
- Shallow Water Damping: waves calm down in shallow water, read from the depth texture in the vertex shader
- Distance fade, and renderer bounds that grow with the waves so water never pops out at the screen edges
OCEAN MODE
- A fine grid follows the camera, snapped so the waves never swim, with a ring out to the horizon
- One seamless mesh, made by the included Create Water Mesh window
- Per-pixel fog that stays correct on kilometre-long ring triangles
MOBILE AND QUALITY
- Low, Medium and High tiers, each a set of features you can apply to any material
- Pixel 7 Pro (Vulkan, 3120x1440): 60 fps on every tier with the water covering the screen
- OnePlus 3T (OpenGL ES 3, 2016): Low holds 60 fps until the phone throttles; Medium averages 37 fps sustained at 1080p
- Works without the depth or opaque texture too: depth effects read as deep water, refraction falls back to transparency, never black or pink
FOR PROGRAMMERS
- SampleHeight: the water’s height anywhere, from the same Gerstner math as the shader, so boats float on the waves you see
- Surface Effects API: draw ripples, wakes and foam into the water from your own scripts and shaders
- Reusable HLSL includes for depth, waves, foam, lighting, refraction and caustics
- Clean C# in assembly definitions, one URP renderer feature (Render Graph), 148 automated EditMode tests
DEMO
- An island with a beach, rocks, a lagoon, an ocean and a pier with one pool per preset
- Touch controls (orbit, pinch, pan), viewpoint buttons and live Low / Medium / High switching with an fps readout
IN THE BOX
- The shader with a custom material inspector and a one-click renderer setup
- 5 presets (Tropical, Lake, Swamp, Pool, Toon) and Low / Medium / High defaults
- Generated, seamlessly tiling normal, foam and caustics textures
- Create Water Mesh window, Water Surface component, demo scene, documentation
- No third-party code, fonts, textures or models
REQUIREMENTS
- Unity 6 (6000.0) or newer, tested on 6000.0, 6000.3 and 6000.6
- Universal Render Pipeline 17+ with a Universal Renderer (Forward or Forward+) and Render Graph on
- Perspective and orthographic cameras
If you have any questions, requests or something isn’t working, please send me an email at: support@hardartcore.com
Release notes
- v1.0.0
- First release.