A ray-tracer written in golang.
Roughly following the Ray Tracing in One Weekend blog.
To install, place the package in your go/src
folder:
~ go get github.com/am-khan/ray_tracer/cmd/ray_tracer
To run (with build):
~ ray_tracer
Using 16 goroutines.
[================================================================================] 100.00%
Done.
Elapsed: 25.709205942s
Currently, the environment supports spheres, aliasing and 3 types of materials:
- Lambertian
- Metallic
- Dialectric
To set up a new object, go to configs/config.json
and specify the properties there.
go build github.com/am-khan/ray_tracer/cmd/ray_tracer
Images are created at ./image.png
with the dimensions and attributes set within configs/config.json
.
To run the unit tests - use the built-in go test runner:
~ go test ./...