module
Version:
v0.15.5
Opens a new window with list of versions in this module.
Published: Jun 28, 2022
License: MIT
Opens a new window with license information.
README
¶
graytracer
Raytracer written in Go, based on the book The Ray Tracer Challenge by Jamis Buck.
Current progress
Latest Render
Benchmark stats
Benchmarks of primitives calculation
pkg: github.com/factorion/graytracer/pkg/primitives
cpu: AMD Ryzen 7 2700 Eight-Core Processor
Function |
Iterations |
Speed |
Memory |
Allocations |
BenchmarkSubmatrix4x4-16 |
5329711 |
223.5 ns/op |
152 B/op |
4 allocs/op |
BenchmarkMatrixMultiply-16 |
3388286 |
357.6 ns/op |
224 B/op |
5 allocs/op |
BenchmarkMatrixDeterminant4x4-16 |
387013 |
3099 ns/op |
1568 B/op |
52 allocs/op |
BenchmarkMatrixMinor3x3-16 |
7517265 |
160.8 ns/op |
80 B/op |
3 allocs/op |
BenchmarkMatrixCofactor3x3-16 |
7162288 |
168.5 ns/op |
80 B/op |
3 allocs/op |
BenchmarkMatrixInverse4x4-16 |
74745 |
16077 ns/op |
8064 B/op |
265 allocs/op |
BenchmarkPVTransform-16 |
131638082 |
9.265 ns/op |
0 B/op |
0 allocs/op |
BenchmarkPVReflect-16 |
178992032 |
6.959 ns/op |
0 B/op |
0 allocs/op |
BenchmarkRayTransform-16 |
37492969 |
32.03 ns/op |
0 B/op |
0 allocs/op |
Benchmarks of basic shape calculations
pkg: github.com/factorion/graytracer/pkg/shapes
cpu: AMD Ryzen 7 2700 Eight-Core Processor
Function |
Iterations |
Speed |
Memory |
Allocations |
BenchmarkConeIntersection-16 |
5701870 |
207.7 ns/op |
72 B/op |
2 allocs/op |
BenchmarkConeNormal-16 |
3989524 |
305.8 ns/op |
224 B/op |
5 allocs/op |
BenchmarkCubeIntersection-16 |
9322422 |
130.6 ns/op |
48 B/op |
1 allocs/op |
BenchmarkCubeNormal-16 |
3650877 |
319.7 ns/op |
224 B/op |
5 allocs/op |
BenchmarkCylinderIntersection-16 |
5483966 |
214.8 ns/op |
72 B/op |
2 allocs/op |
BenchmarkCylinderNormal-16 |
3969734 |
301.9 ns/op |
224 B/op |
5 allocs/op |
BenchmarkPlaneIntersection-16 |
10618462 |
112.5 ns/op |
24 B/op |
1 allocs/op |
BenchmarkPlaneNormal-16 |
4438746 |
273.1 ns/op |
224 B/op |
5 allocs/op |
BenchmarkSphereIntersection-16 |
6149660 |
200.8 ns/op |
72 B/op |
2 allocs/op |
BenchmarkSphereNormal-16 |
3968947 |
300.2 ns/op |
224 B/op |
5 allocs/op |
BenchmarkTriangleIntersection-16 |
11317957 |
107.5 ns/op |
24 B/op |
1 allocs/op |
BenchmarkTriangleNormal-16 |
4596672 |
266.7 ns/op |
224 B/op |
5 allocs/op |
Benchmarks of different bounding box setups with 4096 spheres
pkg: github.com/factorion/graytracer/pkg/components
cpu: AMD Ryzen 7 2700 Eight-Core Processor
Function |
Iterations |
Speed |
Memory |
Allocations |
BenchmarkNoBoundingBoxes-16 |
1711 |
614977 ns/op |
5960 B/op |
113 allocs/op |
Benchmark8BoundingBoxes-16 |
10000 |
117799 ns/op |
7336 B/op |
124 allocs/op |
Benchmark64BoundingBoxes-16 |
32006 |
37650 ns/op |
7432 B/op |
129 allocs/op |
Click to show internal directories.
Click to hide internal directories.