Esempio n. 1
0
 def evaluate_V(self, n, l, v, material):
     alpha   = np.maximum(1e-1, sqr(material.roughness))
     n_dot_l = sat_dot(n, l) + 1e-5
     n_dot_v = sat_dot(n, v) + 1e-5
     h       = half_direction(l, v)
     n_dot_h = sat_dot(n, h) + 1e-5
     v_dot_h = sat_dot(v, h) + 1e-5
     
     return self.V(n_dot_v=n_dot_v,
                   n_dot_l=n_dot_l,
                   n_dot_h=n_dot_h,
                   v_dot_h=v_dot_h, alpha=alpha)
Esempio n. 2
0
 def __call__(self, n, l, v, material):
     alpha   = np.maximum(1e-1, sqr(material.roughness))
     n_dot_l = sat_dot(n, l) + 1e-5
     n_dot_v = sat_dot(n, v) + 1e-5
     h       = half_direction(l, v)
     n_dot_h = sat_dot(n, h) + 1e-5
     v_dot_h = sat_dot(v, h) + 1e-5
 
     D       = self.D(n_dot_h=n_dot_h, alpha=alpha)
     F       = self.F(v_dot_h=v_dot_h, F0=material.F0)
     V       = self.V(n_dot_v=n_dot_v,
                      n_dot_l=n_dot_l,
                      n_dot_h=n_dot_h,
                      v_dot_h=v_dot_h, alpha=alpha)
     
     return 0.25 * D * F * V
Esempio n. 3
0
 def evaluate_F(self, n, l, v, material):
     h       = half_direction(l, v)
     v_dot_h = sat_dot(v, h) + 1e-5
     
     return self.F(v_dot_h=v_dot_h, F0=material.F0)
Esempio n. 4
0
 def evaluate_D(self, n, l, v, material):
     alpha   = np.maximum(1e-1, sqr(material.roughness))
     h       = half_direction(l, v)
     n_dot_h = sat_dot(n, h) + 1e-5
     
     return self.D(n_dot_h=n_dot_h, alpha=alpha)