erebus

diff liberebus/src/rt.cc @ 31:53a98c148bf8

- introduced SurfaceGeometry to carry all the geometric information input to BRDF sampling and evaluation functions. - made Reflectance keep an (optional) pointer to its material - simplified PhongRefl::sample_dir, with the help of SurfaceGeometry - worked around microsoft's broken std::thread implementation's deadlock on join
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 07 Jun 2014 09:14:17 +0300
parents fb20e3855740
children 5e27c85e79ca
line diff
     1.1 --- a/liberebus/src/rt.cc	Sat Jun 07 06:10:21 2014 +0300
     1.2 +++ b/liberebus/src/rt.cc	Sat Jun 07 09:14:17 2014 +0300
     1.3 @@ -46,7 +46,7 @@
     1.4  	float shininess = mtl->get_attrib_value("shininess");
     1.5  
     1.6  	Vector3 sample_dir;
     1.7 -	float prob = brdf->sample(norm, -hit.world_ray.dir, &sample_dir);
     1.8 +	float prob = brdf->sample(SurfaceGeometry(norm), -hit.world_ray.dir, &sample_dir);
     1.9  	if(iter < max_iter && randf() <= prob && ray.energy * prob > 0.001) {
    1.10  		Ray sample_ray;
    1.11  		sample_ray.origin = ray.origin + ray.dir * hit.dist;