top of page

2D Caustics Shader Breakdown

In DARUMA there is some places with water. I have searched for differents solutions for the player "feel in a damp place". I worked on particles, 2D water, but one of the solution is to simulate fake caustics on walls. It's not exactly physically realistic, but it does feel like a dark and damp cave when combined with sound and context.

DARUMA caustics on background wall

Caustics are results of ray lights reflections/refractions on a surface.

Great Barracuda, corals, sea urchin and Caustic

To make the shader I have used two seamless caustics textures with opposites scrolling movements. I have used world position as UV with an additive gradient noise for the distorsions. The sprite color and opacity are used for main color and final opacity.


This is the full shader graph :

2D Caustics graph

And here is the caustics subgraph :

Caustics subgraph

To display fake caustics, I use soft or smooth sprites shapes, but it's possible to display effect on a secondary map or a mask for example.


Result :

Caustics with secondary map enable

Comments


bottom of page