GitXplorerGitXplorer
s

ray-tracer

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
9c93af0845a475aef9ba373521ee705adaf694db

Remove unnecessary include path

sspkersten committed 3 years ago
Unverified
e8355d6914911402199f6ca7a133d903642d0ac3

Add quad and two scenes

sspkersten committed 3 years ago
Unverified
77f2c79bda580a9da59ddcc5e3423a14b1a19c55

Allow sampling from sphere and hittable_list

sspkersten committed 3 years ago
Unverified
df871df7ba78b2be2515745dde7a7295fcdcabda

Use importance sampling to get more rays comming from the light

sspkersten committed 3 years ago
Unverified
e83d6787dce6d3bd7102cd9c88477b5dad83fec4

Organize scenes

sspkersten committed 3 years ago
Unverified
a28df722df6b9ce4aeb96545b16dc4740ae517f7

Add scene class

sspkersten committed 3 years ago

README

The README file for this repository.

Ray tracer

Based on https://raytracing.github.io

Lenses

This image shows, from left to right, a screen, a lens, a horizontal red light source, and a vertical green light source. Both faces of the lens have the same radius of 27, it has a thickness of 10 and a refractive index of 1.5. That gives the lens a focal length of about 25.4. The distance between the screen and the lens is 80. The distance between the horizontal light source and the lens is 37, which is the distance an object should be according to the thin less formula for the image to be in focus and have a 2x magnification. The vertical light is farther way and should be out of focus. While the green bar is indeed slightly less sharp than the red one, the red bar isn't very sharp either. I think that's the case because the lens' is too thick for the thin less formula to be accurate (10 vs 27).

The setup in this image is almost the same, except that here the horizontal and vertical bars aren't light sources, but the light is provided by a bright light source that is just outside of the image to the right. The second change is that the distance between the lens and the horizontal bar as specified by the thin lens formula is now chosen to the face of the lens instead of to its center. This seems to result in a sharper image on the screen.

Because of the non-zero size of the light source in this setup, some light gets past the lens and gives the images a faded appearance around the edge.

Scenes showing various effects

Plane with balls:

Some more diversity of balls:

Explicit diffuse light:

Cornell box:

Cornell box with smokey/foggy boxes:

Constructive solid geometry:

Glass dome Intersection and difference