My Authors
Read all threads
Hey all, wanted to share some info about how the shoreline shader is done. (This is a slightly simplified version).

(note : while it's based visually on the ACNH shoreline, it's probably not exactly the same way they are handling it) 😄

See thread!! 🌊🏝️ #unity3D #shadergraph
Firstly, the effect uses UVs, where the Y axis is towards the beach, and the X axis repeats around the island. Creating this was a manual process in Blender. Geometry with UV Y=1 appears as sand, and Y=0 as deeper water without the wave pattern.
For the ocean waves (lines) I'm using a Fraction node with the UV.y input to create a repeating pattern of lines, offset by time so they scroll and noise so they are wobbly.

Note the noise should be sampled using worldspace projected UVs so it tiles correctly (& has no seams).
Note some nodes are repeated in the next images (e.g. UV.y + Noise). You would only want to calculate it once and reuse the output, I've just duplicated it so it's clearer.

I've also labelled some nodes with colours, which will match inputs in later images.
sidenote : Just noticed I used the PI constant multiplied by 2 in these images, rather than just using the TAU constant. 🙃
For the beach foam wave I'm sampling a specific texture, as shown in the top right. It's offset by a sine wave so moves up and down, but put through an absolute so it doesn't go into negative values (which makes it kinda bounce).

Also smoothstep sets up a water mask for later.
This texture is put through a smoothstep with some lerps. The T input is based on repeated time that syncs with the sine movement, using an exponential impulse curve (starts at 0, quickly spikes then slowly decreases), see iquilezles.org/www/articles/f…
Next is creating some masks based on the UV.y-noise and UV.y-noise-abs(sine) and put into lerps to colour the sand/water.
And then inputting into the PBR Master node. See the coloured bars on the nodes which have inputs from previous parts of the graph in other images.
I've left out the normals part for now. Definitely not my speciality so not sure if I'm doing it the best way.

Basically had a seamless ocean normal texture, sampled twice, one scrolling up and the other down (& sampled using worldspace UVs like the gradient noise was).
I also swapped to using World space based normals via the PBR master node cog, and rotated the tangent output using the Rotate About Axis node (axis 1,0,0, -90 deg) due to some seam issues with the tangent normals / tangent->world transform.
My other version also had some caustics based on the Voronoi node, with the angle offset by time. Using the worldspace UVs again so it doesn't produce seams and then masked to the sand area & water mask (red smoothstep).
Had a lot of fun recreating this, and happy with the result.

Enjoy! ❤️✨
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Cyan

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!