Raytracer written in Go, based on the book The Ray Tracer Challenge by Jamis Buck.
- ✅ Chapter 1: Tuples, points and vectors
- ✅ Chapter 2: Drawing on a canvas
- ✅ Chapter 3: Matrices
- ✅ Chapter 4: Matrix transformations
- ✅ Chapter 5: Ray-Sphere intersections
- ✅ Chapter 6: Light and Shading
- ✅ Chapter 7: Making a Scene
- ✅ Chapter 8: Shadows
- ✅ Chapter 9: Planes
- ✅ Chapter 10: Patterns
- ✅ Chapter 11: Reflection and Refraction
- ✅ Chapter 12: Cubes
- ✅ Chapter 13: Cylinders and Cones
- ✅ Chapter 14: Groups
- ✅ Chapter 14.5: Bounding Boxes
- ✅ Chapter 15: Triangles
- ✅ Chapter 15.5: OBJ files
- Teapot Low
- Teapot
- Teapot Low Smooth
- Teapot Smooth
- Model 3
- Model 3 OBJ source
- 737,161 Triangles
- ✅ Chapter 16: Constructive Solid Geometry
pkg: github.com/factorion/graytracer/pkg/primitives cpu: AMD Ryzen 7 5800H with Radeon Graphics
Function | Iterations | Speed | Memory | Allocations |
---|---|---|---|---|
BenchmarkSubmatrix4x4-16 | 10416955 | 114.4 ns/op | 152 B/op | 4 allocs/op |
BenchmarkMatrixMultiply-16 | 6347768 | 189.2 ns/op | 224 B/op | 5 allocs/op |
BenchmarkMatrixDeterminant4x4-16 | 799813 | 1514 ns/op | 1568 B/op | 52 allocs/op |
BenchmarkMatrixMinor3x3-16 | 14114458 | 83.44 ns/op | 80 B/op | 3 allocs/op |
BenchmarkMatrixCofactor3x3-16 | 14621076 | 81.79 ns/op | 80 B/op | 3 allocs/op |
BenchmarkMatrixInverse4x4-16 | 151344 | 7859 ns/op | 8064 B/op | 265 allocs/op |
BenchmarkPVTransform-16 | 255785548 | 4.582 ns/op | 0 B/op | 0 allocs/op |
BenchmarkPVReflect-16 | 707641048 | 1.715 ns/op | 0 B/op | 0 allocs/op |
BenchmarkRayTransform-16 | 88858610 | 13.39 ns/op | 0 B/op | 0 allocs/op |
pkg: github.com/factorion/graytracer/pkg/shapes cpu: AMD Ryzen 7 5800H with Radeon Graphics
Function | Iterations | Speed | Memory | Allocations |
---|---|---|---|---|
BenchmarkConeIntersection-16 | 9989410 | 121.4 ns/op | 128 B/op | 2 allocs/op |
BenchmarkConeNormal-16 | 7841389 | 155.3 ns/op | 224 B/op | 5 allocs/op |
BenchmarkCubeIntersection-16 | 15381164 | 70.61 ns/op | 80 B/op | 1 allocs/op |
BenchmarkCubeNormal-16 | 7521614 | 156.3 ns/op | 224 B/op | 5 allocs/op |
BenchmarkCylinderIntersection-16 | 9446713 | 124.3 ns/op | 128 B/op | 2 allocs/op |
BenchmarkCylinderNormal-16 | 7790467 | 151.1 ns/op | 224 B/op | 5 allocs/op |
BenchmarkPlaneIntersection-16 | 19712168 | 60.18 ns/op | 48 B/op | 1 allocs/op |
BenchmarkPlaneNormal-16 | 8302458 | 148.8 ns/op | 224 B/op | 5 allocs/op |
BenchmarkSphereIntersection-16 | 9833896 | 120.2 ns/op | 128 B/op | 2 allocs/op |
BenchmarkSphereNormal-16 | 7740237 | 150.4 ns/op | 224 B/op | 5 allocs/op |
BenchmarkTriangleIntersection-16 | 16434596 | 71.02 ns/op | 48 B/op | 1 allocs/op |
BenchmarkTriangleNormal-16 | 8217364 | 143.5 ns/op | 224 B/op | 5 allocs/op |
pkg: github.com/factorion/graytracer/pkg/components cpu: AMD Ryzen 7 5800H with Radeon Graphics
Function | Iterations | Speed | Memory | Allocations |
---|---|---|---|---|
BenchmarkNoBoundingBoxes-16 | 4136 | 291257 ns/op | 7936 B/op | 113 allocs/op |
Benchmark8BoundingBoxes-16 | 18379 | 64370 ns/op | 10080 B/op | 124 allocs/op |
Benchmark64BoundingBoxes-16 | 60115 | 20114 ns/op | 10240 B/op | 129 allocs/op |