Water Inputs#

Inputs provides a means for developers to control the various simulations powering Crest. The following video covers the basics:

Fig. 2 Crest 4: Basics of Adding Inputs (outdated but still useful)#

Inputs#

Each simulation target has an associated generic input:

There are also inputs which are more specific like the Sphere Water Interaction.

Input Modes#

Inputs (eg Flow Input) can have multiple authoring modes. Support for modes will vary across inputs. More complicated inputs will have their own component like the Sphere Water Interaction.

Geometry Mode#

This mode is the same as using the Renderer Mode with a Mesh Renderer, except much easier to set up. All you need to provide is a mesh and change the Transform to your needs.

Global Mode#

Global is applied everywhere.

Texture Mode#

This mode uses a compute shader to apply your texture to the target simulation. It performs better than shader equivalents by reducing draw calls as typically a shader needs to do one draw call per LOD (eg if LOD Count is seven then that is seven draw calls per input).

This a great utility for customization and integration with Crest, as it abstracts away the complexity of the system if you treat the texture as an intermediary between your own simulations/effects and Crest’s.

Spline Mode#

Please see the Splines manual.

Renderer Mode#

This is the most advanced type of input and allows rendering any geometry/shader into the water system data. One could draw foam directly into the foam data, or inject a flow map baked from an offline simulation.

The geometry can come from a Mesh Renderer, or it can come from any Renderer component such as a Trail Renderer, Line Renderer or Particle System. This geometry will be rendered from a orthographic top down perspective to “print” the data onto the water. For simple cases, it is recommended to use an upwards facing quad for the best performance.

Note

It is recommended to use unlit shader templates or unlit Shader Graph for data if not using one of ours.

The following shaders can be used with any input:

  • Override sets the data to a value.

  • Scale scales the water data between zero and one inclusive. It is multiplicative, which can be inverted, so zero becomes no data and one leaves the data unchanged.

  • Utility a very configurable shader exposing blend modes and operations.