Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahuth/raytrace2
Implementation of ray tracer from Ray Tracing in One Weekend
https://github.com/ahuth/raytrace2
Last synced: 3 months ago
JSON representation
Implementation of ray tracer from Ray Tracing in One Weekend
- Host: GitHub
- URL: https://github.com/ahuth/raytrace2
- Owner: ahuth
- Created: 2020-06-02T19:58:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-01T13:54:00.000Z (over 4 years ago)
- Last Synced: 2023-04-04T16:46:45.155Z (almost 2 years ago)
- Language: TypeScript
- Homepage:
- Size: 283 KB
- Stars: 14
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Raytrace 2
Follow-up to https://github.com/ahuth/raytrace, this implements a raytracer by following [Ray Tracing in One Weekend](https://raytracing.github.io/books/RayTracingInOneWeekend.html), by Peter Shirley.

## Usage
Generate the image by running the following command:
```
yarn build
```A git-ignored `image.ppm` file will be generated at the root of the project.
## Screenshots
These images were captured at various points in the book. Here they're listed in reverse order, so the earliest sections are at the bottom.
- [Section 13.1](https://raytracing.github.io/books/RayTracingInOneWeekend.html#wherenext?/afinalrender). The final render.

- [Section 12.2](https://raytracing.github.io/books/RayTracingInOneWeekend.html#defocusblur/generatingsamplerays). Add a depth of field effect.
.
- [Section 11.1](https://raytracing.github.io/books/RayTracingInOneWeekend.html#positionablecamera/positioningandorientingthecamera). Add the ability to move the camera around, and point it at different directions and angles.

- [Section 10.5](https://raytracing.github.io/books/RayTracingInOneWeekend.html#dielectrics/modelingahollowglasssphere). Use two glass spheres to create a hollow sphere.

- [Section 10.2](https://raytracing.github.io/books/RayTracingInOneWeekend.html#dielectrics/snell'slaw). Add glass as a material.

- [Section 9.6](https://raytracing.github.io/books/RayTracingInOneWeekend.html#metal/fuzzyreflection). Add "fuzziness" to reflections off of metal spheres.

- [Section 9.5](https://raytracing.github.io/books/RayTracingInOneWeekend.html#metal/ascenewithmetalspheres). Add metal spheres that reflect light.

- [Section 8.3](https://raytracing.github.io/books/RayTracingInOneWeekend.html#diffusematerials/usinggammacorrectionforaccuratecolorintensity). Use gamma correction to get correct color intensities.

- [Section 8.2](https://raytracing.github.io/books/RayTracingInOneWeekend.html#diffusematerials/limitingthenumberofchildrays). Add diffuse materials. These are matte and light bounces off of them in random directions.

- [Section 7.2](https://raytracing.github.io/books/RayTracingInOneWeekend.html#antialiasing/generatingpixelswithmultiplesamples). Average together multiple samples for each pixel, resulting in a smoother looking image.

- [Section 6.7](https://raytracing.github.io/books/RayTracingInOneWeekend.html#surfacenormalsandmultipleobjects/commonconstantsandutilityfunctions). Add a second sphere representing the ground.

- [Section 6.1](https://raytracing.github.io/books/RayTracingInOneWeekend.html#surfacenormalsandmultipleobjects/shadingwithsurfacenormals). Shade the surface of a sphere.

- [Section 5.2](https://raytracing.github.io/books/RayTracingInOneWeekend.html#addingasphere/creatingourfirstraytracedimage). Actually draw a ray-traced sphere!

- [Section 4.2](https://raytracing.github.io/books/RayTracingInOneWeekend.html#rays,asimplecamera,andbackground/sendingraysintothescene). Send rays into a scene and use them to draw a blue gradient.

- [Section 3](https://raytracing.github.io/books/RayTracingInOneWeekend.html#thevec3class). Draw a color gradient.
