Skip to content

Instantly share code, notes, and snippets.

@syoyo
Created March 17, 2009 15:07
Show Gist options
  • Save syoyo/80587 to your computer and use it in GitHub Desktop.
Save syoyo/80587 to your computer and use it in GitHub Desktop.
surface
ambocc(float samples = 128)
{
float occ = 0;
normal nf = faceforward(normalize(N), I);
gather("illuminance", P, nf, PI/2, samples, "distribution", "cosine") {
occ += 1;
}
float ave = occ / samples;
Ci = (1 - ave) * Cs;
Oi = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment