Website powered by

Bubble Shader Experiment

A quick shader experiment while the kid napped today. Works on stock Unity ParticleSystem spitting out basic billboards. Everything is done in the shader (no scripts setting any extra data on the particles), only the vert alpha is used to fade them out at the end of their life. Procedural shape, projected distortion (only 1 texture, I just can't stop being memory conscious), ghetto refraction + reflection + fresnel, depth masks specular response (cause water's thick).

Bubbles above the camera gain extra distortion turbulence (because the bottoms are wobbly as they rise), those near the camera's height get squashed to approximate water resistance (un-evenly tops stay rounder), and those below the camera round out again.

Bubbles in motion.

Bubbles in motion.

Normals finalized, now align perfectly with light direction.

Normals finalized, now align perfectly with light direction.

Wireframe view showing billboards and bubble distortion based on view.

Wireframe view showing billboards and bubble distortion based on view.

Much better bubble normals now in place.

Much better bubble normals now in place.

More WIP shader stills.

More WIP shader stills.

First Test: Just bubbles in front of a cubemap.

First Test: Just bubbles in front of a cubemap.