Implementing Caustics

williangalvaniwilliangalvani Posts: 2Member

Hello, I'm working on a underwater simulator for ROVs (or that least that is the excuse I'm using to learn Godot). Right now I'm trying to implement a caustics shader.

I have it mostly working. I generate voronoi noise, modify it a little, and apply it as a light shader. The issue with this approach is that the shader affects all the lights. I put a mix in there to try to balance caustics and regular lightning, but that didn't solve the issue properly.

The caustics look ok:

But when I turn the ROV lights on, they are also affected by the shaders. In this area the ship wreck casts a shadow, so the only lightning present should be from the ROV (and yes, my shadows need tuning):

https://gfycat.com/braveellipticalfugu

I have three main questions:

  1. Is this even the right approach?
  2. Is there a way to tell which light is currently running so I can run only the directional light through the caustics shader?
  3. Will I have to apply this light shader independently to each material for each object underwater?

Thank you in advance!

Comments

  • williangalvaniwilliangalvani Posts: 2Member

    I ended up filtering the light by checking if the light vector has the same direction as I have set for the directional light.

    My plan now is to turn the light part into a custom visual shader node and use it in all my underwater materials.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file