Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Creating Underwater Caustics in URP

Discussion in 'Universal Render Pipeline' started by AtomicLugia, Nov 27, 2020.

  1. AtomicLugia

    AtomicLugia

    Joined:
    Aug 15, 2020
    Posts:
    54
    I'm pretty sure I'm not the only person facing this issue. I want to have some simple underwater caustics under the water (with the terrain, objects, etc. also covered by caustics). I know that projectors won't work, so, is there a way to still achieve this? Also, please no paid assets right now, I hope you understand.
     
  2. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    It's possible by creating a custom Render Feature. You create a material with a custom shader doing some texture projection on world space. My is more complex because it's also handling depth based foam, distortion, blue tinting and texture animation. I won't get into details because it's basic shader stuff, nothing special. The special thing is actually how custom passes in Unity work. If you don't know how to achieve the desired water effects, I recommend to learn shaders in general.
     

    Attached Files:

    Last edited: Dec 1, 2020
  3. AtomicLugia

    AtomicLugia

    Joined:
    Aug 15, 2020
    Posts:
    54
    Will the caustics also be visible when the camera is underwater? BTW, I also use post-processing effects for the UW effect.
     
  4. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Yes, it's visible from both sides of the water plane. My implementation is not a post process effect.