Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.91 KB

README.md

File metadata and controls

47 lines (36 loc) · 1.91 KB

URPUnderwaterEffects

An implementation of underwater effects that show under the water line.

Instalation

Download the files by clicking the green Code button on the top right corner of this repo. Extract the zip file and drag the folder into your assets of your unity project.

Legal Stuff

Feel free to use this in anything commercial or personal. Credit would be greatly appreciated but isn't required.

How to use

In your URP render settings, click add feature and choose Horizon Line Texture and any of the additional effects shown. Set the Horizon Line Texture render pass event to before post processing and set the additional effect's render pass events to before post processing. Make sure that the horizon texture pass is the first pass called. It should work after that.

If you are using hlsl (urp shader code), make sure your shader has the following snippet in the pass or subshader blocks.

Blend SrcAlpha OneMinusSrcAlpha
LOD 300

Tags
{
  "Queue" = "Transparent" 
  "RenderType" = "Transparent" 
  "RenderPipeline" = "UniversalRenderPipeline"
}

If you are using shader graph, make sure your graph settings look like this: Shader graph settings

Extenstion

If you wish to add more effects on top of the existing ones, you need to sample the _HorizonLineTexture. This lets you seperate the waterline from the air above the water.

Roadmap

  • Caustics
  • Distortion
  • Sunrays
  • Better Waterline Transition

Cotributions

If you wish to contriubute to this repo, feel free to make a pull request.

Demo

Distortion Caustics Sunrays