Friday 30 October 2015

Water in Unity

While fantastic at a glance (well, almost...) water in Unity can be tricky to setup. Water and Pro Water aren't too difficult to figure. Water 4 may not always reward your patience.

Unity ships with 3 water assets

  • Simple water does not provide reflection or reflection
  • ProWater supports reflective and refractive water (foam can be added)
  • Water 4 supports reflective and refractive water with foam and mesh animation.
Compared with Pro Water, Water 4 looks "later and better". 

Foam with Pro Water

  • There's a modified script here. Adds an interesting foam effect; works somewhat differently from foam in Water 4 (tested).
  • Modified water here (inc. underwater)
  • Shoreline generator
More about Water 4

Where does the color come from?

Base color, mostly. However, if you zero Fresnel power, colour is mostly the reflection colour.

What controls the foam?

Tip: Replace the foam texture with something obvious to get a better idea of what's going on.

Under 'Auto-blend', edge controls blending of water with land. High values (1 or more) make foam more visible. To make the foam ring thinner, use high values (1 or more) of shore whereas foam will be very spread out if your values are something like 0.5 or less.

Bump tiling decides how big the foam texture is tiling. Looks like they are tiling two layers of foam too. 

Foam intensity can help to make foam more visible. Above 1, tends to whiten everything.

An annoyance is that 'foam' is also used everywhere on the water surface. feels like a kind of rippling reflection. Disabling Gerstner displace can help.

No comments:

Post a Comment