End3r6 / URPUnderwaterEffects

An implementation of underwater effects that show under the water line.
MIT License
60 stars 7 forks source link
caustics effects fog post-processing raymarching refraction renderpass shader shaderlab shaders underwater unity unity-plugin unity3d unityplugin urp volumetric-lighting water

URP Underwater Effects

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

Demo

Also

I'd love to see what you are using this for. If you submit an issue with a couple of screenshots or something I will try to make a section devoted to cool projects using this.

How to use

Download the latest release or download from the green code button. The difference is that the releases are the latest stable versions of the tool while downloading the source gives you the most updated version which is often buggy and experimental.

All effects are render features, so add the ones you want. The Horizon Line Feature needs to be the first one called. In order for the effects to be drawn under the water, set a layer on the object that you want to be the horizon line and use that layer in the horizon pass.

Thanks to Tom Weiland for ideas with the original concept. I just took it way too far lol.

Current Effects

Note

If you have the game view resolution set too low, it is possible there might be a gap between the water and the effects. This is fixed if you just set low res off in the game view settings.

Other Effects

Bubbles are included as a particle prefab.

Known Issues

Extenstion

If you wish to add more effects on top of the existing ones, you need to sample the _HorizonLineTexture. This lets you separate the waterline from the air above the water. I do this many times in the source so check there if you need help.

Cotributions

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