This repository provides a Go language implementation of Peter Shirley's Ray Tracing in One Weekend. A Japanese version of the original book is also available.
rendered in 40-60sec with i5-8250
go run ./src > output.png
This takes some options:
-aspect float
aspect ratio (default 1.7777777777777777)
-depth int
depth for ray tracing (default 10)
-samples int
samples per pixel (default 16)
-scene string
scene type (default "random")
-threads int
number of parallel threads (default 8)
-width int
image width (default 384)
make scene_final
SOme other preset renderers are available as make target:
scene_test
,scene_random
,scene_light
,scene_cornell
,scene_somke
This is designed to render one image per execution. To simplify the process of repeatedly compiling and rendering images, we recommend using the make loop
command. This command is designed to work best with a .png viewer capable of detecting changes in the displayed image and reloading it automatically.
make loop
Please note that you need to have make
installed in your system for the above command to work.