My first attempt at glossy surfaces, with only hard shadows. The sphere looks a little glossy, but far from the result I'm looking for.

Problems:
1) The 'glossyness' should be much more pronounced close to the middle of the sphere, and less at the 'edge'. _Some_ of this effect is visible, but my approach is too simple

2) Clearly, the highlight is not taken into account... it is still completely sharp, and that pretty much ruins the effect of a glossy surface

To generate random reflection rays, defined by a cone from the intersection point, I created random points on a sphere at a fixed distance, and shot a max of 150 sample rays per hit.

This includes hits by reflected rays from other objects, not just primary rays. (Next up is testing whether it really has a significant effect to do "glossy rays" from rays that are reflected from other objects)

As with every new distribution ray tracing algorithm I introduce, this one is COSTLY... it is painfully slow to render glossy surfaces.

To try to minimize the number of glossy reflection rays, I test if a predefined number of reflection rays return colors that exceed a predefined threshold. If, say, 20 reflection rays return RGB's that are all within the threshold, I stop shooting rays.

Still, with a reflection/refraction-depth-level of 5, it is HARD on the cooling fans, and it takes several minutes to render with two (90%) threads on a core i7.

This image was done without the threshold-thingie and took almost an hour to render.

Without the 'glossy' sphere it would have been done in about a minute.