Skip to content

Instantly share code, notes, and snippets.

View xoryouyou's full-sized avatar

Till von Ahnen xoryouyou

View GitHub Profile
@transitive-bullshit
transitive-bullshit / billboard_sao.frag
Created September 30, 2013 21:08
WebGL GLSL SAO (Scalable Ambient Obscurance) fragment shader. SAO is a more efficient method for computing SSAO (Screen-Space Ambient Occlusion). Converts the g-buffer to an occlusion buffer which estimates local ambient occlusion at each fragment in screen-space. For details on the technique itself, see: McGuire et al [12] http://graphics.cs.wi…
// total number of samples at each fragment
#define NUM_SAMPLES {{ numSamples }}
#define NUM_SPIRAL_TURNS {{ numSpiralTurns }}
#define USE_ACTUAL_NORMALS {{ useActualNormals }}
#define VARIATION {{ variation }}
uniform sampler2D sGBuffer;