Ideal specular reflection is like a perfect mirror. I'm looking at the code to SmallPt and see that one of the spheres has an ideal specular material:
Sphere spheres[] = {//Scene: radius, position, emission, color, material
/ ...
Sphere(16.5,Vec(27,16.5,47), Vec(),Vec(1,1,1)*.999, SPEC),//Mirr
/ ...
};
In the radiance calculation, this happens:
} else if (obj.refl == SPEC) // Ideal SPECULAR reflection
return obj.e + f.mult(radiance(Ray(x,r.d-n*2*n.dot(r.d)),depth,Xi));
where f is the object colour of Vec(.999,.999,.999).
I was surprised to see colour multiplication here. Doesn't an ideal mirror have no colour? I guess as f is Vec(.999,.999,.999), effectively it's passing through the colour almost unchanged? Any thoughts on why .999 was used and not 1? I'm guessing this is something to do modelling a miniscule energy loss?

