muckSponge / Optically-Realistic-Water

A Unity port of Martins Upitis' fantastic ocean water shader, which was originally coded in GLSL for Blender.
MIT License
175 stars 24 forks source link

Optically Realistic Water

A Unity port of Martins Upitis' fantastic ocean water shader, which was originally coded in GLSL for Blender.

water

Contents

The shader actually consists of two parts:

WaterSurface.shader is intended to be used with the water plane and renders reflections, subsurface scattering, etc.

WaterUnder.shader must be applied to any renderers which could potentially be submerged in the water (such as the terrain, etc.).

Water.cs should be attached to the water plane and handles planar reflections and all shader parameters. It is mostly self-explanatory if you are at all familiar with Unity's existing water shader.

Just like in Martins' project, you can click and drag the sun into any position you like.

Features

Additional features/changes

Removed/unported features

Limitations

Due to the required underwater shader, you may find it very difficult to adapt this to an existing project and thus it should be considered more of a prototype or proof of concept. This is also a limitation of Martins' original shader.

The shader uses forward rendering and has not been tested in deferred.