diff options
author | Eric Anholt <eric@anholt.net> | 2009-08-07 14:52:13 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-08-07 14:52:13 -0700 |
commit | 0d8ee697506809635cefa2bbf43f1e968fb752b2 (patch) | |
tree | 5daaca28beb52ca77c65105380122629f8729b72 | |
parent | fd654e927eaba350542818ba1230d75de4136a98 (diff) |
Drop old brdf options from previous experimentation
-rw-r--r-- | glass.frag | 23 |
1 files changed, 0 insertions, 23 deletions
@@ -13,20 +13,6 @@ float schlick_fresnel(float n_dot_l) return F0 + (1 - F0) * pow(1 - n_dot_l, 5); } -/* This returns garbage compared to Schlick. */ -float fresnel(float v_dot_h) -{ - float c = v_dot_h; /* cos theta, v . h or l . h */ - float g = sqrt(ni * ni + c * c - 1); - float gmc = g - c; - float gpc = g + c; - float c_gpc_m_1_squared = (c * gpc - 1) * (c * gpc - 1); - float c_gmc_p_1_squared = (c * gmc + 1) * (c * gmc + 1); - - return gmc*gmc / (2 * gpc*gpc) * (1 + c_gmc_p_1_squared / - c_gpc_m_1_squared); -} - void main() { float shadow = shadow2DProj(shadow_sampler, shadow_coords).x; @@ -71,16 +57,7 @@ void main() float cos2_phi_over_m2 = ((cos_phi * cos_phi) / (ward_m * ward_m)); float sin2_phi_over_n2 = ((1 - cos_phi * cos_phi) / (ward_n * ward_n)); -#if 1 D = exp(-tan2_alpha * (cos2_phi_over_m2 + sin2_phi_over_n2)); -#else - /* Ward's "computationally convenient" equation. - * Doesn't work. - */ - D = exp(-2 * (cos2_phi_over_m2 + - sin2_phi_over_n2) / - (1 + n_dot_h)); -#endif Rs = 2 * schlick_fresnel(n_dot_l) * D / sqrt(n_dot_l * n_dot_v) / (ward_m * ward_n); |