You are on page 1of 2

DESCRIPTION:

------------

Use this effect in combination with your favorite water asset to produce a "water
caustics" effect.
The main effect relies on the projector component, but I've included a new Surface
Shader as an alternative option.

RESOURCES INCLUDED:
-------------------

* CausticsDistort.shader
* CausticsDistortAlpha.shader
* CausticsDistortMobile.shader
* CausticsSurface.shader
* caustic_custom.bmp
* caustic_custom_gray.bmp
* caustic_noise.bmp
* terrain_albedo.bmp
* terrain_bump.bmp
* Terrain.3ds
* StandardCaustics.unitypackage
* WaterCaustics.unitypackage

The unitypackage files include additional Prefabs and Materials with default
settings!

HOW TO USE:
-----------

Import the custom package into Unity. Drag the prefab into your scene and adjust
the projector component settings and material properties to fit your scene!
Textures are included for convenience, use any textures you want.

IMPORTANT NOTES:
----------------
To turn off "Wetness" in the Surface Shader, simply set its value to the same as
the "Smoothness" value from the surface shader properties.
Don't forget to set texture "tiling" properties on the material.
Make sure the texture's Import Settings are set to "Repeat".
For blur/depth effect, make sure mip-maps are enabled in the texture's Import
Settings. Adjust the fade-out property if necessary.

VERSION HISTORY:
----------------

Updates 2020-04-27
- Added "tri-planar" mapping for better rendering on the sides of vertical objects.

This solution was trial-and-error, I barely understand it, based on examples from
Minions Art and Brent Owens.

Updates 2020-02-09
- Includes new water caustics Surface Shader.

Updates 2020-01-17
- New "_Diffraction" property affects color separation.
Thanks to Alan Zucconi for the diffraction technique.
(https://www.alanzucconi.com/2019/09/13/believable-caustics-reflections/)
Updates 2019-11-17
- New version uses existing "_DepthBlend" property and mip-maps to produce a
height/depth blur effect.
- Includes a Mobile version tested on Android, which uses SinTime for improved
results.
- New "_DepthFade" property for better control over _DepthBlend effect.

Updates 2019-02-20
- Added an "alpha" version of the shader for masking.
- Changed a couple variable types to improve precision on mobile.

Updates 2018-10-10
- Improved "Caustic" and "Noise" texture.
- Added a "dual texture blend" option. (This is a duplicate of the main texture
that scrolls in the opposite direction)
- Replaced "Size" variable with standard texture tiling properties. ("Offset" has
no affect)
- Improved "DepthBlend" transition.
- New "Distance" and "DistanceBlend" variables fade out the effect based on
distance from camera.

-----------------------------------------------------------
Made with Unity 5.6.5, also tested successfully in Unity 2018 and 2019. The
projector is broken in Unity 5.3.x [www.unity3d.com]
Use at your own risk. You may modify this code, use it in your personal or
commercial projects, and redistribute, granted credit is given. Created by Chris
Cunningham.

You might also like