This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PYTHON_CONFIGURE_OPTS="--enable-framework" CFLAGS="-I$(brew --prefix xz)/include" LDFLAGS="-L$(brew --prefix xz)/lib" pyenv install 3.8.11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| render(){ | |
| // ... | |
| // set up worker group | |
| var wg sync.WaitGroup | |
| for thread := 0; thread < NumThreads; thread++{ | |
| wg.Add(1) | |
| go func(offset int){ | |
| for pixel := offset; pixel < width; pixel +=NumThreads { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // line 293 | |
| var globalRand = New(&lockedSource{src: NewSource(1).(*rngSource)}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ( | |
| // ... | |
| math/rand | |
| ) | |
| sample(pixel int) { | |
| rgb:= p.Vector{} | |
| for s := 0; s < ns; s++{ | |
| u := (float64(i) + rand.Float64()) / float64(width) | |
| ray := camera.RayAt(u) | |
| rgb = rgb.Add(color(ray, world, 0, rand)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sample(pixel int, rand *rand.Rand) { | |
| rgb:= p.Vector{} | |
| for s := 0; s < ns; s++{ | |
| u := (float64(i) + rand.Float64()) / float64(width) | |
| ray := camera.RayAt(u) | |
| rgb = rgb.Add(color(ray, world, 0, rand)) | |
| } | |
| return rgb.DivideScalar(float64(ns)) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| render(){ | |
| // ... | |
| // pixels for a single row | |
| for pixel := 0; pixel < width ; pixel ++ { | |
| sample(pixel) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| render(){ | |
| // ... | |
| // set up worker group | |
| var wg sync.WaitGroup | |
| for thread := 0; thread < NumThreads; thread++{ | |
| wg.Add(1) | |
| go func(offset int){ | |
| // create RNG for thread |