A ray tracer written in Go - adapted from Ray Tracing In One Weekend
- Get better at Go programming
- Learn about the basics of computer graphics (e.g., Tracing, Refraction, Linear Algebra applications)
- Learn about concurrency and using multiple CPU cores for rendering
- Multi-threaded rendering
- Materials (Glass, Metal, etc)
- Unit Tests
go install
The ray tracer can be run in either single-threaded or multi-threaded mode:
# Run with multi-threading (default)
go run main.go
# Run with single threading
go run main.go -multi=false
Performance measurements for the sample scene (on average):
- Single-threaded mode: ~38 seconds
- Multi-threaded mode: ~20 seconds
The multi-threaded implementation provides approximately a 47% reduction in rendering time compared to the single-threaded version! (Results may vary based on your CPU, system resources, etc)