Skip to content

Commit

Permalink
FrameRender
Browse files Browse the repository at this point in the history
  • Loading branch information
fogleman committed Sep 3, 2016
1 parent a5bc73a commit 7a817c4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pt/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,12 @@ func ChannelRender(scene *Scene, camera *Camera, sampler Sampler, w, h, samplesP
}()
return ch
}

func FrameRender(path string, iterations int, scene *Scene, camera *Camera, sampler Sampler, w, h, samplesPerPixel int, wg *sync.WaitGroup) {
buf := NewBuffer(w, h)
for i := 1; i <= iterations; i++ {
render(scene, camera, sampler, samplesPerPixel, buf)
}
wg.Add(1)
go writeImage(path, buf.Copy(), ColorChannel, wg)
}

0 comments on commit 7a817c4

Please sign in to comment.