Skip to content

Instantly share code, notes, and snippets.

float D_GGX_Anisotropic(float at, float ab, float ToH, float BoH, float NoH) {
// Burley 2012, "Physically-Based Shading at Disney"
float a2 = at * ab;
vec3 d = vec3(ab * ToH, at * BoH, a2 * NoH);
return saturateMediump(a2 * sq(a2 / dot(d, d)) * (1.0 / PI));
}
float V_SmithGGXCorrelated_Anisotropic(float at, float ab, float ToV, float BoV,
float ToL, float BoL, float NoV, float NoL) {
// Heitz 2014, "Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs"
@wayhome
wayhome / tornado_patch.py
Created August 5, 2011 05:00
profile patch for tornado
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Monkey Patch for tornado
"""
import cProfile as profile
from tornado.options import options
from tornado.web import HTTPError
@josiahcarlson
josiahcarlson / redis_simple_chat.py
Created June 24, 2011 22:07
A way of implementing a poll-based chat inside Redis
'''
redis_simple_chat.py
Written June 24, 2011 by Josiah Carlson
Released under the GNU GPL v2
available: http://www.gnu.org/licenses/gpl-2.0.html
Other licenses may be available upon request.
@didip
didip / tornado-nginx-example.conf
Created January 30, 2011 05:19
Nginx config example for Tornado
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}