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.

The normals are very hacky atm, I'll probably take another pass at constructing them more sensibly so the lighting behaves better.

Allen white bubbles 3

Much better bubble normals now in place.

Allen white bubbles 3

Latest bubble shader stills.

Allen white bubbles angle2

Normals still aren't perfect, will have to tinker some more.

Allen white bubbles1

First Test: Just bubbles in front of a cubemap.

Allen white bubbles angle2

First Test: Scene view look at the billboards and how they interact with the camera's view.

Allen white bubbles billboards

Just bog standard billboards...