Added Heidrich-Seidel anisotropic BRDF.

This commit is contained in:
Miguel Angel Astor Romero
2017-01-13 15:05:13 -04:00
parent b7f7ba7ee1
commit 8e2b2a8c2a
12 changed files with 111 additions and 57 deletions

View File

@@ -7,12 +7,12 @@ using glm::pow;
using glm::max;
using glm::dot;
vec3 PhongBRDF::diffuse(vec3 light_dir, vec3 surface_normal, Ray & incident_ray, vec3 light_diff_color) const {
vec3 PhongBRDF::diffuse(vec3 light_dir, vec3 surface_normal, Ray & incident_ray, vec3 intersection_point, vec3 light_diff_color) const {
float n_dot_l = max(dot(surface_normal, light_dir), 0.0f);
return light_diff_color * n_dot_l;
}
vec3 PhongBRDF::specular(vec3 light_dir, vec3 surface_normal, Ray & incident_ray, vec3 light_spec_color, float shininess) const {
vec3 PhongBRDF::specular(vec3 light_dir, vec3 surface_normal, Ray & incident_ray, vec3 intersection_point, vec3 light_spec_color, float shininess) const {
vec3 ref = reflect(light_dir, surface_normal);
float r_dot_l = pow(max(dot(ref, incident_ray.m_direction), 0.0f), shininess);
return light_spec_color * r_dot_l;