aniruddhahar / URP-WaterShaders

Procedural Water surface and underwater caustics for Unity URP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

URP-WaterShaders

Procedural Water Surface and Underwater Caustics with distortion for Unity URP

This project demonstrates three procedural shadergraphs, for creating immersive underwater caustics and water surface with distortion. All shadergraphs are meant to be used as templates for your own shaders.

Demo Video

URP-WaterShaders

https://youtu.be/1XAbvmTKjJI

NOTE: In order to use the graphs in your own projects, export them as a unitypackage, rather than copying the shadergraph files. This will ensure the subgraph references are not lost

Instructions

  1. Open the project with Unity (2022.2.5f1 and URP/Shadergraph 14 or later recommended) and open SampleScene.unity in the Scenes folder
  2. Make sure the render pipeline is set to URP in Project Settings> Graphics
  3. Select the UniversalRenderPipelineAsset and make sure Opaque Texture and Depth Texture are both enabled.
  4. Under Player settings, select Linear color space for best color representation
  5. In the Asset>Graphs folder you can find two separate shadergraphs for Underwater Caustics and Water surface
  6. These graphs have several customization options, such as:
    1. Adjustable Shorelines using the depth texture
    2. Water clarity, opacity, refraction (through distortion)
    3. Triplanar Underwater caustics
    4. Adjustable flow speeds for surface as well as caustics
  7. A full screen render feature is added for underwater tint and distortion. With URP 14+ You can also use a local volume for tint, but it will not include distortion.

Instructions for HDRP

  1. Make sure the project is properly set up and all graphs are working.
  2. Remove URP completely from the project.
  3. Install HDRP from the package manager. Use the HDRP wizard to fix any issues during setup.
  4. In the WaterSurface Shadergraph, change the 'Scene Color' Node to 'HD Scene Color'. This will fix the overexposed water .
  5. In the WaterUnder Shadergraph, find the Position node, and change the space to Absolute World. This will fix caustics moving with the camera.

About

Procedural Water surface and underwater caustics for Unity URP

License:MIT License