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.

Allen white bubbles done

Bubbles in motion.

Allen white finalizedbubblebillboards

Normals finalized, now align perfectly with light direction.

Allen white bubbles wire2

Wireframe view showing billboards and bubble distortion based on view.

Allen white bubbles 3

Much better bubble normals now in place.

Allen white bubbles 3

More WIP shader stills.

Allen white bubbles1

First Test: Just bubbles in front of a cubemap.