SmallPT is a photorealistic renderer. It uses Monte Carlo path tracing to render the scene. It contains 3 materials: diffuse material, mirror and glass, and one primitive: sphere. For more info, read the official Kevin Beason's webpage.
Try it yourself
Below is the official 99-line JS version of SmallPT. You can pass it 3 comma-separated parameters: width, height and number of iterations. E.g.
will produce a 800x600 image with 4 iterations of algorithm (more iterations = better image).
I also have written another version with explicit light sampling, also from Kevin Beason. I added several scenes and a simple UI with continuous updating of bitmap.